-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
32 lines (29 loc) · 802 Bytes
/
main.cpp
File metadata and controls
32 lines (29 loc) · 802 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
#include <QApplication>
#include <QFile>
#include <QIcon>
#include "log.h"
#include "scoped_exit.h"
#include "playlist_window.h"
int main(int argc, char* argv[])
{
std::string app_name(argv[0]);
init_log(app_name + ".log");
DEFER(shutdown_log());
QApplication app(argc, argv);
QFile style_file(":/style/stylesheet.qss");
if (style_file.open(QFile::ReadOnly))
{
QString style_sheet = QLatin1String(style_file.readAll());
app.setStyleSheet(style_sheet);
style_file.close();
LOG_INFO("样式表加载成功");
}
else
{
LOG_WARN("无法加载样式表文件");
}
QApplication::setWindowIcon(QIcon(":/icons/app_icon.svg"));
playlist_window main_window;
main_window.show();
return QApplication::exec();
}