-
Notifications
You must be signed in to change notification settings - Fork 227
/
main.cpp
40 lines (36 loc) · 1.06 KB
/
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
#include <QApplication>
#include <QQmlApplicationEngine>
#include <QFont>
#include "ddui/ddview.h"
#include "ddui/ddquickview.h"
#include "ddui/ddnewquickwindow.h"
#define USE_NEW_WINDOW 1
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QApplication::setQuitOnLastWindowClosed(false);
QFont font;
font.setFamily("Microsoft YaHei");
font.setPixelSize(12);
app.setFont(font);
#ifdef USE_NEW_WINDOW
YbQuickView view;
view.setFlags(Qt::FramelessWindowHint|Qt::Window);
view.setHasMouse(false);
#ifndef QT_NO_DEBUG
view.setSourceAndRegsiterObj(QUrl::fromLocalFile("Driver/DDDriverView.qml"));
#else
view.setSourceAndRegsiterObj(QUrl("qrc:/Driver/DDDriverView.qml"));
#endif
view.showTrayIcon();
view.show();
view.setCanMoveRange(QPoint(view.width(),50));
#else
DDNewQuickWindow window;
window.setFlags(Qt::FramelessWindowHint|Qt::Window);
window.setSourceAndRegsiterObj(QUrl::fromLocalFile("Poetry/DDPoeTryPage.qml"));
window.show();
window.showTrayIcon();
#endif
return app.exec();
}