Changeset 117 in tspsg-svn for trunk/src


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/).

Location:
trunk/src
Files:
62 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/globals.h

    r116 r117  
    3535        #include <QtSvg>
    3636#endif // NOSVG && QT_VERSION >= 0x040500
     37#include <QtToolBarDialog>
    3738
    3839// Version info
  • 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
  • trunk/src/mainwindow.h

    r116 r117  
    6363        void actionSettingsPreferencesTriggered();
    6464        void actionSettingsLanguageAutodetectTriggered(bool checked);
     65#ifndef HANDHELD
     66        void on_actionSettingsToolbars_triggered();
     67#endif // HANDHELD
    6568        void groupSettingsLanguageListTriggered(QAction *action);
    6669        void actionSettingsStyleSystemTriggered(bool checked);
     
    9194        QActionGroup *groupSettingsLanguageList;
    9295        QActionGroup *groupSettingsStyleList;
     96#ifndef HANDHELD
     97        QtToolBarManager *toolBarManager;
     98#endif // HANDHELD
    9399#ifndef QT_NO_PRINTER
    94100        QPrinter *printer;
  • trunk/src/settingsdialog.cpp

    r116 r117  
    3535        setupUi(this);
    3636
    37         buttonBox->button(QDialogButtonBox::Save)->setIcon(QIcon(":/images/icons/button_ok.png"));
     37        buttonBox->button(QDialogButtonBox::Save)->setIcon(QIcon(":/images/icons/dialog-ok.png"));
    3838        buttonBox->button(QDialogButtonBox::Save)->setStatusTip(tr("Save new preferences"));
    3939        buttonBox->button(QDialogButtonBox::Save)->setCursor(QCursor(Qt::PointingHandCursor));
    40         buttonBox->button(QDialogButtonBox::Cancel)->setIcon(QIcon(":/images/icons/button_cancel.png"));
     40        buttonBox->button(QDialogButtonBox::Cancel)->setIcon(QIcon(":/images/icons/dialog-cancel.png"));
    4141        buttonBox->button(QDialogButtonBox::Cancel)->setStatusTip(tr("Close without saving preferences"));
    4242        buttonBox->button(QDialogButtonBox::Cancel)->setCursor(QCursor(Qt::PointingHandCursor));
     
    108108        imgIcon->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Expanding);
    109109        imgIcon->setFrameShape(QFrame::NoFrame);
    110         imgIcon->setPixmap(QPixmap(":/images/icons/preferences_system.png"));
     110        imgIcon->setPixmap(QPixmap(":/images/icons/preferences-system.png"));
    111111        imgIcon->setStyleSheet("background-color: #0080C0; padding-top: 11px;");
    112112        imgIcon->setAlignment(Qt::AlignTop | Qt::AlignHCenter);
Note: See TracChangeset for help on using the changeset viewer.