-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.cpp
37 lines (26 loc) · 921 Bytes
/
main.cpp
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
34
35
36
37
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QQmlContext>
#include <time.h>
#include <QDebug>
#include "cpp/restartapp.h"
#include "cpp/qmlclipboardapter.h"
int main(int argc, char *argv[])
{
clock_t start,finish;
double totaltime;
start=clock();
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QGuiApplication app(argc, argv);
QQmlApplicationEngine engine;
qmlRegisterType<QmlClipboardAdapter>("Toou_QML_Tools", 1, 0, "LClipboard");
ReStartApp *restart = new ReStartApp(&engine);
engine.rootContext()->setContextProperty("_root_window_", restart->initSignal());
// engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
// if (engine.rootObjects().isEmpty())
// return -1;
finish=clock();
totaltime=(double)(finish-start)/CLOCKS_PER_SEC;
qDebug() << "startup time :" << totaltime << "s";
return app.exec();
}