1
0
mirror of https://github.com/QRouland/UTPass.git synced 2025-01-24 07:36:39 +00:00
UTPass/main.in.cpp

35 lines
874 B
C++
Raw Normal View History

2019-09-20 21:29:39 +02:00
#include <QGuiApplication>
#include <QCoreApplication>
#include <QUrl>
#include <QString>
#include <QQuickView>
#include <QtQml>
2025-01-10 21:33:48 +01:00
#ifdef TEST_RUNNER
#include <QtQuickTest/quicktest.h>
#endif
2019-09-20 21:29:39 +02:00
int main(int argc, char *argv[])
{
qDebug() << "Starting app from main.cpp";
new QGuiApplication(argc, argv);
QGuiApplication::setApplicationName("utpass.qrouland");
2025-01-10 21:33:48 +01:00
#ifndef TEST_RUNNER
2019-09-20 21:29:39 +02:00
auto *view = new QQuickView();
view->setSource(QUrl(QStringLiteral("qml/Main.qml")));
view->setResizeMode(QQuickView::SizeRootObjectToView);
view->show();
QObject *mainView = view->findChild<QObject *>("mainView");
QMetaObject::invokeMethod(
mainView, "initPass",
Q_ARG(QVariant, QVariant::fromValue(mainView))
);
return QGuiApplication::exec();
2025-01-10 21:33:48 +01:00
#else
return quick_test_main(argc, argv, "@TESTS_PATH@", "@TESTS_PATH@");
#endif
2019-09-20 21:29:39 +02:00
}