File indexing completed on 2024-11-24 04:19:27

0001 #include <QQmlApplicationEngine>
0002 
0003 #include <QCommandLineParser>
0004 #include <QFileInfo>
0005 #include <QIcon>
0006 #include <QQmlApplicationEngine>
0007 #include <QQmlContext>
0008 
0009 #include <QGuiApplication>
0010 #include <QIcon>
0011 
0012 #include <KLocalizedString>
0013 #include <KAboutData>
0014 
0015 #include <MauiKit3/Core/mauiapp.h>
0016 #include "plantslist.h"
0017 
0018 int main(int argc, char *argv[])
0019 {
0020     QGuiApplication app(argc, argv);
0021 
0022     app.setOrganizationName(QStringLiteral("Maui"));
0023     app.setWindowIcon(QIcon(":/assets/mauidemo.svg"));
0024 
0025     KLocalizedString::setApplicationDomain("mauidemo");
0026 
0027     MauiApp::instance()->setIconName("qrc:/assets/mauidemo.svg");
0028 
0029     QQmlApplicationEngine engine;
0030     const QUrl url(u"qrc:/untitled1-6/main.qml"_qs);
0031     QObject::connect(&engine, &QQmlApplicationEngine::objectCreated,
0032                      &app, [url](QObject *obj, const QUrl &objUrl) {
0033         if (!obj && url == objUrl)
0034             QCoreApplication::exit(-1);
0035     }, Qt::QueuedConnection);
0036 
0037     engine.rootContext()->setContextObject(new KLocalizedContext(&engine));
0038     qmlRegisterType<PlantsList>("org.maui.demo", 1, 0, "PlantsList");
0039 
0040     engine.load(url);
0041 
0042     return app.exec();
0043 }