Changeset 117 in tspsg-svn for trunk/src/mainwindow.cpp


Ignore:
Timestamp:
May 2, 2010, 12:51:20 PM (15 years ago)
Author:
laleppa
Message:

+ Started adding a toolbar customization with the ude of QtToolbarDialog? (http://qt.nokia.com/products/appdev/add-on-products/catalog/4/Widgets/qttoolbardialog/).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/mainwindow.cpp

    r116 r117  
    316316{
    317317QPrintDialog pd(printer,this);
    318 #if QT_VERSION >= 0x040500
    319         // No such methods in Qt < 4.5
    320         pd.setOption(QAbstractPrintDialog::PrintSelection,false);
    321         pd.setOption(QAbstractPrintDialog::PrintPageRange,false);
    322 #endif
    323318        if (pd.exec() != QDialog::Accepted)
    324319                return;
    325320        QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
    326         solutionText->document()->print(printer);
     321        solutionText->print(printer);
    327322        QApplication::restoreOverrideCursor();
    328323}
     
    520515        dlg->setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint);
    521516        dlg->setWindowTitle(tr("About %1").arg(QApplication::applicationName()));
     517        dlg->setWindowIcon(QIcon(":/images/icons/help-about.png"));
    522518        dlg->setLayout(vb);
    523519
     
    12331229        actionFilePrintPreview->setObjectName("actionFilePrintPreview");
    12341230        actionFilePrintPreview->setEnabled(false);
    1235         actionFilePrintPreview->setIcon(QIcon(":/images/icons/document_preview.png"));
     1231        actionFilePrintPreview->setIcon(QIcon(":/images/icons/document-print-preview.png"));
    12361232
    12371233        actionFilePrint = new QAction(this);
    12381234        actionFilePrint->setObjectName("actionFilePrint");
    12391235        actionFilePrint->setEnabled(false);
    1240         actionFilePrint->setIcon(QIcon(":/images/icons/fileprint.png"));
     1236        actionFilePrint->setIcon(QIcon(":/images/icons/document-print.png"));
    12411237
    12421238        menuFile->insertAction(actionFileExit,actionFilePrintPreview);
     
    12611257#ifdef Q_OS_WIN32
    12621258        actionHelpCheck4Updates = new QAction(this);
     1259        actionHelpCheck4Updates->setIcon(QIcon(":/images/icons/system-software-update.png"));
    12631260        actionHelpCheck4Updates->setEnabled(hasUpdater());
    12641261        menuHelp->insertAction(actionHelpAboutQt, actionHelpCheck4Updates);
     
    12761273        }
    12771274#endif // Q_OS_WIN32
     1275
     1276#ifndef HANDHELD
     1277        toolBarManager = new QtToolBarManager;
     1278        toolBarManager->setMainWindow(this);
     1279QString cat = toolBar->windowTitle();
     1280        toolBarManager->addToolBar(toolBar, cat);
     1281#ifndef QT_NO_PRINTER
     1282        toolBarManager->addAction(actionFilePrintPreview, cat);
     1283#endif // QT_NO_PRINTER
     1284        toolBarManager->addAction(actionHelpContents, cat);
     1285        toolBarManager->addAction(actionHelpContextual, cat);
     1286//      toolBarManager->addAction(action, cat);
     1287#endif // HANDHELD
    12781288}
    12791289
     
    13011311#endif // Q_OS_WIN32
    13021312}
     1313
     1314#ifndef HANDHELD
     1315void MainWindow::on_actionSettingsToolbars_triggered()
     1316{
     1317QtToolBarDialog dlg(this);
     1318        dlg.setToolBarManager(toolBarManager);
     1319        dlg.exec();
     1320}
     1321#endif // HANDHELD
Note: See TracChangeset for help on using the changeset viewer.