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"); file.open(QFile::ReadOnly); QString styleSheet = QLatin1String(file.readAll()); app.setStyleSheet(styleSheet); MainDialog dialog; return dialog.exec(); }
// Do main dialog, return TRUE if canceled BOOL DoMainDialog(BOOL &optionPlaceStructs, BOOL &optionProcessStatic, BOOL &optionOverwriteComments, BOOL &optionAudioOnDone, BOOL &optionClean, BOOL &optionFullClear) { MainDialog dlg = MainDialog(optionPlaceStructs, optionProcessStatic, optionOverwriteComments, optionAudioOnDone, optionClean, optionFullClear); if (dlg.exec()) { #define CHECKSTATE(obj,var) var = dlg.obj->isChecked() CHECKSTATE(checkBox1, optionPlaceStructs); CHECKSTATE(checkBox2, optionProcessStatic); CHECKSTATE(checkBox3, optionOverwriteComments); CHECKSTATE(checkBox4, optionAudioOnDone); CHECKSTATE(checkBox5, optionClean); CHECKSTATE(checkBox6, optionFullClear); #undef CHECKSTATE return(FALSE); } return(TRUE); }