QTfrontend/main.cpp
branchqt5transition
changeset 13179 ddfb4a73524b
parent 13178 b4f48e7a4953
child 13180 3961f9d0c7e4
equal deleted inserted replaced
13178:b4f48e7a4953 13179:ddfb4a73524b
   153 .arg(HWApplication::tr("Custom path to the game data folder", "command-line"))
   153 .arg(HWApplication::tr("Custom path to the game data folder", "command-line"))
   154 .arg(HWApplication::tr("Hedgewars can use a %1 (e.g. \"%2\") to connect on start.", "command-line").arg(HWApplication::tr("CONNECTSTRING", "command-line")).arg(QString("hwplay://") + NETGAME_DEFAULT_SERVER));
   154 .arg(HWApplication::tr("Hedgewars can use a %1 (e.g. \"%2\") to connect on start.", "command-line").arg(HWApplication::tr("CONNECTSTRING", "command-line")).arg(QString("hwplay://") + NETGAME_DEFAULT_SERVER));
   155 }
   155 }
   156 
   156 
   157 int main(int argc, char *argv[]) {
   157 int main(int argc, char *argv[]) {
   158 	/* Qt5 removed motif, plastique.  These are now in qt5-style-plugins which was NOT backported by debian/ubuntu to stable/LTS - windows appears to render best of the remaining options */
   158 	/* Qt5 removed motif, plastique.  These are now in 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. */
       
   159 	// set windows initially
   159 	QApplication::setStyle(QStyleFactory::create("windows"));
   160 	QApplication::setStyle(QStyleFactory::create("windows"));
       
   161 	// try setting plastique if available from qt5-style-plugins - in testing qt5 skips the call on fail to locate which leaves us on windows
       
   162 	QApplication::setStyle(QStyleFactory::create("plastique"));
   160     // Since we're calling this first, closeResources() will be the last thing called after main() returns.
   163     // Since we're calling this first, closeResources() will be the last thing called after main() returns.
   161     atexit(closeResources);
   164     atexit(closeResources);
   162 
   165 
   163 #ifdef __APPLE__
   166 #ifdef __APPLE__
   164     cocoaInit = new CocoaInitializer(); // Creates the autoreleasepool preventing cocoa object leaks on OS X.
   167     cocoaInit = new CocoaInitializer(); // Creates the autoreleasepool preventing cocoa object leaks on OS X.
   165 #endif
   168 #endif
   166 
   169 
   167     SDLInteraction::instance();
   170     SDLInteraction::instance();
   168 
   171 
   169     HWApplication app(argc, argv);
   172     HWApplication app(argc, argv);
   170 	//qDebug() << app.style();
       
   171     app.setAttribute(Qt::AA_DontShowIconsInMenus,false);
   173     app.setAttribute(Qt::AA_DontShowIconsInMenus,false);
   172 
   174 
   173     // file engine, to be initialized later
   175     // file engine, to be initialized later
   174     engine = NULL;
   176     engine = NULL;
   175 
   177