//-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- void RiuPlotMainWindow::slotBuildWindowActions() { m_windowMenu->clear(); { caf::CmdFeatureManager* cmdFeatureMgr = caf::CmdFeatureManager::instance(); m_windowMenu->addAction(cmdFeatureMgr->action("RicShowMainWindowFeature")); m_windowMenu->addSeparator(); } QList<QDockWidget*> dockWidgets = findChildren<QDockWidget*>(); for (QDockWidget* dock : dockWidgets) { m_windowMenu->addAction(dock->toggleViewAction()); } m_windowMenu->addSeparator(); QAction* cascadeWindowsAction = new QAction("Cascade Windows", this); connect(cascadeWindowsAction, SIGNAL(triggered()), m_mdiArea, SLOT(cascadeSubWindows())); QAction* closeAllSubWindowsAction = new QAction("Close All Windows", this); connect(closeAllSubWindowsAction, SIGNAL(triggered()), m_mdiArea, SLOT(closeAllSubWindows())); m_windowMenu->addAction(caf::CmdFeatureManager::instance()->action("RicTilePlotWindowsFeature")); m_windowMenu->addAction(cascadeWindowsAction); m_windowMenu->addAction(closeAllSubWindowsAction); }
void MainWindow:: setDefaultConnections() { connect(actionOpenValueTarget, SIGNAL(triggered()), this, SLOT(openValueTarget())); connect(actionOpenMeshTarget, SIGNAL(triggered()), this, SLOT(openMeshTarget())); connect(actionOpenSurfaceTarget, SIGNAL(triggered()), this, SLOT(openSurfaceTarget())); connect(actionOpenCompositeTarget, SIGNAL(triggered()), this, SLOT(openCompositeTarget())); connect(actionOpenValueSource, SIGNAL(triggered()), this, SLOT(openValueSource())); connect(actionOpenSurfaceSource, SIGNAL(triggered()), this, SLOT(openSurfaceSource())); connect(actionOpenMeshSource, SIGNAL(triggered()), this, SLOT(openMeshSource())); connect(actionTile, SIGNAL(triggered()), mdiArea, SLOT(tileSubWindows())); connect(actionCascade, SIGNAL(triggered()), mdiArea, SLOT(cascadeSubWindows())); connect(actionOptions, SIGNAL(triggered()), this, SLOT(options())); connect(actionOpenProject, SIGNAL(triggered()), this, SLOT(openProject())); }
void XmdvToolMainWnd::initWindowActions() { action_Close = new QAction(tr("Cl&ose"), this); action_Close->setShortcut(tr("Ctrl+F4")); action_Close->setStatusTip(tr("Close the active window")); connect(action_Close, SIGNAL(triggered()), m_mdiArea, SLOT(closeActiveSubWindow())); action_CloseAll = new QAction(tr("Close &All"), this); action_CloseAll->setStatusTip(tr("Close all the windows")); connect(action_CloseAll, SIGNAL(triggered()), m_mdiArea, SLOT(closeAllSubWindows())); action_Tile = new QAction(tr("&Tile"), this); action_Tile->setStatusTip(tr("Tile the windows")); connect(action_Tile, SIGNAL(triggered()), m_mdiArea, SLOT(tileSubWindows())); action_Cascade = new QAction(tr("&Cascade"), this); action_Cascade->setStatusTip(tr("Cascade the windows")); connect(action_Cascade, SIGNAL(triggered()), m_mdiArea, SLOT(cascadeSubWindows())); action_Next = new QAction(tr("Ne&xt"), this); action_Next->setShortcut(tr("Ctrl+F6")); action_Next->setStatusTip(tr("Move the focus to the next window")); connect(action_Next, SIGNAL(triggered()), m_mdiArea, SLOT(activateNextSubWindow())); action_Previous = new QAction(tr("Pre&vious"), this); action_Previous->setShortcut(tr("Ctrl+Shift+F6")); action_Previous->setStatusTip(tr("Move the focus to the previous window")); connect(action_Previous, SIGNAL(triggered()), m_mdiArea, SLOT(activatePreviousSubWindow())); action_Separator = new QAction(this); action_Separator->setSeparator(true); }
Widgets::Widgets(QWidget *parent = 0) : QWidget(parent) { creerFenetreCalendrier(); creerFenetreCalculatrice(); creerFenetreChronometre(); aireCentrale = new QMdiArea; aireCentrale->addSubWindow(fenetreCalendrier); aireCentrale->addSubWindow(fenetreCalculatrice); aireCentrale->addSubWindow(fenetreChronometre); aireCentrale->cascadeSubWindows(); QPushButton *vueCascade = new QPushButton; vueCascade->setIcon(QIcon(":/icones/widgets/vueCascade.png")); vueCascade->setToolTip("Afficher les sous-fenêtres en cascade"); connect(vueCascade, SIGNAL(clicked()), aireCentrale, SLOT(cascadeSubWindows())); QPushButton *vueTuile = new QPushButton; vueTuile->setIcon(QIcon(":/icones/widgets/vueTuiles.png")); vueTuile->setToolTip("Afficher les sous-fenêtres en tuile"); connect(vueTuile, SIGNAL(clicked()), aireCentrale, SLOT(tileSubWindows())); QVBoxLayout *layoutOptions = new QVBoxLayout; layoutOptions->addWidget(vueCascade); layoutOptions->addWidget(vueTuile); layoutOptions->setContentsMargins(0, 0, 0, 0); QWidget *widgetOptions = new QWidget(aireCentrale); widgetOptions->setLayout(layoutOptions); widgetOptions->move(10, 10); QVBoxLayout *layoutCentral = new QVBoxLayout(this); layoutCentral->addWidget(aireCentrale); layoutCentral->setContentsMargins(0, 0, 0, 0); }
void MainWindow::windowsMenuAboutToShow(void) { // Clear previous entries windowsMenu->clear(); // Add default options windowsMenu->addAction(tr("Cascade"), mdiArea, SLOT(cascadeSubWindows())); windowsMenu->addAction(tr("Tile"), mdiArea, SLOT(tileSubWindows())); windowsMenu->addSeparator(); // Get list of open subwindows in Mdi Area subWindows = mdiArea->subWindowList(); // Make sure it isn't empty if (subWindows.isEmpty()) return; // Create windows list based off of what's open for (int i = 0; i < subWindows.size(); i++) { QAction* item = new QAction(subWindows.at(i)->widget()->windowTitle(), this); windowsMenu->addAction(item); } connect(windowsMenu, SIGNAL(triggered(QAction*)), this, SLOT(windowsMenuActivated(QAction*))); }
MdiContainerWidgetTaskMenu::MdiContainerWidgetTaskMenu(QMdiArea *m, QObject *parent) : ContainerWidgetTaskMenu(m, MdiContainer, parent) { initializeActions(); connect(m_nextAction, SIGNAL(triggered()), m, SLOT(activateNextSubWindow())); connect(m_previousAction, SIGNAL(triggered()), m , SLOT(activatePreviousSubWindow())); connect(m_tileAction, SIGNAL(triggered()), m, SLOT(tileSubWindows())); connect(m_cascadeAction, SIGNAL(triggered()), m, SLOT(cascadeSubWindows())); }
void KviMdiManager::cascadeMaximized() { cascadeSubWindows(); QList<QMdiSubWindow*> tmp = subWindowList(QMdiArea::StackingOrder); QListIterator<QMdiSubWindow*> it(tmp); KviMdiChild * lpC; while (it.hasNext()) { lpC = (KviMdiChild *) it.next(); if(lpC->windowState() & Qt::WindowMinimized) continue; QPoint pnt(lpC->pos()); QSize curSize(viewport()->width() - pnt.x(),viewport()->height() - pnt.y()); if((lpC->minimumSize().width() > curSize.width()) || (lpC->minimumSize().height() > curSize.height()))lpC->resize(lpC->minimumSize()); else lpC->resize(curSize); } }
void KviMdiManager::cascadeWindows() { cascadeSubWindows(); }
void MainWindow::createActions() { newAction = new QAction(tr("&New"), this); newAction->setIcon(QIcon(":/images/filenew.png")); newAction->setShortcut(QKeySequence::New); newAction->setStatusTip(tr("Create a new file")); connect(newAction, SIGNAL(triggered()), this, SLOT(newFile())); openAction = new QAction(tr("&Open..."), this); openAction->setIcon(QIcon(":/images/fileopen.png")); openAction->setShortcut(QKeySequence::Open); openAction->setStatusTip(tr("Open an existing file")); connect(openAction, SIGNAL(triggered()), this, SLOT(open())); printAction = new QAction(QIcon(":/images/fileprint.png"), tr("&Print"), this); printAction->setShortcut(QKeySequence::Print); printAction->setStatusTip(tr("Print File")); connect(printAction, SIGNAL(triggered()), this, SLOT(print())); saveAction = new QAction(tr("&Save"), this); saveAction->setIcon(QIcon(":/images/filesave.png")); saveAction->setShortcut(QKeySequence::Save); saveAction->setStatusTip(tr("Save the file to disk")); connect(saveAction, SIGNAL(triggered()), this, SLOT(save())); saveAsAction = new QAction(tr("Save &As..."), this); saveAsAction->setIcon(QIcon(":/images/filesave.png")); saveAsAction->setStatusTip(tr("Save the file under a new name")); connect(saveAsAction, SIGNAL(triggered()), this, SLOT(saveAs())); exitAction = new QAction(tr("&Quit..."), this); exitAction->setShortcut(tr("Ctrl+Q")); exitAction->setStatusTip(tr("Exit the application")); connect(exitAction, SIGNAL(triggered()), this, SLOT(closep())); cutAction = new QAction(tr("Cu&t"), this); cutAction->setIcon(QIcon(":/images/editcut.png")); cutAction->setShortcut(QKeySequence::Cut); cutAction->setStatusTip(tr("Cut the current selection to the clipboard")); connect(cutAction, SIGNAL(triggered()), this, SLOT(cut())); copyAction = new QAction(tr("&Copy"), this); copyAction->setIcon(QIcon(":/images/editcopy.png")); copyAction->setShortcut(QKeySequence::Copy); copyAction->setStatusTip(tr("Copy the current selection to the clipboard")); connect(copyAction, SIGNAL(triggered()), this, SLOT(copy())); pasteAction = new QAction(tr("&Paste"), this); pasteAction->setIcon(QIcon(":/images/editpaste.png")); pasteAction->setShortcut(QKeySequence::Paste); pasteAction->setStatusTip(tr("Paste the clipboard's contents at the cursor position")); connect(pasteAction, SIGNAL(triggered()), this, SLOT(paste())); //---------------------------------------------------------- textBoldAction = new QAction(QIcon(":/images/textbold.png"), tr("&Bold"), this); textBoldAction->setShortcut(Qt::CTRL + Qt::Key_B); textBoldAction->setStatusTip(tr("Text Bold")); QFont bold; bold.setBold(true); textBoldAction->setFont(bold); textBoldAction->setCheckable(true); connect(textBoldAction, SIGNAL(triggered()), this, SLOT(textBold())); textItalicAction = new QAction(QIcon(":/images/textitalic.png"), tr("&Italic"), this); textItalicAction->setShortcut(Qt::CTRL + Qt::Key_I); textItalicAction->setStatusTip(tr("Text Italic")); QFont italic; italic.setItalic(true); textItalicAction->setFont(italic); textItalicAction->setCheckable(true); connect(textItalicAction, SIGNAL(triggered()), this, SLOT(textItalic())); textUnderlineAction = new QAction(QIcon(":/images/textunder.png"), tr("&Underline"), this); textUnderlineAction->setShortcut(Qt::CTRL + Qt::Key_U); textUnderlineAction->setStatusTip(tr("Text Underline")); QFont underline; underline.setUnderline(true); textUnderlineAction->setFont(underline); textUnderlineAction->setCheckable(true); connect(textUnderlineAction, SIGNAL(triggered()), this, SLOT(textUnderline())); QPixmap pix(16, 16); pix.fill(Qt::black); textColorAction = new QAction(pix, tr("&Color..."), this); textColorAction->setStatusTip(tr("Select Text Color")); connect(textColorAction, SIGNAL(triggered()), this, SLOT(textColor())); //create font toolbar toolbFont = new QToolBar(this); toolbFont->setAllowedAreas(Qt::TopToolBarArea | Qt::BottomToolBarArea); toolbFont->setWindowTitle(tr("Format Actions")); addToolBarBreak(Qt::TopToolBarArea); //addToolBar(toolbFont); //moved to createtoolbar //create fontcombobox comboFont = new QFontComboBox(toolbFont); toolbFont->addWidget(comboFont); comboFont->setToolTip("Set Font Type"); comboFont->setStatusTip("Select Font Type"); connect(comboFont, SIGNAL(activated(const QString &)), this, SLOT(textFamily(const QString &))); //create fontsize combobox comboSize = new QComboBox(toolbFont); comboSize->setObjectName("comboSize"); toolbFont->addWidget(comboSize); comboSize->setToolTip("Set Font Size"); comboSize->setStatusTip("Select Font Size"); comboSize->setEditable(true); QFontDatabase db; foreach(int size, db.standardSizes()) comboSize->addItem(QString::number(size)); connect(comboSize, SIGNAL(activated(const QString &)), this, SLOT(textSize(const QString &))); comboSize->setCurrentIndex(comboSize->findText(QString::number(QApplication::font().pointSize()))); setFontAction = new QAction(tr("&Font"), this); setFontAction->setShortcut(Qt::CTRL + Qt::Key_F); setFontAction->setStatusTip(tr("Set Font")); connect(setFontAction, SIGNAL(triggered()), this, SLOT(setFont())); //---------------------------------------------------------- inputAction = new QAction(tr("Input"), this); inputAction->setShortcut(Qt::CTRL + Qt::Key_A); inputAction->setStatusTip(tr("Select Input Paramerters")); connect(inputAction, SIGNAL(triggered()), this, SLOT(inputparameters())); output1Action = new QAction(tr("Output1"), this); output1Action->setShortcut(Qt::CTRL + Qt::Key_R); output1Action->setStatusTip(tr("Output 1")); connect(output1Action, SIGNAL(triggered()), this, SLOT(output1())); output2Action = new QAction(tr("Output2"), this); output2Action->setShortcut(Qt::CTRL + Qt::Key_T); output2Action->setStatusTip(tr("Output 2")); connect(output2Action, SIGNAL(triggered()), this, SLOT(output2())); //---------------------------------------------------------- closeAction = new QAction(tr("Cl&ose"), this); closeAction->setShortcut(QKeySequence::Close); closeAction->setStatusTip(tr("Close the active window")); connect(closeAction, SIGNAL(triggered()), mdiArea, SLOT(closeActiveSubWindow())); closeAllAction = new QAction(tr("Close &All"), this); closeAllAction->setStatusTip(tr("Close all windows")); connect(closeAllAction, SIGNAL(triggered()), mdiArea, SLOT(closeAllSubWindows())); tileAction = new QAction(tr("&Tile"), this); tileAction->setStatusTip(tr("Tile the windows")); connect(tileAction, SIGNAL(triggered()), mdiArea, SLOT(tileSubWindows())); cascadeAction = new QAction(tr("&Cascade"), this); cascadeAction->setStatusTip(tr("Cascade the windows")); connect(cascadeAction, SIGNAL(triggered()), mdiArea, SLOT(cascadeSubWindows())); nextAction = new QAction(tr("Ne&xt"), this); nextAction->setShortcut(QKeySequence::NextChild); nextAction->setStatusTip(tr("Move the focus to the next window")); connect(nextAction, SIGNAL(triggered()), mdiArea, SLOT(activateNextSubWindow())); previousAction = new QAction(tr("Pre&vious"), this); previousAction->setShortcut(QKeySequence::PreviousChild); previousAction->setStatusTip(tr("Move the focus to the previous window")); connect(previousAction, SIGNAL(triggered()), mdiArea, SLOT(activatePreviousSubWindow())); separatorAction = new QAction(this); separatorAction->setSeparator(true); aboutAction = new QAction(tr("&About"), this); aboutAction->setStatusTip(tr("the application's About box")); connect(aboutAction, SIGNAL(triggered()), this, SLOT(about())); aboutQtAction = new QAction(tr("About &Qt"), this); aboutQtAction->setStatusTip(tr("the Qt library's About box")); connect(aboutQtAction, SIGNAL(triggered()), qApp, SLOT(aboutQt())); windowActionGroup = new QActionGroup(this); }
void MainWindow::createActions() { openAct = new QAction(tr("&Open..."), this); openAct->setShortcuts(QKeySequence::Open); openAct->setIcon(QIcon(ICON(open.png))); openAct->setStatusTip(tr("Open an existing file")); connect(openAct, SIGNAL(triggered()), this, SLOT(open())); saveAct = new QAction(tr("&Save..."), this); saveAct->setShortcuts(QKeySequence::Save); saveAct->setIcon(QIcon(ICON(save.png))); saveAct->setStatusTip(tr("Save an existing file")); connect(saveAct, SIGNAL(triggered()), this, SLOT(save())); exitAct = new QAction(tr("E&xit"), this); exitAct->setShortcuts(QKeySequence::Quit); exitAct->setIcon(QIcon(ICON(exit.png))); exitAct->setStatusTip(tr("Exit the application")); connect(exitAct, SIGNAL(triggered()), qApp, SLOT(closeAllWindows())); removeAllWidget = new QAction(tr("Clear"), this); removeAllWidget->setShortcuts(QKeySequence::Quit); removeAllWidget->setStatusTip(tr("Remove all widget from the buffer store")); connect(removeAllWidget, SIGNAL(triggered()), this, SLOT(clearBufor())); zoomInAct = new QAction(tr("Zoom In"), this); zoomInAct->setShortcut(tr("Ctrl++")); zoomInAct->setIcon(QIcon(ICON(ZoomIn.png))); zoomInAct->setStatusTip(tr("Zoom in an image")); zoomOutAct = new QAction(tr("Zoom Out"), this); zoomOutAct->setShortcut(tr("Ctrl+-")); zoomOutAct->setIcon(QIcon(ICON(zoomout.png))); zoomOutAct->setStatusTip(tr("Zoom out an image")); zoomResetAct = new QAction(tr("Normal Size"), this); zoomResetAct->setShortcut(tr("Ctrl+=")); fitToWindowAct = new QAction(tr("Fit to Window"), this); fitToWindowAct->setCheckable(true); fitToWindowAct->setShortcut(tr("Ctrl+F")); openAllAct = new QAction(tr("Open the selected windows"), this); openAllAct->setCheckable(true); connect(openAllAct, SIGNAL(triggered()), this, SLOT(showItem())); closeAct = new QAction(tr("Cl&ose"), this); closeAct->setStatusTip(tr("Close the active window")); connect(closeAct, SIGNAL(triggered()), mdiArea, SLOT(closeActiveSubWindow())); closeAllAct = new QAction(tr("Close &All"), this); closeAllAct->setStatusTip(tr("Close all the windows")); connect(closeAllAct, SIGNAL(triggered()), mdiArea, SLOT(closeAllSubWindows())); tileAct = new QAction(tr("&Tile"), this); tileAct->setStatusTip(tr("Tile the windows")); connect(tileAct, SIGNAL(triggered()), mdiArea, SLOT(tileSubWindows())); cascadeAct = new QAction(tr("&Cascade"), this); cascadeAct->setStatusTip(tr("Cascade the windows")); connect(cascadeAct, SIGNAL(triggered()), mdiArea, SLOT(cascadeSubWindows())); nextAct = new QAction(tr("Ne&xt"), this); nextAct->setShortcuts(QKeySequence::NextChild); nextAct->setStatusTip(tr("Move the focus to the next window")); connect(nextAct, SIGNAL(triggered()), mdiArea, SLOT(activateNextSubWindow())); previousAct = new QAction(tr("Pre&vious"), this); previousAct->setShortcuts(QKeySequence::PreviousChild); previousAct->setStatusTip(tr("Move the focus to the previous " "window")); connect(previousAct, SIGNAL(triggered()), mdiArea, SLOT(activatePreviousSubWindow())); windowActionGroup = new QActionGroup(this); //tylko jedna pozycja w menu jest sprawdzana separatorAct = new QAction(this); separatorAct->setSeparator(true); }
void SVPlotMainWindow::SVPlotMainWindowPrivate::setupActions() { // // "File"-menu // actionNew = new QAction("&New", mw); actionNew->setIcon(QIcon(":icons/document-new.png")); actionNew->setShortcut(QKeySequence::New); connect(actionNew, SIGNAL(triggered()), mw, SLOT(newSubWindow())); actionLoad = new QAction("&Open", mw); actionLoad->setIcon(QIcon(":icons/document-open.png")); actionLoad->setShortcut(QKeySequence::Open); connect(actionLoad, SIGNAL(triggered()), mw, SLOT(load())); actionPrint = new QAction("&Print", mw); actionPrint->setIcon(QIcon(":icons/document-print.png")); actionPrint->setShortcut(QKeySequence::Print); actionPrint->setEnabled(false); connect(actionPrint, SIGNAL(triggered()), mw, SLOT(print())); actionQuit = new QAction("&Quit", mw); #if QT_VERSION >= 0x040600 actionQuit->setShortcut(QKeySequence::Quit); #else actionQuit->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q)); #endif connect(actionQuit, SIGNAL(triggered()), mw, SLOT(close())); // // "Plot"-menu // actionZoomFit = new QAction("Fit to Window", mw); actionZoomFit->setIcon(QIcon(":icons/zoom-fit-best.png")); actionZoomFit->setEnabled(false); connect(actionZoomFit, SIGNAL(triggered()), mw, SLOT(zoomFit())); actionZoom = new QAction("&Zoom", mw); actionZoom->setIcon(QIcon(":icons/page-zoom.png")); actionZoom->setCheckable(true); actionZoom->setEnabled(false); connect(actionZoom, SIGNAL(toggled(bool)), mw, SLOT(setZoomEnabled(bool))); actionMove = new QAction("&Move", mw); actionMove->setIcon(QIcon(":icons/input-mouse.png")); actionMove->setCheckable(true); actionMove->setChecked(false); actionMove->setEnabled(false); connect(actionMove, SIGNAL(toggled(bool)), mw, SLOT(setMoveEnabled(bool))); actionZoom->setChecked(true); actionGroupZoomMove = new QActionGroup(mw); actionGroupZoomMove->addAction(actionZoom); actionGroupZoomMove->addAction(actionMove); // // "Window"-menu // actionPreviousPlot = new QAction("&Previous Plot", mw); actionPreviousPlot->setShortcut(QKeySequence::PreviousChild); connect(actionPreviousPlot, SIGNAL(triggered()), mdiArea, SLOT(activatePreviousSubWindow())); actionNextPlot = new QAction("&Next Plot", mw); actionNextPlot->setShortcut(QKeySequence::NextChild); connect(actionNextPlot, SIGNAL(triggered()), mdiArea, SLOT(activateNextSubWindow())); actionCascadePlots = new QAction("C&ascade Plots", mw); connect(actionCascadePlots, SIGNAL(triggered()), mdiArea, SLOT(cascadeSubWindows())); actionTilePlots = new QAction("&Tile Plots", mw); connect(actionTilePlots, SIGNAL(triggered()), mdiArea, SLOT(tileSubWindows())); actionClosePlot = new QAction("&Close Current Plot", mw); actionClosePlot->setShortcut(QKeySequence::Close); connect(actionClosePlot, SIGNAL(triggered()), mdiArea, SLOT(closeActiveSubWindow())); actionCloseAllPlots = new QAction("Close &All Plots", mw); connect(actionCloseAllPlots, SIGNAL(triggered()), mdiArea, SLOT(closeAllSubWindows())); // // "Help"-menu // actionAbout = new QAction("&About", mw); connect(actionAbout, SIGNAL(triggered()), mw, SLOT(about())); }
void SVImageMainWindow::SVImageMainWindowPrivate::setupActions() { // // "File"-menu // actionLoad = new QAction("&Open", mw); actionLoad->setIcon(QIcon(":icons/document-open.png")); actionLoad->setShortcut(QKeySequence::Open); connect(actionLoad, SIGNAL(triggered()), mw, SLOT(load())); actionReload = new QAction("&Reload", mw); actionReload->setIcon(QIcon(":icons/view-refresh.png")); actionReload->setShortcut(QKeySequence::Refresh); actionReload->setEnabled(false); connect(actionReload, SIGNAL(triggered()), mw, SLOT(reload())); actionPrint = new QAction("&Print", mw); actionPrint->setIcon(QIcon(":icons/document-print.png")); actionPrint->setShortcut(QKeySequence::Print); actionPrint->setEnabled(false); connect(actionPrint, SIGNAL(triggered()), mw, SLOT(print())); actionQuit = new QAction("&Quit", mw); #if QT_VERSION >= 0x040600 actionQuit->setShortcut(QKeySequence::Quit); #else actionQuit->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q)); #endif connect(actionQuit, SIGNAL(triggered()), mw, SLOT(close())); // // "Plot"-menu // actionZoomFit = new QAction("Fit to Window", mw); actionZoomFit->setIcon(QIcon(":icons/zoom-fit-best.png")); actionZoomFit->setEnabled(false); connect(actionZoomFit, SIGNAL(triggered()), mw, SLOT(zoomFit())); actionZoom = new QAction("&Zoom", mw); actionZoom->setIcon(QIcon(":icons/page-zoom.png")); actionZoom->setCheckable(true); actionZoom->setEnabled(false); connect(actionZoom, SIGNAL(toggled(bool)), mw, SLOT(setZoomEnabled(bool))); actionMove = new QAction("&Move", mw); actionMove->setIcon(QIcon(":icons/input-mouse.png")); actionMove->setCheckable(true); actionMove->setChecked(false); actionMove->setEnabled(false); connect(actionMove, SIGNAL(toggled(bool)), mw, SLOT(setMoveEnabled(bool))); actionZoom->setChecked(true); // // "Go"-menu // actionGoFirst = new QAction("&First", mw); actionGoFirst->setShortcut(QKeySequence::MoveToStartOfLine); actionGoFirst->setEnabled(false); connect(actionGoFirst, SIGNAL(triggered()), mw, SLOT(goFirst())); actionGoPrevious = new QAction("&Previous", mw); actionGoPrevious->setShortcut(QKeySequence::MoveToPreviousPage); actionGoPrevious->setIcon(mw->style()->standardIcon(QStyle::SP_MediaSkipBackward)); actionGoPrevious->setEnabled(false); connect(actionGoPrevious, SIGNAL(triggered()), mw, SLOT(goPrevious())); actionGoNext = new QAction("&Next", mw); actionGoNext->setShortcut(QKeySequence::MoveToNextPage); actionGoNext->setIcon(mw->style()->standardIcon(QStyle::SP_MediaSkipForward)); actionGoNext->setEnabled(false); connect(actionGoNext, SIGNAL(triggered()), mw, SLOT(goNext())); actionGoLast = new QAction("&Last", mw); actionGoLast->setShortcut(QKeySequence::MoveToEndOfLine); actionGoLast->setEnabled(false); connect(actionGoLast, SIGNAL(triggered()), mw, SLOT(goLast())); actionWatchLatest = new QAction("&Watch Latest", mw); actionWatchLatest->setCheckable(true); actionWatchLatest->setChecked(false); actionWatchLatest->setEnabled(false); connect(actionWatchLatest, SIGNAL(toggled(bool)), mw, SLOT(setWatchLatest(bool))); // // "Tools"-menu // actionMaskNew = new QAction("&New", mw); actionMaskNew->setEnabled(false); connect(actionMaskNew, SIGNAL(triggered()), mw, SLOT(newMask())); actionMaskLoad = new QAction("&Open", mw); actionMaskLoad->setEnabled(false); connect(actionMaskLoad, SIGNAL(triggered()), mw, SLOT(loadMask())); actionMaskSaveAs = new QAction("&Save As ...", mw); actionMaskSaveAs->setEnabled(false); connect(actionMaskSaveAs, SIGNAL(triggered()), mw, SLOT(saveMaskAs())); actionMaskByThreshold = new QAction("By Threshold ...", mw); actionMaskByThreshold->setEnabled(false); connect(actionMaskByThreshold, SIGNAL(triggered()), mw, SLOT(setMaskByThreshold())); actionMaskAddPoint = new QAction("Add pixel", mw); actionMaskAddPoint->setCheckable(true); actionMaskAddPoint->setChecked(false); actionMaskAddPoint->setEnabled(false); connect(actionMaskAddPoint, SIGNAL(toggled(bool)), mw, SLOT(setMaskAddPointsEnabled(bool))); actionMaskAddPolygon = new QAction("Add polygon", mw); actionMaskAddPolygon->setCheckable(true); actionMaskAddPolygon->setChecked(false); actionMaskAddPolygon->setEnabled(false); connect(actionMaskAddPolygon, SIGNAL(toggled(bool)), mw, SLOT(setMaskAddPolygonEnabled(bool))); actionMaskRemovePoint = new QAction("Remove pixel", mw); actionMaskRemovePoint->setCheckable(true); actionMaskRemovePoint->setChecked(false); actionMaskRemovePoint->setEnabled(false); connect(actionMaskRemovePoint, SIGNAL(toggled(bool)), mw, SLOT(setMaskRemovePointsEnabled(bool))); actionMaskRemovePolygon = new QAction("Remove polygon", mw); actionMaskRemovePolygon->setCheckable(true); actionMaskRemovePolygon->setChecked(false); actionMaskRemovePolygon->setEnabled(false); connect(actionMaskRemovePolygon, SIGNAL(toggled(bool)), mw, SLOT(setMaskRemovePolygonEnabled(bool))); // // "Window"-menu // actionPreviousPlot = new QAction("&Previous Image", mw); actionPreviousPlot->setShortcut(QKeySequence::PreviousChild); connect(actionPreviousPlot, SIGNAL(triggered()), mdiArea, SLOT(activatePreviousSubWindow())); actionNextPlot = new QAction("&Next Image", mw); actionNextPlot->setShortcut(QKeySequence::NextChild); connect(actionNextPlot, SIGNAL(triggered()), mdiArea, SLOT(activateNextSubWindow())); actionCascadePlots = new QAction("C&ascade Images", mw); connect(actionCascadePlots, SIGNAL(triggered()), mdiArea, SLOT(cascadeSubWindows())); actionTilePlots = new QAction("&Tile Images", mw); connect(actionTilePlots, SIGNAL(triggered()), mdiArea, SLOT(tileSubWindows())); actionClosePlot = new QAction("&Close Current Image", mw); actionClosePlot->setShortcut(QKeySequence::Close); connect(actionClosePlot, SIGNAL(triggered()), mdiArea, SLOT(closeActiveSubWindow())); actionCloseAllPlots = new QAction("Close &All Images", mw); connect(actionCloseAllPlots, SIGNAL(triggered()), mdiArea, SLOT(closeAllSubWindows())); // // "Help"-menu // actionAbout = new QAction("&About", mw); connect(actionAbout, SIGNAL(triggered()), mw, SLOT(about())); actionGroupPlotPicker = new QActionGroup(mw); actionGroupPlotPicker->addAction(actionZoom); actionGroupPlotPicker->addAction(actionMove); actionGroupPlotPicker->addAction(actionMaskAddPoint); actionGroupPlotPicker->addAction(actionMaskAddPolygon); actionGroupPlotPicker->addAction(actionMaskRemovePoint); actionGroupPlotPicker->addAction(actionMaskRemovePolygon); }
void MainWindow::createActions() { newAction = new QAction(tr("&New"), this); newAction->setIcon(QIcon(":/images/new.png")); newAction->setShortcut(QKeySequence::New); newAction->setStatusTip(tr("Create a new file")); connect(newAction, SIGNAL(triggered()), this, SLOT(newFile())); openAction = new QAction(tr("&Open..."), this); openAction->setIcon(QIcon(":/images/open.png")); openAction->setShortcut(QKeySequence::Open); openAction->setStatusTip(tr("Open an existing file")); connect(openAction, SIGNAL(triggered()), this, SLOT(open())); saveAction = new QAction(tr("&Save"), this); saveAction->setIcon(QIcon(":/images/save.png")); saveAction->setShortcut(QKeySequence::Save); saveAction->setStatusTip(tr("Save the file to disk")); connect(saveAction, SIGNAL(triggered()), this, SLOT(save())); saveAsAction = new QAction(tr("Save &As..."), this); saveAsAction->setStatusTip(tr("Save the file under a new name")); connect(saveAsAction, SIGNAL(triggered()), this, SLOT(saveAs())); exitAction = new QAction(tr("E&xit"), this); exitAction->setShortcut(tr("Ctrl+Q")); exitAction->setStatusTip(tr("Exit the application")); connect(exitAction, SIGNAL(triggered()), this, SLOT(close())); cutAction = new QAction(tr("Cu&t"), this); cutAction->setIcon(QIcon(":/images/cut.png")); cutAction->setShortcut(QKeySequence::Cut); cutAction->setStatusTip(tr("Cut the current selection to the " "clipboard")); connect(cutAction, SIGNAL(triggered()), this, SLOT(cut())); copyAction = new QAction(tr("&Copy"), this); copyAction->setIcon(QIcon(":/images/copy.png")); copyAction->setShortcut(QKeySequence::Copy); copyAction->setStatusTip(tr("Copy the current selection to the " "clipboard")); connect(copyAction, SIGNAL(triggered()), this, SLOT(copy())); pasteAction = new QAction(tr("&Paste"), this); pasteAction->setIcon(QIcon(":/images/paste.png")); pasteAction->setShortcut(QKeySequence::Paste); pasteAction->setStatusTip(tr("Paste the clipboard's contents at " "the cursor position")); connect(pasteAction, SIGNAL(triggered()), this, SLOT(paste())); closeAction = new QAction(tr("Cl&ose"), this); closeAction->setShortcut(QKeySequence::Close); closeAction->setStatusTip(tr("Close the active window")); connect(closeAction, SIGNAL(triggered()), mdiArea, SLOT(closeActiveSubWindow())); closeAllAction = new QAction(tr("Close &All"), this); closeAllAction->setStatusTip(tr("Close all the windows")); connect(closeAllAction, SIGNAL(triggered()), this, SLOT(close())); tileAction = new QAction(tr("&Tile"), this); tileAction->setStatusTip(tr("Tile the windows")); connect(tileAction, SIGNAL(triggered()), mdiArea, SLOT(tileSubWindows())); cascadeAction = new QAction(tr("&Cascade"), this); cascadeAction->setStatusTip(tr("Cascade the windows")); connect(cascadeAction, SIGNAL(triggered()), mdiArea, SLOT(cascadeSubWindows())); nextAction = new QAction(tr("Ne&xt"), this); nextAction->setShortcut(QKeySequence::NextChild); nextAction->setStatusTip(tr("Move the focus to the next window")); connect(nextAction, SIGNAL(triggered()), mdiArea, SLOT(activateNextSubWindow())); previousAction = new QAction(tr("Pre&vious"), this); previousAction->setShortcut(QKeySequence::PreviousChild); previousAction->setStatusTip(tr("Move the focus to the previous " "window")); connect(previousAction, SIGNAL(triggered()), mdiArea, SLOT(activatePreviousSubWindow())); separatorAction = new QAction(this); separatorAction->setSeparator(true); aboutAction = new QAction(tr("&About"), this); aboutAction->setStatusTip(tr("Show the application's About box")); connect(aboutAction, SIGNAL(triggered()), this, SLOT(about())); aboutQtAction = new QAction(tr("About &Qt"), this); aboutQtAction->setStatusTip(tr("Show the Qt library's About box")); connect(aboutQtAction, SIGNAL(triggered()), qApp, SLOT(aboutQt())); windowActionGroup = new QActionGroup(this); }
MainGui::MainGui(QWidget *p) : QMainWindow(p), currenthdr(NULL) { setupUi(this); setAcceptDrops(true); //main toolbar setup QActionGroup *toolBarOptsGroup = new QActionGroup(this); toolBarOptsGroup->addAction(actionText_Under_Icons); toolBarOptsGroup->addAction(actionIcons_Only); toolBarOptsGroup->addAction(actionText_Alongside_Icons); toolBarOptsGroup->addAction(actionText_Only); menuToolbars->addAction(toolBar->toggleViewAction()); mdiArea = new QMdiArea(this); mdiArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded); mdiArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); mdiArea->setBackground(QBrush(QColor::fromRgb(192, 192, 192)) ); setCentralWidget(mdiArea); qtpfsgui_options=QtpfsguiOptions::getInstance(); load_options(); setWindowTitle("Qtpfsgui "QTPFSGUIVERSION); connect(mdiArea,SIGNAL(subWindowActivated(QMdiSubWindow*)),this,SLOT(updateActions(QMdiSubWindow*))); connect(fileNewAction, SIGNAL(triggered()), this, SLOT(fileNewViaWizard())); connect(fileOpenAction, SIGNAL(triggered()), this, SLOT(fileOpen())); connect(fileSaveAsAction, SIGNAL(triggered()), this, SLOT(fileSaveAs())); connect(TonemapAction, SIGNAL(triggered()), this, SLOT(tonemap_requested())); connect(rotateccw, SIGNAL(triggered()), this, SLOT(rotateccw_requested())); connect(rotatecw, SIGNAL(triggered()), this, SLOT(rotatecw_requested())); connect(actionResizeHDR, SIGNAL(triggered()), this, SLOT(resize_requested())); connect(action_Projective_Transformation, SIGNAL(triggered()), this, SLOT(projectiveTransf_requested())); connect(actionBatch_Tone_Mapping, SIGNAL(triggered()), this, SLOT(batch_requested())); connect(Low_dynamic_range,SIGNAL(triggered()),this,SLOT(current_mdi_ldr_exp())); connect(Fit_to_dynamic_range,SIGNAL(triggered()),this,SLOT(current_mdi_fit_exp())); connect(Shrink_dynamic_range,SIGNAL(triggered()),this,SLOT(current_mdi_shrink_exp())); connect(Extend_dynamic_range,SIGNAL(triggered()),this,SLOT(current_mdi_extend_exp())); connect(Decrease_exposure,SIGNAL(triggered()),this,SLOT(current_mdi_decrease_exp())); connect(Increase_exposure,SIGNAL(triggered()),this,SLOT(current_mdi_increase_exp())); connect(zoomInAct,SIGNAL(triggered()),this,SLOT(current_mdi_zoomin())); connect(zoomOutAct,SIGNAL(triggered()),this,SLOT(current_mdi_zoomout())); connect(fitToWindowAct,SIGNAL(toggled(bool)),this,SLOT(current_mdi_fit_to_win(bool))); connect(normalSizeAct,SIGNAL(triggered()),this,SLOT(current_mdi_original_size())); connect(documentationAction,SIGNAL(triggered()),this,SLOT(openDocumentation())); connect(actionWhat_s_This,SIGNAL(triggered()),this,SLOT(enterWhatsThis())); connect(actionAbout_Qt,SIGNAL(triggered()),qApp,SLOT(aboutQt())); connect(actionAbout_Qtpfsgui,SIGNAL(triggered()),this,SLOT(aboutQtpfsgui())); connect(OptionsAction,SIGNAL(triggered()),this,SLOT(preferences_called())); connect(Transplant_Exif_Data_action,SIGNAL(triggered()),this,SLOT(transplant_called())); connect(actionTile,SIGNAL(triggered()),mdiArea,SLOT(tileSubWindows())); connect(actionCascade,SIGNAL(triggered()),mdiArea,SLOT(cascadeSubWindows())); connect(fileExitAction, SIGNAL(triggered()), this, SLOT(fileExit())); connect(menuWindows, SIGNAL(aboutToShow()), this, SLOT(updateWindowMenu())); connect(actionSave_Hdr_Preview, SIGNAL(triggered()), this, SLOT(saveHdrPreview())); //QSignalMapper? connect(actionText_Under_Icons,SIGNAL(triggered()),this,SLOT(Text_Under_Icons())); connect(actionIcons_Only,SIGNAL(triggered()),this,SLOT(Icons_Only())); connect(actionText_Alongside_Icons,SIGNAL(triggered()),this,SLOT(Text_Alongside_Icons())); connect(actionText_Only,SIGNAL(triggered()),this,SLOT(Text_Only())); windowMapper = new QSignalMapper(this); connect(windowMapper,SIGNAL(mapped(QWidget*)),this,SLOT(setActiveSubWindow(QWidget*))); //recent files for (int i = 0; i < MaxRecentFiles; ++i) { recentFileActs[i] = new QAction(this); recentFileActs[i]->setVisible(false); connect(recentFileActs[i], SIGNAL(triggered()), this, SLOT(openRecentFile())); } separatorRecentFiles = menuFile->addSeparator(); for (int i = 0; i < MaxRecentFiles; ++i) menuFile->addAction(recentFileActs[i]); updateRecentFileActions(); //this->showMaximized(); testTempDir(qtpfsgui_options->tempfilespath); statusBar()->showMessage(tr("Ready.... Now open an Hdr or create one!"),17000); }
void MdiArea::cascade() { cascadeSubWindows(); zoomExtentsAllSubWindows(); }
void CLogisticMainWindow::setupMenu(const bool &visible) { if (!visible) return; // Document QMenu *documentMenu = menuBar()->addMenu(tr("&Документ")); documentMenu->addAction(tr("Новый"), this, SLOT(slotNewDocument()), QKeySequence(Qt::Key_F3)); documentMenu->addAction(tr("Открыть"), this, SLOT(slotOpenDocument()), QKeySequence(Qt::Key_F4)); documentMenu->addSeparator(); documentMenu->addAction(tr("Печать"), this, SLOT(slotPrintDocument())); documentMenu->addSeparator(); documentMenu->addAction(tr("Переместить"), this, SLOT(slotCutDocument()), QKeySequence(Qt::Key_F6)); documentMenu->addAction(tr("Копировать"), this, SLOT(slotCopyDocument())); documentMenu->addAction(tr("Вставить"),this, SLOT(slotPasteDocument())); documentMenu->addAction(tr("Удалить"), this, SLOT(slotDeleteDocument()), QKeySequence(Qt::Key_F8)); documentMenu->addSeparator(); documentMenu->addAction(tr("Найти..."), this, SLOT(slotSearchDocument())); documentMenu->addAction(tr("Найти следующий"), this, SLOT(slotSearchNextDocument())); documentMenu->addAction(tr("Найти предыдущий"), this, SLOT(slotSearchPrevDocument())); documentMenu->addSeparator(); documentMenu->addAction(tr("Обновить"), this, SLOT(slotRefreshDocument())); documentMenu->addAction(tr("Стать владельцем"), this, SLOT(slotOwnerDocument())); documentMenu->addSeparator(); documentMenu->addAction(tr("Выход"), this, SLOT(close()), QKeySequence(Qt::ALT | Qt::Key_F4)); // Folder QMenu *folderMenu = menuBar()->addMenu(tr("&Папка")); folderMenu->addAction(tr("Взаимоотношения"), this, SLOT(slotRelationsFolder())); folderMenu->addAction(tr("Календать"), this, SLOT(slotCalendarFolder())); folderMenu->addAction(tr("Напоминания"), this, SLOT(slotReminderFolder())); // Dictionary QMenu *dictionaryMenu = menuBar()->addMenu(tr("Справочники")); dictionaryMenu->addAction(tr("Заказчики"), this, SLOT(slotCustomerDictionary())); dictionaryMenu->addAction(tr("Поставщики"), this, SLOT(slotSuppliersDictionary())); dictionaryMenu->addAction(tr("Производители"), this, SLOT(slotProdusersDictionary())); dictionaryMenu->addSeparator(); dictionaryMenu->addAction(tr("Контакты"), this, SLOT(slotContactsDictionary())); dictionaryMenu->addAction(tr("Должности"), this, SLOT(slotPositionsDictionary())); dictionaryMenu->addSeparator(); dictionaryMenu->addAction(tr("Типы задач"), this, SLOT(slotTaskTypesDictionary())); dictionaryMenu->addAction(tr("Типы контрагентов"), this, SLOT(slotContractorTypesDictionary())); dictionaryMenu->addAction(tr("Статусы"), this, SLOT(slotStatusDictionary())); dictionaryMenu->addAction(tr("Приоритеты"), this, SLOT(slotPrioritiesDictionary())); dictionaryMenu->addSeparator(); dictionaryMenu->addAction(tr("Страны и города"), this, SLOT(slotCountryCityDictionary())); // View QMenu *viewMenu = menuBar()->addMenu(tr("&Вид")); QAction *m_actual = viewMenu->addAction(tr("Актуальные документы")); connect(m_actual, SIGNAL(triggered()), SLOT(slotActualDocumentsView())); viewMenu->addAction(tr("Дерево документов"), this, SLOT(slotTreeDocumentsView()), QKeySequence(Qt::Key_F9)); // Window QMenu *windowMenu = menuBar()->addMenu(tr("&Окно")); QAction *close = windowMenu->addAction(tr("Закрыть")); connect(close, SIGNAL(triggered()), mdiArea, SLOT(closeActiveSubWindow())); QAction *closeAll = windowMenu->addAction(tr("Закрыть все")); connect(closeAll, SIGNAL(triggered()), mdiArea, SLOT(closeAllSubWindows())); windowMenu->addSeparator(); QAction *m_tile = windowMenu->addAction(tr("Плитка")); connect(m_tile, SIGNAL(triggered()), mdiArea, SLOT(tileSubWindows())); QAction *m_cascade = windowMenu->addAction(tr("Каскад")); connect(m_cascade, SIGNAL(triggered()), mdiArea, SLOT(cascadeSubWindows())); windowMenu->addSeparator(); QMenu *modeMenu = windowMenu->addMenu(tr("Режим отображения")); QAction *m_modeMdi = modeMenu->addAction(tr("Оконный")); connect(m_modeMdi, SIGNAL(triggered()), mdiArea, SLOT(tileSubWindows())); QAction *m_modeWindow = modeMenu->addAction(tr("Вкладки")); connect(m_modeWindow, SIGNAL(triggered()), mdiArea, SLOT(tileSubWindows())); windowMenu->addSeparator(); QAction *next = windowMenu->addAction(tr("Следующее")); connect(next, SIGNAL(triggered()), mdiArea, SLOT(activateNextSubWindow())); QAction *previous = windowMenu->addAction(tr("Предыдущее")); connect(previous, SIGNAL(triggered()), mdiArea, SLOT(activatePreviousSubWindow())); }