QTfrontend/main.cpp
changeset 6176 19ef039a8474
parent 6174 2d5717595471
child 6177 5eba8970e8ae
equal deleted inserted replaced
6175:a80833ddaef0 6176:19ef039a8474
   479 #endif
   479 #endif
   480 #ifdef __APPLE__
   480 #ifdef __APPLE__
   481     // this creates the autoreleasepool that prevents leaking
   481     // this creates the autoreleasepool that prevents leaking
   482     CocoaInitializer initializer;
   482     CocoaInitializer initializer;
   483 #endif
   483 #endif
   484 
   484     // load external stylesheet if there is any
   485     app.form = new HWForm(NULL,styleSheetFromHell);
   485     QFile * file =
       
   486         new QFile(HWDataManager::instance().findFileForRead("misc/qt_style.css"));
       
   487 
       
   488     if (file->exists() && file->open(QIODevice::ReadOnly | QIODevice::Text))
       
   489     {
       
   490         QString style = "";
       
   491         QTextStream in(file);
       
   492         while (!in.atEnd())
       
   493         {
       
   494             QString line = in.readLine();
       
   495             if(!line.isEmpty())
       
   496                 style.append(line);
       
   497         }
       
   498         app.form = new HWForm(NULL, style);
       
   499     }
       
   500     else
       
   501         app.form = new HWForm(NULL, styleSheetFromHell);
   486 
   502 
   487     app.form->show();
   503     app.form->show();
   488     return app.exec();
   504     return app.exec();
   489 }
   505 }