1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-15 21:19:57 +00:00
openmw-tes3mp/apps/launcher/main.cpp
2011-07-30 19:19:24 +02:00

40 lines
816 B
C++

#include <QApplication>
#include <QDir>
#include <QFile>
#include <QDebug>
#include "maindialog.hpp"
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
// Now we make sure the current dir is set to application path
QDir dir(QCoreApplication::applicationDirPath());
#if defined(Q_OS_MAC)
if (dir.dirName() == "MacOS") {
dir.cdUp();
dir.cdUp();
dir.cdUp();
}
#endif
QDir::setCurrent(dir.absolutePath());
// Load the stylesheet
QFile file("./launcher.qss");
QFileInfo fi(file);
qDebug() << "Stylesheet path is: " << fi.absoluteFilePath();
file.open(QFile::ReadOnly);
QString styleSheet = QLatin1String(file.readAll());
app.setStyleSheet(styleSheet);
MainDialog dialog;
return dialog.exec();
}