Changeset a713b103e8 in tspsg
- Timestamp:
- Sep 10, 2010, 7:49:32 PM (14 years ago)
- Branches:
- 0.1.3.145-beta1-symbian, 0.1.4.170-beta2-bb10, appveyor, imgbot, master, readme
- Children:
- cac8759dba
- Parents:
- 2a436ea693
- git-author:
- Oleksii Serdiuk <contacts@…> (09/10/10 19:49:32)
- git-committer:
- Oleksii Serdiuk <contacts@…> (06/29/12 19:45:57)
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
resources/tspsg.rc
r2a436ea693 ra713b103e8 44 44 BEGIN 45 45 // VALUE "Comments", VERSIONID 46 VALUE "ProductName", "TSP Solver and Generator" 47 VALUE "ProductVersion", BUILD_VERSION 46 48 VALUE "CompanyName", "Oleksii ""Lёppa"" Serdiuk" 47 49 VALUE "FileDescription", "TSPSG: TSP Solver and Generator" … … 49 51 VALUE "InternalName", "TSPSG" 50 52 VALUE "LegalCopyright", "Copyright © 2007-2010 Oleksii ""Lёppa"" Serdiuk <contacts[at]oleksii[dot]name>" 53 #ifdef QT_NO_DEBUG 51 54 VALUE "OriginalFilename", "tspsg.exe" 52 VALUE "ProductName", "TSPSG: TSP Solver and Generator" 53 VALUE "ProductVersion", BUILD_VERSION 54 #if defined(_DEBUG) || defined(DEBUG) 55 #else 56 VALUE "OriginalFilename", "tspsgd.exe" 57 #endif 58 #ifndef QT_NO_DEBUG 55 59 VALUE "PrivateBuild", "Debug development build" 56 60 #elif BUILD_NUMBER == 65535 -
src/mainwindow.cpp
r2a436ea693 ra713b103e8 711 711 QApplication::processEvents(QEventLoop::ExcludeUserInputEvents); 712 712 713 #ifndef QT_NO_CONCURRENT 713 714 QFuture<void> f = QtConcurrent::run(&solver, &CTSPSolver::cleanup, false); 714 715 while (!f.isFinished()) { 715 716 QApplication::processEvents(QEventLoop::ExcludeUserInputEvents); 716 717 } 718 #else 719 solver.cleanup(true); 720 #endif 717 721 pd.reset(); 718 722 #ifdef Q_OS_WIN32 … … 742 746 pic.begin(&graph); 743 747 pic.setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform); 744 QFont font = settings->value("Output/Font", QFont(DEF_FONT_FACE, 9)).value<QFont>();748 QFont font = qvariant_cast<QFont>(settings->value("Output/Font", QFont(DEF_FONT_FACE, 9))); 745 749 if (settings->value("Output/HQGraph", DEF_HQ_GRAPH).toBool()) { 746 750 font.setWeight(QFont::DemiBold); … … 792 796 tl->SetProgressState(winId(), TBPF_INDETERMINATE); 793 797 #endif 798 #ifndef QT_NO_CONCURRENT 794 799 QFuture<void> f = QtConcurrent::run(&solver, &CTSPSolver::cleanup, false); 795 800 while (!f.isFinished()) { 796 801 QApplication::processEvents(QEventLoop::ExcludeUserInputEvents); 797 802 } 803 #else 804 solver.cleanup(true); 805 #endif 798 806 solutionText->clear(); 799 807 toggleSolutionActions(false); … … 920 928 tl->SetProgressState(winId(), TBPF_INDETERMINATE); 921 929 #endif 930 #ifndef QT_NO_CONCURRENT 922 931 QFuture<void> f = QtConcurrent::run(&solver, &CTSPSolver::cleanup, false); 923 932 while (!f.isFinished()) { 924 933 QApplication::processEvents(QEventLoop::ExcludeUserInputEvents); 925 934 } 935 #else 936 solver.cleanup(true); 937 #endif 926 938 toggleSolutionActions(); 927 939 tabWidget->setCurrentIndex(1); … … 1045 1057 settings->endGroup(); 1046 1058 } 1059 #else 1060 settings->setValue("MainWindow/ToolbarVisible", toolBarMain->isVisible()); 1047 1061 #endif // HANDHELD 1048 1062 } else { … … 1139 1153 void MainWindow::initDocStyleSheet() 1140 1154 { 1141 solutionText->document()->setDefaultFont( settings->value("Output/Font", QFont(DEF_FONT_FACE, DEF_FONT_SIZE)).value<QFont>());1155 solutionText->document()->setDefaultFont(qvariant_cast<QFont>(settings->value("Output/Font", QFont(DEF_FONT_FACE, DEF_FONT_SIZE)))); 1142 1156 1143 1157 fmt_paragraph.setTopMargin(0); … … 1158 1172 settings->beginGroup("Output/Colors"); 1159 1173 1160 QColor color = settings->value("Text", DEF_TEXT_COLOR).value<QColor>();1174 QColor color = qvariant_cast<QColor>(settings->value("Text", DEF_TEXT_COLOR)); 1161 1175 QColor hilight; 1162 1176 if (color.value() < 192) … … 1168 1182 fmt_default.setForeground(QBrush(color)); 1169 1183 1170 fmt_selected.setForeground(QBrush( settings->value("Selected", DEF_SELECTED_COLOR).value<QColor>()));1184 fmt_selected.setForeground(QBrush(qvariant_cast<QColor>(settings->value("Selected", DEF_SELECTED_COLOR)))); 1171 1185 fmt_selected.setFontWeight(QFont::Bold); 1172 1186 1173 fmt_alternate.setForeground(QBrush( settings->value("Alternate", DEF_ALTERNATE_COLOR).value<QColor>()));1187 fmt_alternate.setForeground(QBrush(qvariant_cast<QColor>(settings->value("Alternate", DEF_ALTERNATE_COLOR)))); 1174 1188 fmt_alternate.setFontWeight(QFont::Bold); 1175 1189 fmt_altlist.setForeground(QBrush(hilight)); … … 1398 1412 { 1399 1413 if (all) 1400 Ui ::MainWindow::retranslateUi(this);1414 Ui_MainWindow::retranslateUi(this); 1401 1415 1402 1416 loadStyleList(); … … 1474 1488 void MainWindow::setupUi() 1475 1489 { 1476 Ui ::MainWindow::setupUi(this);1490 Ui_MainWindow::setupUi(this); 1477 1491 1478 1492 // File Menu … … 1480 1494 actionFileOpen->setIcon(GET_ICON("document-open")); 1481 1495 actionFileSave->setIcon(GET_ICON("document-save")); 1496 #ifndef HANDHELD 1482 1497 menuFileSaveAs->setIcon(GET_ICON("document-save-as")); 1498 #endif 1483 1499 actionFileExit->setIcon(GET_ICON("application-exit")); 1484 1500 // Settings Menu 1501 #ifndef HANDHELD 1485 1502 menuSettingsLanguage->setIcon(GET_ICON("preferences-desktop-locale")); 1486 actionSettingsLanguageEnglish->setIcon(GET_ICON("flag-gb")); 1503 #if QT_VERSION >= 0x040600 1504 actionSettingsLanguageEnglish->setIcon(QIcon::fromTheme("flag-gb", QIcon(":/images/icons/l10n/flag-gb.png"))); 1505 #else // QT_VERSION >= 0x040600 1506 actionSettingsLanguageEnglish->setIcon(QIcon(":/images/icons/l10n/flag-gb.png")); 1507 #endif // QT_VERSION >= 0x040600 1487 1508 menuSettingsStyle->setIcon(GET_ICON("preferences-desktop-theme")); 1509 #endif // HANDHELD 1488 1510 actionSettingsPreferences->setIcon(GET_ICON("preferences-system")); 1489 1511 // Help Menu 1512 #ifndef HANDHELD 1490 1513 actionHelpContents->setIcon(GET_ICON("help-contents")); 1491 1514 actionHelpContextual->setIcon(GET_ICON("help-contextual")); 1492 1515 actionHelpAbout->setIcon(GET_ICON("help-about")); 1516 #endif 1493 1517 // Buttons 1494 1518 buttonRandom->setIcon(GET_ICON("roll")); … … 1589 1613 // toolBarManager->addAction(action, cat); 1590 1614 toolBarManager->restoreState(settings->value("MainWindow/Toolbars").toByteArray()); 1615 #else 1616 toolBarMain->setVisible(settings->value("MainWindow/ToolbarVisible", true).toBool()); 1591 1617 #endif // HANDHELD 1592 1618 -
src/settingsdialog.cpp
r2a436ea693 ra713b103e8 255 255 cbScrollToEnd->setChecked(settings->value("ScrollToEnd", DEF_SCROLL_TO_END).toBool()); 256 256 257 font = settings->value("Font", QFont(DEF_FONT_FACE, DEF_FONT_SIZE)).value<QFont>();258 color = settings->value("Colors/Text", DEF_TEXT_COLOR).value<QColor>();257 font = qvariant_cast<QFont>(settings->value("Font", QFont(DEF_FONT_FACE, DEF_FONT_SIZE))); 258 color = qvariant_cast<QColor>(settings->value("Colors/Text", DEF_TEXT_COLOR)); 259 259 settings->endGroup(); 260 260
Note: See TracChangeset
for help on using the changeset viewer.