diff --git a/ground/openpilotgcs/src/app/main.cpp b/ground/openpilotgcs/src/app/main.cpp index ec2191956..06825b450 100644 --- a/ground/openpilotgcs/src/app/main.cpp +++ b/ground/openpilotgcs/src/app/main.cpp @@ -229,6 +229,30 @@ static void overrideSettings(QSettings &settings, int argc, char **argv){ settings.sync(); } +static inline void loadStyleSheet() { + /* Let's use QFile and point to a resource... */ +#ifdef Q_OS_MAC + QFile data(QCoreApplication::applicationDirPath()+"/macos.qss"); +#elif defined(Q_OS_LINUX) + QFile data(QCoreApplication::applicationDirPath()+"/linux.qss"); +#else + QFile data(QCoreApplication::applicationDirPath()+"/windows.qss"); +#endif + QString style; + /* ...to open the file */ + if(data.open(QFile::ReadOnly)) { + /* QTextStream... */ + QTextStream styleIn(&data); + /* ...read file to a string. */ + style = styleIn.readAll(); + data.close(); + /* We'll use qApp macro to get the QApplication pointer + * and set the style sheet application wide. */ + qApp->setStyleSheet(style); + qDebug()<<"Loaded stylesheet:"<hasError()) { displayError(msgCoreLoadFailure(coreplugin->errorString())); return 1;