QTfrontend/main.cpp
changeset 6176 19ef039a8474
parent 6174 2d5717595471
child 6177 5eba8970e8ae
--- a/QTfrontend/main.cpp	Sat Oct 22 00:00:48 2011 +0200
+++ b/QTfrontend/main.cpp	Sat Oct 22 01:00:21 2011 +0200
@@ -481,8 +481,24 @@
     // this creates the autoreleasepool that prevents leaking
     CocoaInitializer initializer;
 #endif
+    // load external stylesheet if there is any
+    QFile * file =
+        new QFile(HWDataManager::instance().findFileForRead("misc/qt_style.css"));
 
-    app.form = new HWForm(NULL,styleSheetFromHell);
+    if (file->exists() && file->open(QIODevice::ReadOnly | QIODevice::Text))
+    {
+        QString style = "";
+        QTextStream in(file);
+        while (!in.atEnd())
+        {
+            QString line = in.readLine();
+            if(!line.isEmpty())
+                style.append(line);
+        }
+        app.form = new HWForm(NULL, style);
+    }
+    else
+        app.form = new HWForm(NULL, styleSheetFromHell);
 
     app.form->show();
     return app.exec();