-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
44 lines (29 loc) · 888 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
38
39
40
41
42
43
44
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QtQuick3D/qquick3d.h>
#include <QQmlContext>
#include"window.h"
// class Window : public QObject{
// Q_OBJECT
// public:
// void setCursorPos(QPoint p){
// QCursor::setPos(p);
// }
// };
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
// QSurfaceFormat::setDefaultFormat(QQuick3D::idealSurfaceFormat());
// qputenv("QT_QUICK_CONTROLS_STYLE", "Basic");
QQmlApplicationEngine engine;
QObject::connect(
&engine,
&QQmlApplicationEngine::objectCreationFailed,
&app,
[]() { QCoreApplication::exit(-1); },
Qt::QueuedConnection);
engine.loadFromModule("firstProjectNewQt", "Main");
Window window;
engine.rootContext()->setContextProperty("window1",&window);
return app.exec();
}