Changeset 89e5214692 in tspsg for src
- Timestamp:
- Sep 12, 2012, 6:50:04 PM (12 years ago)
- Branches:
- appveyor, imgbot, master, readme
- Children:
- 197f54a2b9
- Parents:
- f48433245d
- Location:
- src
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
src/3rdparty/qttoolbardialog-2.2_1-opensource/src/qttoolbardialog.h
rf48433245d r89e5214692 56 56 #endif 57 57 58 #if defined(Q_ WS_WIN)58 #if defined(Q_OS_WIN32) 59 59 # if !defined(QT_QTTOOLBARDIALOG_EXPORT) && !defined(QT_QTTOOLBARDIALOG_IMPORT) 60 60 # define QT_QTTOOLBARDIALOG_EXPORT -
src/defaults.h
rf48433245d r89e5214692 42 42 * \brief Default for "Use native file dialog". 43 43 */ 44 #ifdef Q_ WS_WINCE_WM44 #ifdef Q_OS_WINCE_WM 45 45 # define DEF_USE_NATIVE_DIALOGS false 46 46 #else 47 47 # define DEF_USE_NATIVE_DIALOGS true 48 #endif // Q_ WS_WINCE_WM48 #endif // Q_OS_WINCE_WM 49 49 //! Default for "Save main window state and position" 50 50 #define DEF_SAVEPOS true … … 53 53 * \brief Default for "Use translucency effects" 54 54 */ 55 #ifdef Q_ WS_WIN3255 #ifdef Q_OS_WIN32 56 56 # define DEF_USE_TRANSLUCENCY true 57 57 #else … … 102 102 * \brief Default font size 103 103 */ 104 #ifdef Q_ WS_S60104 #ifdef Q_OS_SYMBIAN 105 105 # define DEF_FONT_SIZE 8 106 106 #else 107 107 # define DEF_FONT_SIZE 10 108 #endif // Q_ WS_S60108 #endif // Q_OS_SYMBIAN 109 109 //! Default solution text color 110 110 #define DEF_TEXT_COLOR QPalette().color(QPalette::Text) -
src/globals.h
rf48433245d r89e5214692 34 34 # error You are using Qt version < 4.5 but minimum required version is 4.5.0. Compilation aborted. 35 35 #endif 36 #if defined(Q_ WS_WINCE_WM) || defined(Q_WS_S60) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)36 #if defined(Q_OS_WINCE_WM) || defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR) 37 37 //! This is defined on handheld devices (e.g., Windows Mobile, Symbian). 38 38 # define HANDHELD … … 131 131 inline bool hasUpdater() 132 132 { 133 #ifdef Q_ WS_WIN32133 #ifdef Q_OS_WIN32 134 134 return QFile::exists("updater/Update.exe"); 135 #else // Q_ WS_WIN32135 #else // Q_OS_WIN32 136 136 return false; 137 #endif // Q_ WS_WIN32137 #endif // Q_OS_WIN32 138 138 } 139 139 -
src/main.cpp
rf48433245d r89e5214692 41 41 int main(int argc, char *argv[]) 42 42 { 43 #ifdef Q_ WS_S6043 #ifdef Q_OS_SYMBIAN 44 44 // Not enough memory for solution graph generation with tasks 45 45 // of 20 and more cities if we use non-raster graphics system. … … 61 61 qsrand(QDateTime::currentDateTime().toTime_t() ^ QCursor::pos().x() ^ QCursor::pos().y()); 62 62 63 #ifdef Q_ WS_WINCE_WM63 #ifdef Q_OS_WINCE_WM 64 64 // Qt "leaves" unpacked .ttf files after running - let's try to delete them. 65 65 QStringList files = QDir(app.applicationDirPath(), "*.ttf").entryList(); … … 81 81 82 82 MainWindow mainwindow; 83 #ifdef Q_ WS_S6083 #ifdef Q_OS_SYMBIAN 84 84 //! \hack HACK: A workaround to hide Actions menu item in Symbian. 85 85 QWidgetList widgets = QApplication::allWidgets(); -
src/mainwindow.cpp
rf48433245d r89e5214692 24 24 #include "mainwindow.h" 25 25 26 #ifdef Q_ WS_WIN3226 #ifdef Q_OS_WIN32 27 27 # include "shobjidl.h" 28 28 #endif … … 80 80 #endif // QT_NO_PRINTER 81 81 82 #ifdef Q_ WS_WINCE_WM82 #ifdef Q_OS_WINCE_WM 83 83 currentGeometry = QApplication::desktop()->availableGeometry(0); 84 84 // We need to react to SIP show/hide and resize the window appropriately 85 85 connect(QApplication::desktop(), SIGNAL(workAreaResized(int)), SLOT(desktopResized(int))); 86 #endif // Q_ WS_WINCE_WM86 #endif // Q_OS_WINCE_WM 87 87 connect(actionFileNew, SIGNAL(triggered()), SLOT(actionFileNewTriggered())); 88 88 connect(actionFileOpen, SIGNAL(triggered()), SLOT(actionFileOpenTriggered())); … … 453 453 { 454 454 SettingsDialog sd(this); 455 #ifdef Q_ WS_S60455 #ifdef Q_OS_SYMBIAN 456 456 sd.setWindowState(Qt::WindowMaximized); 457 457 #endif … … 669 669 hb2->addWidget(bb); 670 670 671 #ifdef Q_ WS_WINCE_WM671 #ifdef Q_OS_WINCE_WM 672 672 vb->setMargin(3); 673 #endif // Q_ WS_WINCE_WM673 #endif // Q_OS_WINCE_WM 674 674 vb->addLayout(hb1); 675 675 #ifdef HANDHELD … … 714 714 #ifndef HANDHELD 715 715 dlg->resize(450, 350); 716 #elif defined(Q_ WS_S60)716 #elif defined(Q_OS_SYMBIAN) 717 717 dlg->setWindowState(Qt::WindowMaximized); 718 718 #endif … … 771 771 pd.show(); 772 772 773 #ifdef Q_ WS_WIN32773 #ifdef Q_OS_WIN32 774 774 HRESULT hr = CoCreateInstance(CLSID_TaskbarList, NULL, CLSCTX_INPROC_SERVER, IID_ITaskbarList3, (LPVOID*)&tl); 775 775 if (SUCCEEDED(hr)) { … … 788 788 connect(&solver, SIGNAL(routePartFound(int)), &pd, SLOT(setValue(int))); 789 789 connect(&pd, SIGNAL(canceled()), &solver, SLOT(cancel())); 790 #ifdef Q_ WS_WIN32790 #ifdef Q_OS_WIN32 791 791 if (tl != NULL) 792 792 connect(&solver, SIGNAL(routePartFound(int)), SLOT(solverRoutePartFound(int))); 793 793 #endif 794 794 SStep *root = solver.solve(n, matrix); 795 #ifdef Q_ WS_WIN32795 #ifdef Q_OS_WIN32 796 796 if (tl != NULL) 797 797 disconnect(&solver, SIGNAL(routePartFound(int)), this, SLOT(solverRoutePartFound(int))); … … 802 802 pd.reset(); 803 803 if (!solver.wasCanceled()) { 804 #ifdef Q_ WS_WIN32804 #ifdef Q_OS_WIN32 805 805 if (tl != NULL) { 806 806 tl->SetProgressState(winId(), TBPF_ERROR); … … 814 814 pd.setCancelButton(NULL); 815 815 pd.show(); 816 #ifdef Q_ WS_WIN32816 #ifdef Q_OS_WIN32 817 817 if (tl != NULL) 818 818 tl->SetProgressState(winId(), TBPF_INDETERMINATE); … … 829 829 #endif 830 830 pd.reset(); 831 #ifdef Q_ WS_WIN32831 #ifdef Q_OS_WIN32 832 832 if (tl != NULL) { 833 833 tl->SetProgressState(winId(), TBPF_NOPROGRESS); … … 843 843 pd.setValue(0); 844 844 845 #ifdef Q_ WS_WIN32845 #ifdef Q_OS_WIN32 846 846 if (tl != NULL) 847 847 tl->SetProgressValue(winId(), spinCities->value(), spinCities->value() + solver.getTotalSteps() + 1); … … 860 860 // Font size in pixels = graph node radius / 2.75. 861 861 // See MainWindow::drawNode() for graph node radius calcualtion description. 862 #ifndef Q_ WS_S60862 #ifndef Q_OS_SYMBIAN 863 863 font.setPixelSize(logicalDpiX() * (settings->value("Output/GraphWidth", DEF_GRAPH_WIDTH).toReal() / CM_IN_INCH) / 4.5 / 2.75); 864 864 #else … … 913 913 pd.show(); 914 914 QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents); 915 #ifdef Q_ WS_WIN32915 #ifdef Q_OS_WIN32 916 916 if (tl != NULL) 917 917 tl->SetProgressState(winId(), TBPF_INDETERMINATE); … … 927 927 solutionText->clear(); 928 928 toggleSolutionActions(false); 929 #ifdef Q_ WS_WIN32929 #ifdef Q_OS_WIN32 930 930 if (tl != NULL) { 931 931 tl->SetProgressState(winId(), TBPF_NOPROGRESS); … … 937 937 } 938 938 pd.setValue(n); 939 #ifdef Q_ WS_WIN32939 #ifdef Q_OS_WIN32 940 940 if (tl != NULL) 941 941 tl->SetProgressValue(winId(), spinCities->value() + n, spinCities->value() + solver.getTotalSteps() + 1); … … 984 984 pb->setFormat(tr("Generating footer")); 985 985 pd.setValue(n); 986 #ifdef Q_ WS_WIN32986 #ifdef Q_OS_WIN32 987 987 if (tl != NULL) 988 988 tl->SetProgressValue(winId(), spinCities->value() + n, spinCities->value() + solver.getTotalSteps() + 1); … … 1047 1047 pd.setCancelButton(NULL); 1048 1048 QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents); 1049 #ifdef Q_ WS_WIN321049 #ifdef Q_OS_WIN32 1050 1050 if (tl != NULL) 1051 1051 tl->SetProgressState(winId(), TBPF_INDETERMINATE); … … 1061 1061 toggleSolutionActions(); 1062 1062 tabWidget->setCurrentIndex(1); 1063 #ifdef Q_ WS_WIN321063 #ifdef Q_OS_WIN32 1064 1064 if (tl != NULL) { 1065 1065 tl->SetProgressState(winId(), TBPF_NOPROGRESS); … … 1089 1089 } 1090 1090 1091 #ifdef Q_ WS_WINCE_WM1091 #ifdef Q_OS_WINCE_WM 1092 1092 void MainWindow::changeEvent(QEvent *ev) 1093 1093 { … … 1122 1122 } 1123 1123 } 1124 #endif // Q_ WS_WINCE_WM1124 #endif // Q_OS_WINCE_WM 1125 1125 1126 1126 void MainWindow::numCitiesChanged(int nCities) … … 1138 1138 #endif // QT_NO_PRINTER 1139 1139 1140 #ifdef Q_ WS_WIN321140 #ifdef Q_OS_WIN32 1141 1141 void MainWindow::solverRoutePartFound(int n) 1142 1142 { 1143 1143 tl->SetProgressValue(winId(), n, spinCities->value() * 2); 1144 1144 } 1145 #endif // Q_ WS_WIN321145 #endif // Q_OS_WIN32 1146 1146 1147 1147 void MainWindow::spinCitiesValueChanged(int n) … … 1160 1160 void MainWindow::check4Updates(bool silent) 1161 1161 { 1162 #ifdef Q_ WS_WIN321162 #ifdef Q_OS_WIN32 1163 1163 if (silent) 1164 1164 QProcess::startDetached("updater/Update.exe -name=\"TSPSG: TSP Solver and Generator\" -check=\"freeupdate\" -silentcheck"); … … 1221 1221 if (settings->value("Output/HQGraph", DEF_HQ_GRAPH).toBool()) 1222 1222 r *= HQ_FACTOR; 1223 #ifdef Q_ WS_S601223 #ifdef Q_OS_SYMBIAN 1224 1224 /*! \hack HACK: Solution graph on Symbian is visually larger than on 1225 1225 * Windows Mobile. This coefficient makes it about the same size. … … 1372 1372 hilight.setHsv(color.hue(), color.saturation(), color.value() / 2); 1373 1373 1374 #ifdef Q_ WS_S601374 #ifdef Q_OS_SYMBIAN 1375 1375 /*! 1376 1376 * \hack HACK: Fixing some weird behavior with default Symbian theme … … 1381 1381 solutionText->document()->setDefaultStyleSheet(QString("* {color: %1;}").arg(color.name())); 1382 1382 fmt_default.setForeground(QBrush(color)); 1383 #ifdef Q_ WS_S601383 #ifdef Q_OS_SYMBIAN 1384 1384 } 1385 1385 #endif … … 1549 1549 if (!isWindowModified()) 1550 1550 return true; 1551 #ifdef Q_ WS_S601551 #ifdef Q_OS_SYMBIAN 1552 1552 int res = QSMessageBox(this).exec(); 1553 1553 #else … … 1611 1611 } 1612 1612 1613 #ifdef Q_ WS_S601613 #ifdef Q_OS_SYMBIAN 1614 1614 void MainWindow::resizeEvent(QResizeEvent *ev) 1615 1615 { … … 1631 1631 QWidget::resizeEvent(ev); 1632 1632 } 1633 #endif // Q_ WS_S601633 #endif // Q_OS_SYMBIAN 1634 1634 1635 1635 void MainWindow::retranslateUi(bool all) … … 1692 1692 #endif // QT_NO_STATUSTIP 1693 1693 1694 #ifdef Q_ WS_S601694 #ifdef Q_OS_SYMBIAN 1695 1695 actionRightSoftKey->setText(tr("E&xit")); 1696 1696 #endif … … 1739 1739 Ui_MainWindow::setupUi(this); 1740 1740 1741 #ifdef Q_ WS_S601741 #ifdef Q_OS_SYMBIAN 1742 1742 setWindowFlags(windowFlags() | Qt::WindowSoftkeysVisibleHint); 1743 #endif // Q_ WS_S601743 #endif // Q_OS_SYMBIAN 1744 1744 1745 1745 // File Menu … … 1793 1793 #endif // HANDHELD 1794 1794 1795 #ifdef Q_ WS_WINCE_WM1795 #ifdef Q_OS_WINCE_WM 1796 1796 menuBar()->setDefaultAction(menuFile->menuAction()); 1797 1797 … … 1804 1804 #else 1805 1805 setCentralWidget(tabWidget); 1806 #endif // Q_ WS_WINCE_WM1806 #endif // Q_OS_WINCE_WM 1807 1807 1808 1808 //! \hack HACK: A little hack for toolbar icons to have a sane size. 1809 1809 #if defined(HANDHELD) && !defined(Q_WS_MAEMO_5) 1810 #ifdef Q_ WS_S601810 #ifdef Q_OS_SYMBIAN 1811 1811 toolBarMain->setIconSize(QSize(logicalDpiX() / 5.2, logicalDpiY() / 5.2)); 1812 1812 #else 1813 1813 toolBarMain->setIconSize(QSize(logicalDpiX() / 4, logicalDpiY() / 4)); 1814 #endif // Q_ WS_S601814 #endif // Q_OS_SYMBIAN 1815 1815 #endif // HANDHELD && !Q_WS_MAEMO_5 1816 1816 QToolButton *tb = static_cast<QToolButton *>(toolBarMain->widgetForAction(actionFileSave)); … … 1898 1898 #endif // HANDHELD 1899 1899 1900 #ifdef Q_ WS_S601900 #ifdef Q_OS_SYMBIAN 1901 1901 // Replace Exit on the right soft key with our own exit action. 1902 1902 // This makes it translatable. … … 1951 1951 } 1952 1952 1953 #ifdef Q_ WS_S601953 #ifdef Q_OS_SYMBIAN 1954 1954 QSMessageBox::QSMessageBox(QWidget *parent) 1955 1955 : QMessageBox(parent) … … 1979 1979 done(QMessageBox::Discard); 1980 1980 } 1981 #endif // Q_ WS_S601981 #endif // Q_OS_SYMBIAN -
src/mainwindow.h
rf48433245d r89e5214692 36 36 #include "tspmodel.h" 37 37 38 #ifdef Q_ WS_WIN3238 #ifdef Q_OS_WIN32 39 39 // Forward declaration. A real one is in shobjidl.h 40 40 struct ITaskbarList3; … … 86 86 void dataChanged(); 87 87 void dataChanged(const QModelIndex &tl, const QModelIndex &br); 88 #ifdef Q_ WS_WINCE_WM88 #ifdef Q_OS_WINCE_WM 89 89 void changeEvent(QEvent *ev); 90 90 void desktopResized(int screen); 91 #endif // Q_ WS_WINCE_WM91 #endif // Q_OS_WINCE_WM 92 92 void numCitiesChanged(int nCities); 93 93 #ifndef QT_NO_PRINTER 94 94 void printPreview(QPrinter *printer); 95 95 #endif // QT_NO_PRINTER 96 #ifdef Q_ WS_WIN3296 #ifdef Q_OS_WIN32 97 97 void solverRoutePartFound(int n); 98 #endif // Q_ WS_WIN3298 #endif // Q_OS_WIN32 99 99 void spinCitiesValueChanged(int nCities); 100 100 … … 114 114 #endif // QT_NO_PRINTER 115 115 QAction *actionHelpCheck4Updates; 116 #ifdef Q_ WS_S60116 #ifdef Q_OS_SYMBIAN 117 117 QAction *actionRightSoftKey; 118 118 #endif 119 119 QSettings *settings; 120 120 CTSPModel *tspmodel; 121 #ifdef Q_ WS_WINCE_WM121 #ifdef Q_OS_WINCE_WM 122 122 QRect currentGeometry; 123 #endif // Q_ WS_WINCE_WM123 #endif // Q_OS_WINCE_WM 124 124 125 #ifdef Q_ WS_WIN32125 #ifdef Q_OS_WIN32 126 126 ITaskbarList3 *tl; 127 #endif // Q_ WS_WIN32127 #endif // Q_OS_WIN32 128 128 129 129 // The solution graph SVG … … 154 154 void outputMatrix(QTextCursor &cur, const TMatrix &matrix); 155 155 void outputMatrix(QTextCursor &cur, const SStep &step); 156 #ifdef Q_ WS_S60156 #ifdef Q_OS_SYMBIAN 157 157 void resizeEvent(QResizeEvent *ev); 158 #endif // Q_ WS_S60158 #endif // Q_OS_SYMBIAN 159 159 void retranslateUi(bool all = true); 160 160 bool saveTask(); … … 165 165 }; 166 166 167 #ifdef Q_ WS_S60167 #ifdef Q_OS_SYMBIAN 168 168 // A quickly hacked QMessageBox for Symbian that supports three buttons. 169 169 class QSMessageBox: public QMessageBox { … … 175 175 QSMessageBox(QWidget *parent = 0); 176 176 }; 177 #endif // Q_ WS_S60177 #endif // Q_OS_SYMBIAN 178 178 179 179 #endif // MAINWINDOW_H -
src/qtwin.cpp
rf48433245d r89e5214692 19 19 #endif // Q_WS_X11 20 20 21 #ifdef Q_ WS_WIN21 #ifdef Q_OS_WIN32 22 22 23 23 #include <qt_windows.h> … … 99 99 bool QtWin::isCompositionEnabled() 100 100 { 101 #ifdef Q_ WS_WIN101 #ifdef Q_OS_WIN32 102 102 if (resolveLibs()) { 103 103 HRESULT hr = S_OK; … … 124 124 { 125 125 Q_ASSERT(widget); 126 Q_UNUSED(widget);127 Q_UNUSED(enable);128 126 bool result = false; 129 #ifdef Q_ WS_WIN127 #ifdef Q_OS_WIN32 130 128 if (resolveLibs()) { 131 129 DWM_BLURBEHIND bb = {0}; … … 137 135 widget->setAttribute(Qt::WA_TranslucentBackground, enable); 138 136 widget->setAttribute(Qt::WA_NoSystemBackground, enable); 139 #ifdef Q_ WS_WIN140 hr = pDwmEnableBlurBehindWindow( widget->winId(), &bb);137 #ifdef Q_OS_WIN32 138 hr = pDwmEnableBlurBehindWindow(HWND(widget->winId()), &bb); 141 139 if (SUCCEEDED(hr)) { 142 140 result = true; … … 171 169 172 170 bool result = false; 173 #ifdef Q_ WS_WIN171 #ifdef Q_OS_WIN32 174 172 if (resolveLibs()) { 175 173 QLibrary dwmLib(QString::fromAscii("dwmapi")); 176 174 HRESULT hr = S_OK; 177 175 MARGINS m = {left, top, right, bottom}; 178 hr = pDwmExtendFrameIntoClientArea( widget->winId(), &m);176 hr = pDwmExtendFrameIntoClientArea(HWND(widget->winId()), &m); 179 177 if (SUCCEEDED(hr)) { 180 178 result = true; … … 196 194 QColor resultColor = QApplication::palette().window().color(); 197 195 198 #ifdef Q_ WS_WIN196 #ifdef Q_OS_WIN32 199 197 if (resolveLibs()) { 200 198 DWORD color = 0; … … 210 208 } 211 209 212 #ifdef Q_ WS_WIN210 #ifdef Q_OS_WIN32 213 211 WindowNotifier *QtWin::windowNotifier() 214 212 { -
src/settingsdialog.cpp
rf48433245d r89e5214692 128 128 bgWhite->layout()->setMargin(0); 129 129 130 #ifdef Q_ WS_S60130 #ifdef Q_OS_SYMBIAN 131 131 // On Symbian buttons are moved to a native bar so Help button is 132 132 // left alone. This causes it to be more to the middle instead of … … 217 217 #endif // HANDHELD 218 218 219 #ifdef Q_ WS_WINCE_WM219 #ifdef Q_OS_WINCE_WM 220 220 // We need to react to SIP show/hide and resize the window appropriately 221 221 connect(QApplication::desktop(), SIGNAL(workAreaResized(int)), SLOT(desktopResized(int))); 222 #endif // Q_ WS_WINCE_WM222 #endif // Q_OS_WINCE_WM 223 223 connect(spinRandMin, SIGNAL(valueChanged(int)), SLOT(spinRandMinValueChanged(int))); 224 224 connect(buttonFont, SIGNAL(clicked()), SLOT(buttonFontClicked())); … … 325 325 #else 326 326 adjustSize(); 327 #endif // Q_ WS_WINCE_WM327 #endif // Q_OS_WINCE_WM 328 328 } 329 329 … … 512 512 } 513 513 514 #ifdef Q_ WS_WINCE_WM514 #ifdef Q_OS_WINCE_WM 515 515 void SettingsDialog::desktopResized(int screen) 516 516 { … … 544 544 QWidget::showEvent(ev); 545 545 } 546 #endif // Q_ WS_WINCE_WM546 #endif // Q_OS_WINCE_WM 547 547 548 548 void SettingsDialog::spinRandMinValueChanged(int val) { -
src/settingsdialog.h
rf48433245d r89e5214692 64 64 QCheckBox *cbHQGraph; 65 65 #endif 66 #ifdef Q_ WS_WINCE_WM66 #ifdef Q_OS_WINCE_WM 67 67 QRect currentGeometry; 68 68 #elif !defined(HANDHELD) … … 75 75 bool event(QEvent *ev); 76 76 #endif // QT_NO_STATUSTIP 77 #endif // Q_ WS_WINCE_WM77 #endif // Q_OS_WINCE_WM 78 78 79 79 void pickColor(QColor &where); … … 88 88 // void buttonBgColorClicked(); 89 89 void buttonFontClicked(); 90 #ifdef Q_ WS_WINCE_WM90 #ifdef Q_OS_WINCE_WM 91 91 void desktopResized(int screen); 92 92 void showEvent(QShowEvent *ev); 93 #endif // Q_ WS_WINCE_WM93 #endif // Q_OS_WINCE_WM 94 94 void spinRandMinValueChanged(int val); 95 95 };
Note: See TracChangeset
for help on using the changeset viewer.