QTfrontend/main.cpp
changeset 7724 36c539c9cfb1
parent 7278 000e4543f204
child 7768 13e2037ebc79
child 7794 ab7b94c03bc9
equal deleted inserted replaced
7723:ca05b576ec74 7724:36c539c9cfb1
   270     // load external stylesheet if there is any
   270     // load external stylesheet if there is any
   271     QFile extFile(dataMgr.findFileForRead("css/" + fname));
   271     QFile extFile(dataMgr.findFileForRead("css/" + fname));
   272 
   272 
   273     QFile resFile(":/res/css/" + fname);
   273     QFile resFile(":/res/css/" + fname);
   274 
   274 
   275     QFile & file = (extFile.exists()?extFile:resFile);
   275     QFile & file = (extFile.exists() ? extFile : resFile);
   276 
   276 
   277     if (file.open(QIODevice::ReadOnly | QIODevice::Text))
   277     if (file.open(QIODevice::ReadOnly | QIODevice::Text))
   278     {
   278         style.append(file.readAll());
   279         QTextStream in(&file);
       
   280         while (!in.atEnd())
       
   281         {
       
   282             QString line = in.readLine();
       
   283             if(!line.isEmpty())
       
   284                 style.append(line);
       
   285         }
       
   286     }
       
   287 
   279 
   288     app.form = new HWForm(NULL, style);
   280     app.form = new HWForm(NULL, style);
   289     app.form->show();
   281     app.form->show();
   290     return app.exec();
   282     return app.exec();
   291 }
   283 }