HITDAQ/hit2023/main.cpp

31 lines
909 B
C++
Raw Permalink Normal View History

#include "mainwindow.h"
#include <QApplication>
2023-09-06 15:23:09 +02:00
#include <QFile>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
2023-09-06 15:23:09 +02:00
// Create and show your main window(s) or other windows here
// Apply the stylesheet to each display
qDebug() << "App path : " << qApp->applicationDirPath();
qApp->setStyleSheet("");
QString stylesheetPath = qApp->applicationDirPath()+"/styles/Medize.qss";
// Load and apply the new stylesheet
QFile styleFile(stylesheetPath);
if (styleFile.open(QFile::ReadOnly | QFile::Text)) {
QString style = QTextStream(&styleFile).readAll();
qApp->setStyleSheet(style);
styleFile.close();
} else {
qWarning("Failed to open stylesheet file: %s", qPrintable(stylesheetPath));
}
qDebug() << "Stylesheet applied:" << qApp->styleSheet(); // Add this line
MainWindow w;
w.show();
return a.exec();
}