-
Notifications
You must be signed in to change notification settings - Fork 58
Expand file tree
/
Copy pathmain.cpp
More file actions
35 lines (28 loc) · 953 Bytes
/
main.cpp
File metadata and controls
35 lines (28 loc) · 953 Bytes
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
#include<QApplication>
#include<QQuickView>
#include<QColor>
#include<QQmlContext>
#include<QQmlEngine>
#include<QDebug>
#include<QQuickItem>
#include<QString>
#include<QIcon>
#include "baidumusic.h"
#include "util.h"
int main(int argc,char* argv[])
{
QApplication app(argc,argv);
QQuickView viewer;
qmlRegisterType<BaiduMusic>("CleanPlayerCore",1,0,"BaiduMusic");
qmlRegisterType<Util>("CleanPlayerCore",1,0,"Util");
//无边框,背景透明
//viewer.setFlags(Qt::FramelessWindowHint|Qt::Window|Qt::WindowSystemMenuHint | Qt::WindowMinMaxButtonsHint);
// viewer.setTitle("Clean Player");
//这行不注释掉的话在XP系统无法正常显示
//viewer.setColor(QColor(Qt::transparent));
//viewer.rootContext()->setContextProperty("mainwindow",&viewer);
viewer.setSource(QUrl("qrc:/qml/qml/Main.qml"));
viewer.setIcon(QIcon(":/image/image/logo.png"));
viewer.show();
return app.exec();
}