Changeset 149 in tspsg-svn for trunk/src/main.cpp
- Timestamp:
- Dec 20, 2010, 9:53:45 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/main.cpp
r141 r149 24 24 #include "mainwindow.h" 25 25 #if QT_VERSION < 0x040600 26 #ifdef Q_CC_MSVC27 #pragma message("WARNING: You are using Qt version < 4.6. Application will not support some non-critical features.")28 #elif defined(Q_CC_GNU)29 #warning WARNING: You are using Qt version < 4.6. Application will not support some non-critical features.30 #else31 #error You are using Qt version < 4.6. Application will not support some non-critical features. To continue, please, comment line 31 at main.cpp.32 #endif26 # ifdef Q_CC_MSVC 27 # pragma message("WARNING: You are using Qt version < 4.6. Application will not support some non-critical features.") 28 # elif defined(Q_CC_GNU) 29 # warning WARNING: You are using Qt version < 4.6. Application will not support some non-critical features. 30 # else 31 # error You are using Qt version < 4.6. Application will not support some non-critical features. To continue, please, comment line 31 at main.cpp. 32 # endif 33 33 #endif 34 34 … … 42 42 { 43 43 QApplication app(argc, argv); 44 45 46 47 48 49 50 51 44 app.setOverrideCursor(QCursor(Qt::WaitCursor)); 45 QTextCodec::setCodecForLocale(QTextCodec::codecForName("utf8")); 46 QTextCodec::setCodecForCStrings(QTextCodec::codecForName("utf8")); 47 QTextCodec::setCodecForTr(QTextCodec::codecForName("utf8")); 48 app.setOrganizationName("Oleksii \"Lёppa\" Serdiuk"); 49 app.setOrganizationDomain("oleksii.name"); 50 app.setApplicationName("TSP Solver and Generator"); 51 app.setApplicationVersion(BUILD_VERSION); 52 52 53 54 53 // Seeding random number generator 54 qsrand(QDateTime::currentDateTime().toTime_t() ^ QCursor::pos().x() ^ QCursor::pos().y()); 55 55 56 56 #ifdef Q_WS_WINCE_WM 57 57 // Qt "leaves" unpacked .ttf files after running - let's try to delete them. 58 58 QStringList files = QDir(app.applicationDirPath(), "*.ttf").entryList(); 59 60 61 59 foreach (QString file, files) { 60 QFile::remove(file); 61 } 62 62 #endif 63 64 65 63 // Don't load the font if it is already available 64 if (!QFontDatabase().families().contains(DEF_FONT_FACE)) 65 QFontDatabase::addApplicationFont(":/files/DejaVuLGCSansMono.ttf"); 66 66 67 67 QTranslator en; 68 69 70 71 68 if (en.load("tspsg_en", PATH_L10N)) 69 app.installTranslator(&en); 70 else if (en.load("tspsg_en", ":/l10n")) 71 app.installTranslator(&en); 72 72 73 73 MainWindow mainwindow; 74 74 #ifdef HANDHELD 75 75 mainwindow.showMaximized(); 76 76 #else // HANDHELD 77 77 mainwindow.show(); 78 78 #endif // HANDHELD 79 80 79 app.restoreOverrideCursor(); 80 return app.exec(); 81 81 }
Note: See TracChangeset
for help on using the changeset viewer.