Changeset 69 in tspsg-svn
- Timestamp:
- Nov 2, 2009, 9:44:17 AM (15 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/mainwindow.cpp
r67 r69 83 83 connect(spinCities,SIGNAL(valueChanged(int)),this,SLOT(spinCitiesValueChanged(int))); 84 84 setCentralWidget(tabWidget); 85 #ifndef Q_OS_WINCE 85 86 QRect rect = geometry(); 86 #ifndef Q_OS_WINCE87 87 if (settings->value("SavePos",false).toBool()) { 88 88 // Loading of saved window state … … 113 113 } 114 114 setWindowModified(false); 115 }116 117 /*!118 * \brief Handles Main Window close event.119 * \param event Close event.120 *121 * Checks whether or not a current task was saved and asks for saving if not.122 * Saves TSPSG settings.123 */124 void MainWindow::closeEvent(QCloseEvent *event)125 {126 if (!maybeSave()) {127 event->ignore();128 return;129 }130 settings->setValue("NumCities",spinCities->value());131 #ifndef Q_OS_WINCE132 // Saving windows state133 if (settings->value("SavePos",false).toBool()) {134 settings->beginGroup("MainWindow");135 settings->setValue("Maximized",isMaximized());136 if (!isMaximized()) {137 settings->setValue("Size",size());138 settings->setValue("Position",pos());139 }140 settings->endGroup();141 }142 #endif // Q_OS_WINCE143 QMainWindow::closeEvent(event);144 115 } 145 116 … … 467 438 taskView->resizeRowToContents(k); 468 439 } 440 } 441 442 void MainWindow::closeEvent(QCloseEvent *event) 443 { 444 if (!maybeSave()) { 445 event->ignore(); 446 return; 447 } 448 settings->setValue("NumCities",spinCities->value()); 449 #ifndef Q_OS_WINCE 450 // Saving windows state 451 if (settings->value("SavePos",false).toBool()) { 452 settings->beginGroup("MainWindow"); 453 settings->setValue("Maximized",isMaximized()); 454 if (!isMaximized()) { 455 settings->setValue("Size",size()); 456 settings->setValue("Position",pos()); 457 } 458 settings->endGroup(); 459 } 460 #endif // Q_OS_WINCE 461 QMainWindow::closeEvent(event); 469 462 } 470 463 -
trunk/src/mainwindow.h
r67 r69 47 47 public: 48 48 MainWindow(QWidget *parent = 0); 49 void closeEvent(QCloseEvent *);50 49 51 50 private slots: … … 87 86 CTSPModel *tspmodel; 88 87 88 void closeEvent(QCloseEvent *); 89 89 void enableSolutionActions(bool enable = true); 90 90 void initDocStyleSheet();
Note: See TracChangeset
for help on using the changeset viewer.