-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
29 lines (22 loc) · 662 Bytes
/
main.cpp
File metadata and controls
29 lines (22 loc) · 662 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
#include "mainwindow.h"
#include <QFile>
#include <QApplication>
#include <QDir>
#include <QDebug>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
qDebug() << "Current working directory:" << QDir::currentPath();
qDebug() << "Application directory:" << QCoreApplication::applicationDirPath();
QFile file("../../stylesheet.qss");
if (file.open(QFile::ReadOnly)) {
QString style = QLatin1String(file.readAll());
qApp->setStyleSheet(style);
file.close();
} else {
qDebug() << "File does not exist at path:" << file.fileName();
}
w.show();
return a.exec();
}