diff -r 80db7232b4b5 -r 282218ab1b28 QTfrontend/main.cpp --- a/QTfrontend/main.cpp Sat Jul 21 02:19:32 2018 +0300 +++ b/QTfrontend/main.cpp Fri Jul 20 20:00:52 2018 -0400 @@ -161,28 +161,6 @@ } int main(int argc, char *argv[]) { - /* Qt5 Base removed Motif, Plastique. These are now in the Qt style plugins - (Ubuntu: qt5-style-plugins, which was NOT backported by Debian/Ubuntu to stable/LTS). - Windows appears to render best of the remaining options but still isn't quite right. */ - - // Try setting Plastique if available - QStyle* coreStyle; - coreStyle = QStyleFactory::create("Plastique"); - if(coreStyle != 0) { - QApplication::setStyle(coreStyle); - qDebug("Qt style set: Plastique"); - } else { - // Use Windows as fallback. - // FIXME: Under Windows style, some widgets like scrollbars don't render as nicely - coreStyle = QStyleFactory::create("Windows"); - if(coreStyle != 0) { - QApplication::setStyle(coreStyle); - qDebug("Qt style set: Windows"); - } else { - // Windows style should not be missing in Qt5 Base. If it does, something went terribly wrong! - qWarning("No Qt style could be set! Using the default one."); - } - } // Since we're calling this first, closeResources() will be the last thing called after main() returns. atexit(closeResources); @@ -191,8 +169,6 @@ cocoaInit = new CocoaInitializer(); // Creates the autoreleasepool preventing cocoa object leaks on OS X. #endif - SDLInteraction::instance(); - HWApplication app(argc, argv); app.setAttribute(Qt::AA_DontShowIconsInMenus,false); @@ -274,6 +250,29 @@ // end of parameter parsing + // Select Qt style + /* Qt5 Base removed Motif, Plastique. These are now in the Qt style plugins + (Ubuntu: qt5-style-plugins, which was NOT backported by Debian/Ubuntu to stable/LTS). + Windows appears to render best of the remaining options but still isn't quite right. */ + + // Try setting Plastique if available + QStyle* coreStyle; + coreStyle = QStyleFactory::create("Plastique"); + if(coreStyle != 0) { + QApplication::setStyle(coreStyle); + qDebug("Qt style set: Plastique"); + } else { + // Use Windows as fallback. + // FIXME: Under Windows style, some widgets like scrollbars don't render as nicely + coreStyle = QStyleFactory::create("Windows"); + if(coreStyle != 0) { + QApplication::setStyle(coreStyle); + qDebug("Qt style set: Windows"); + } else { + // Windows style should not be missing in Qt5 Base. If it does, something went terribly wrong! + qWarning("No Qt style could be set! Using the default one."); + } + } #ifdef Q_OS_WIN QPixmap pixmap(":/res/splash.png"); @@ -414,6 +413,8 @@ } #endif + SDLInteraction::instance(); + QString style = ""; QString fname;