-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
33 lines (23 loc) · 978 Bytes
/
main.cpp
File metadata and controls
33 lines (23 loc) · 978 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <QColor>
#include <QFontDatabase>
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include "Palette.h"
#include <ranges>
int main(int argc, char *argv[])
{
// const auto colors = generatePalette();
// validateColors(colors);
// const auto qColors = colors | std::views::transform([](auto c) { return rgbToQCOlor(rgb(c)); });
QGuiApplication app(argc, argv);
QQmlApplicationEngine engine;
// Palette palette(QList<QColor>{qColors.begin(), qColors.end()}, &app);
// engine.setInitialProperties({{"palette", QVariant::fromValue(&palette)}});
QGuiApplication::setFont(QFontDatabase::systemFont(QFontDatabase::FixedFont));
const QUrl url(u"qrc:/org/burbokop/cpp_palette_generator/Main.qml"_qs);
QObject::connect(&engine, &QQmlApplicationEngine::objectCreationFailed,
&app, []() { QCoreApplication::exit(-1); },
Qt::QueuedConnection);
engine.load(url);
return app.exec();
}