Changeset 54 in tspsg-svn for trunk/src/mainwindow.cpp
- Timestamp:
- Aug 9, 2009, 1:45:19 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/mainwindow.cpp
r52 r54 30 30 loadLanguage(); 31 31 setupUi(this); 32 #ifndef Q_OS_WINCE 33 QStatusBar *statusbar = new QStatusBar(this); 34 statusbar->setObjectName("statusbar"); 35 setStatusBar(statusbar); 36 #endif // Q_OS_WINCE 32 37 initDocStyleSheet(); 33 38 solutionText->document()->setDefaultFont(settings->value("Output/Font",QFont(DEF_FONT_FAMILY,DEF_FONT_SIZE)).value<QFont>()); … … 39 44 toolBar->setIconSize(QSize(s / 10,s / 10)); 40 45 #endif 41 #ifndef Q _OS_WINCE46 #ifndef QT_NO_PRINTER 42 47 printer = new QPrinter(QPrinter::HighResolution); 43 #endif // Q _OS_WINCE48 #endif // QT_NO_PRINTER 44 49 groupSettingsLanguageList = new QActionGroup(this); 45 50 actionSettingsLanguageEnglish->setData("en"); … … 58 63 connect(actionHelpAboutQt,SIGNAL(triggered()),qApp,SLOT(aboutQt())); 59 64 connect(actionHelpAbout,SIGNAL(triggered()),this,SLOT(actionHelpAboutTriggered())); 60 #ifndef Q_OS_WINCE 65 #ifndef QT_NO_PRINTER 66 menuFile->insertAction(actionFileExit,actionFilePrintPreview); 67 menuFile->insertAction(actionFileExit,actionFilePrint); 68 menuFile->insertSeparator(actionFileExit); 69 toolBar->insertAction(actionSettingsPreferences,actionFilePrint); 61 70 connect(actionFilePrintPreview,SIGNAL(triggered()),this,SLOT(actionFilePrintPreviewTriggered())); 62 71 connect(actionFilePrint,SIGNAL(triggered()),this,SLOT(actionFilePrintTriggered())); 63 #endif // Q _OS_WINCE72 #endif // QT_NO_PRINTER 64 73 connect(buttonSolve,SIGNAL(clicked()),this,SLOT(buttonSolveClicked())); 65 74 connect(buttonRandom,SIGNAL(clicked()),this,SLOT(buttonRandomClicked())); … … 106 115 if (!enable) 107 116 output.clear(); 108 #ifndef Q _OS_WINCE117 #ifndef QT_NO_PRINTER 109 118 actionFilePrint->setEnabled(enable); 110 119 actionFilePrintPreview->setEnabled(enable); 111 #endif // Q _OS_WINCE120 #endif // QT_NO_PRINTER 112 121 } 113 122 … … 206 215 if (!maybeSave()) 207 216 return; 217 QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); 208 218 tspmodel->clear(); 209 219 taskView->resizeColumnsToContents(); … … 214 224 solutionText->clear(); 215 225 enableSolutionActions(false); 226 QApplication::restoreOverrideCursor(); 216 227 } 217 228 … … 349 360 } 350 361 351 #ifndef Q _OS_WINCE362 #ifndef QT_NO_PRINTER 352 363 void MainWindow::printPreview(QPrinter *printer) 353 364 { … … 372 383 if (pd.exec() != QDialog::Accepted) 373 384 return; 385 QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); 374 386 solutionText->document()->print(printer); 375 } 376 #endif // Q_OS_WINCE 387 QApplication::restoreOverrideCursor(); 388 } 389 #endif // QT_NO_PRINTER 377 390 378 391 void MainWindow::buttonRandomClicked() 379 392 { 393 QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); 380 394 tspmodel->randomize(); 381 395 setWindowModified(true); 382 396 taskView->resizeColumnsToContents(); 383 397 taskView->resizeRowsToContents(); 398 QApplication::restoreOverrideCursor(); 384 399 } 385 400
Note: See TracChangeset
for help on using the changeset viewer.