void Clock::initMenu() { alwaysOnTopAct = new QAction(tr("Always On Top"), this); alwaysOnTopAct->setStatusTip(tr("Stay on top of all other windows")); alwaysOnTopAct->setCheckable(true); connect(alwaysOnTopAct, SIGNAL(triggered()), this, SLOT(setAlwaysOnTopSlot())); settingsAct = new QAction(tr("Settings"), this); settingsAct->setShortcut(tr("Dbl Click")); settingsAct->setStatusTip(tr("Binary Clock Settings")); connect(settingsAct, SIGNAL(triggered()), this, SLOT(openSettingsDialog())); aboutAct = new QAction(tr("About"), this); aboutAct->setStatusTip(tr("About Binary Clock")); connect(aboutAct, SIGNAL(triggered()), this, SLOT(showAbout())); exitAct = new QAction(tr("Exit"), this); exitAct->setShortcut(tr("Alt+F4")); exitAct->setStatusTip(tr("Exit the binary clock")); connect(exitAct, SIGNAL(triggered()), this, SLOT(close())); contextMenu = new QMenu(); contextMenu->addAction(alwaysOnTopAct); contextMenu->addSeparator(); contextMenu->addAction(settingsAct); contextMenu->addAction(aboutAct); contextMenu->addSeparator(); contextMenu->addAction(exitAct); }
HelpMenu::HelpMenu(QWidget *parent) : QMenu(parent) { setTitle(tr("&Help")); about = addAction(tr("About")); connect(about, SIGNAL(triggered()), this, SLOT(showAbout())); }
void MetaWindow::createActions(){ resetAct = new QAction(tr("&Reset"),this); resetAct->setShortcut(tr("Ctrl+R")); resetAct->setStatusTip(tr("Reset the list to its original state.")); connect(resetAct, SIGNAL(triggered()), this, SLOT(resetModel())); saveAct = new QAction(tr("&Save"),this); saveAct->setShortcut(tr("Ctrl+S")); saveAct->setStatusTip(tr("Save the current file.")); connect(saveAct, SIGNAL(triggered()), this, SLOT(saveFile())); saveAsAct = new QAction(tr("Save As..."),this); saveAsAct->setStatusTip(tr("Save the current file to a specified file name.")); connect(saveAsAct, SIGNAL(triggered()), this, SLOT(saveFileAs())); loadAct = new QAction(tr("&Load"),this); loadAct->setShortcut(tr("Ctrl+L")); loadAct->setStatusTip(tr("Load input file")); connect(loadAct, SIGNAL(triggered()), this, SLOT(loadFile())); quitAct = new QAction(tr("&Quit"),this); quitAct->setShortcut(tr("Ctrl+Q")); quitAct->setStatusTip(tr("Quit")); connect(quitAct, SIGNAL(triggered()), this, SLOT(close())); aboutAct = new QAction(tr("About"),this); searchAct = new QAction(tr("Search For Parameter/Parameter List"), this); searchAct->setToolTip("Search for a particular Parameter or ParameterList"); connect(aboutAct, SIGNAL(triggered()), this, SLOT(showAbout())); connect(searchAct, SIGNAL(triggered()), this, SLOT(initiateSearch())); }
void Window::dealMenu(void) { QMenuBar * MenuBar = new QMenuBar(this); QMenu * GameMenu = new QMenu(tr("GAME"), MenuBar); QMenu * HelpMenu = new QMenu(tr("Help"), MenuBar); QAction * StartGame = new QAction(tr("Start"), GameMenu); QAction * StopGame = new QAction(tr("End"), GameMenu); QAction * QuitGame = new QAction(tr("Quit"), GameMenu); GameMenu->addAction(StartGame); GameMenu->addAction(StopGame); GameMenu->addAction(QuitGame); MenuBar->addMenu(GameMenu); connect(StartGame, SIGNAL(triggered()), this, SLOT(startGame())); connect(StopGame, SIGNAL(triggered()), this, SLOT(stopGame())); connect(QuitGame, SIGNAL(triggered()), this, SLOT(close())); QAction * About = new QAction(tr("About"), HelpMenu); HelpMenu->addAction(About); MenuBar->addMenu(HelpMenu); connect(About, SIGNAL(triggered()), this, SLOT(showAbout())); setMenuBar(MenuBar); }
void MainWindow::initMenu() { QMenu *fileMenu = new QMenu("File", this); QAction *saveAction = new QAction("Save", fileMenu); QAction *loadAction = new QAction("Load", fileMenu); QAction *playAction = new QAction("Play", fileMenu); //QAction *logAction = new QAction("Show log", fileMenu); saveAction->setShortcut(QKeySequence::Save); loadAction->setShortcut(QKeySequence("Ctrl+L")); playAction->setShortcut(QKeySequence("Space")); fileMenu->addAction(saveAction); fileMenu->addAction(loadAction); fileMenu->addAction(playAction); //fileMenu->addAction(logAction); menuBar()->addMenu(fileMenu); connect(saveAction, SIGNAL(triggered()), filesList, SLOT(save())); connect(loadAction, SIGNAL(triggered()), filesList, SLOT(load())); connect(playAction, SIGNAL(triggered()), player, SLOT(togglePause())); //connect(logAction, SIGNAL(triggered()), SLOT(showLog())); // add "About" item QMenu *helpMenu = new QMenu(tr("&Help"), this); QAction *aboutAction = helpMenu->addAction(tr("&About")); connect(aboutAction, SIGNAL(triggered()), this, SLOT(showAbout())); menuBar()->addMenu(helpMenu); }
void Window::configureActions() { showAboutAction = new QAction(tr("&About"), this); showAboutAction->setIcon(aboutIcon); connect(showAboutAction, SIGNAL(triggered()), this, SLOT(showAbout())); showResultAction = new QAction(tr("&Show result"), this); showResultAction->setIcon(logoIcon); connect(showResultAction, SIGNAL(triggered()), this, SLOT(showResult())); quitAction = new QAction(tr("&Quit"), this); quitAction->setIcon(QIcon(":/images/Close.png")); connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit())); startTrackingAction = new QAction(tr("Start tracking"), this); startTrackingAction->setIcon(playIcon); connect(startTrackingAction, SIGNAL(triggered()), this, SLOT(startTracking())); pauseTrackingAction = new QAction(tr("Pause tracking"), this); pauseTrackingAction->setIcon(pauseIcon); connect(pauseTrackingAction, SIGNAL(triggered()), this, SLOT(pauseTracking())); pauseTrackingAction->setEnabled(false); resetTrackedTimeAction = new QAction(tr("Reset tracking result"), this); connect(resetTrackedTimeAction, SIGNAL(triggered()), this, SLOT(resetTrackingResult())); resetTrackedTimeAction->setEnabled(false); }
void MainPage::createActions(void) { MAction *newAction = new MAction("icon-m-toolbar-add", tr("Create a new tag"), this); newAction->setLocation(MAction::ToolBarLocation); connect(newAction, SIGNAL(triggered()), this, SLOT(createTag())); addAction(newAction); MAction *killallAction = new MAction(tr("Remove all tags"), this); killallAction->setLocation(MAction::ApplicationMenuLocation); connect(killallAction, SIGNAL(triggered()), this, SLOT(removeAllTags())); addAction(killallAction); MAction *aboutAction = new MAction(tr("About..."), this); aboutAction->setLocation(MAction::ApplicationMenuLocation); connect(aboutAction, SIGNAL(triggered()), this, SLOT(showAbout())); addAction(aboutAction); MAction *helpAction = new MAction(tr("Instructions..."), this); helpAction->setLocation(MAction::ApplicationMenuLocation); connect(helpAction, SIGNAL(triggered()), this, SLOT(showHelp())); addAction(helpAction); }
MainWindow::MainWindow(QWidget *parent): QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); /*kozepre teszi a nyito kepernyot*/ QRect available_geom = QDesktopWidget().availableGeometry(); QRect current_geom = frameGeometry(); setGeometry(available_geom.width() / 2 - current_geom.width() / 2, available_geom.height() / 2 - current_geom.height() / 2, current_geom.width(), current_geom.height()); /********************************/ connect(ui->actionExit, SIGNAL(triggered()), this, SLOT(close())); connect(ui->actionSave, SIGNAL(triggered()), this, SLOT(MenTXT())); connect(ui->actionAbout, SIGNAL(triggered()), this, SLOT(showAbout())); connect(ui->actionBinom, SIGNAL(triggered()), this, SLOT(binom()) ); connect(ui->actionHelp, SIGNAL(triggered()), this, SLOT(showHelp())); connect(ui->actionPrint, SIGNAL(triggered()), this, SLOT(printIt())); ui->mainToolBar->addAction(ui->actionSave); ui->mainToolBar->addAction(ui->actionPrint); ui->mainToolBar->addSeparator(); ui->mainToolBar->addAction(ui->actionBinom); ui->mainToolBar->addSeparator(); ui->mainToolBar->addAction(ui->actionHelp); verzio = "2010-03-03"; settingClear(); }
void DesktopMainWindow::createActions() { _newProjectAction = new QAction(tr("New Project"), this); _newProjectAction->setShortcut(QKeySequence::New); _newProjectAction->setStatusTip(tr("Start a new project")); connect(_newProjectAction, SIGNAL(triggered()), this, SLOT(newProject())); _openProjectAction = new QAction(QIcon(":/resources/images/open.png"), tr("&Open Project"), this); _openProjectAction->setShortcut(QKeySequence::Open); _openProjectAction->setStatusTip(tr("Open an existing file")); connect(_openProjectAction, SIGNAL(triggered()), this, SLOT(openProject())); _saveProjectAction = new QAction(QIcon(":/resources/images/save.png"), tr("&Save Project"), this); _saveProjectAction->setShortcut(QKeySequence::Save); _saveProjectAction->setStatusTip(tr("Save current project")); connect(_saveProjectAction, SIGNAL(triggered()), this, SLOT(saveProject())); _exitAction = new QAction(tr("&Exit"), this); connect(_exitAction, SIGNAL(triggered()), this, SLOT(close())); _undoAction = new QAction(QIcon(":/resources/images/undo.png"), tr("&Undo"), this); connect(_undoAction, SIGNAL(triggered()), this, SLOT(undo())); _settingsAction = new QAction(QIcon(":/resources/images/gear.png"), tr("&Options"), this); connect(_settingsAction, SIGNAL(triggered()), this, SLOT(editSettings())); _restoreLayoutAction = new QAction(tr("&Restore Layout"), this); connect(_restoreLayoutAction, SIGNAL(triggered()), this, SLOT(restoreLayout())); _aboutAction = new QAction(QIcon(":/resources/images/info.png"), tr("&About"), this); _aboutAction->setStatusTip(tr("About Godzi")); connect(_aboutAction, SIGNAL(triggered()), this, SLOT(showAbout())); }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); setWindowIcon(QIcon(":icons/icon.png")); setWindowTitle("quickly translate"); QSystemTrayIcon * trayIcon = new QSystemTrayIcon(this); mNetManager = new QNetworkAccessManager(this); mLangageModel = new LanguageModel; trayIcon->setIcon(QIcon(":icons/icon.png")); trayIcon->setContextMenu(ui->menuFile); trayIcon->show(); ui->dockWidget->hide(); ui->sourceComboBox->setModel(mLangageModel); ui->targetComboBox->setModel(mLangageModel); QDesktopWidget * desktop = new QDesktopWidget; QPoint startPos = QPoint(desktop->geometry().bottomRight() ); QPoint finalPos = desktop->geometry().center() - QPoint(width()/2,height()/2); move(finalPos); connect(trayIcon,SIGNAL(activated(QSystemTrayIcon::ActivationReason)),this,SLOT(trayActivated(QSystemTrayIcon::ActivationReason))); connect(ui->actionExit,SIGNAL(triggered()),this,SLOT(exit())); connect(ui->translateButton,SIGNAL(clicked()),this,SLOT(translate())); connect(ui->sourceTextEdit,SIGNAL(returnPressed()),this,SLOT(translate())); connect(ui->swapButton,SIGNAL(clicked()),this,SLOT(swapLangages())); connect(ui->actionCopy,SIGNAL(triggered()),this,SLOT(copy())); connect(ui->actionCut,SIGNAL(triggered()),this,SLOT(cut())); connect(ui->actionPast,SIGNAL(triggered()),this,SLOT(past())); connect(ui->actionPreferences,SIGNAL(triggered()),this,SLOT(showPreferences())); connect(ui->actionAboutQt,SIGNAL(triggered()),this,SLOT(showAboutQt())); connect(ui->actionAbout,SIGNAL(triggered()),this,SLOT(showAbout())); connect(ui->actionTTS,SIGNAL(triggered()),this,SLOT(showTextTTS())); connect(ui->sourceSoundButton,SIGNAL(clicked()),this,SLOT(textToSpeak())); connect(ui->targetSoundButton,SIGNAL(clicked()),this,SLOT(textToSpeak())); // mPropertyAnimation = new QPropertyAnimation(this, "pos"); // mPropertyAnimation->setDuration(800); // mPropertyAnimation->setStartValue(startPos); // mPropertyAnimation->setEndValue(finalPos); //load default langage QSettings settings; QString sourceId = settings.value("source").toString(); QString targetId = settings.value("target").toString(); ui->sourceComboBox->setCurrentIndex(mLangageModel->findLangageId(sourceId)); ui->targetComboBox->setCurrentIndex(mLangageModel->findLangageId(targetId)); }
/** * Méthode initialisant l'icône de la zone de notification * * @return void * @since 1.0.0 */ void ConvertWindow::initIcon() { tray_icon = new QSystemTrayIcon(this); QMenu* menu = new QMenu(this); QAction* action_show = new QAction(QString::fromUtf8("Afficher"), this); QAction* action_hide = new QAction(QString::fromUtf8("Réduire"), this); QAction* action_about = new QAction(QString::fromUtf8("A propos de QOpenConvert"), this); QAction* action_close = new QAction(QString::fromUtf8("Fermer QOpenConvert"), this); connect(action_show, SIGNAL(triggered()), this, SLOT(showWindow())); connect(action_hide, SIGNAL(triggered()), this, SLOT(hideWindow())); connect(action_close, SIGNAL(triggered()), qApp, SLOT(quit())); connect(action_about, SIGNAL(triggered()), this, SLOT(showAbout())); connect(tray_icon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason))); menu->addAction(action_show); menu->addAction(action_hide); menu->addAction(action_about); menu->addAction(action_close); tray_icon->setContextMenu(menu); QIcon image = QIcon(":/images/icon.png"); tray_icon->setIcon(image); tray_icon->show(); }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); connect(ui->actionNew_project, SIGNAL(triggered()), SLOT(addNewProject())); connect(ui->actionOpen_project, SIGNAL(triggered()), SLOT(openProject())); connect(ui->actionSave_project, SIGNAL(triggered()), SLOT(saveProject())); connect(ui->actionSave_project_as, SIGNAL(triggered()), SLOT(saveProjectAs())); connect(ui->actionClose_project, SIGNAL(triggered()), SLOT(closeProject())); connect(ui->actionUndo, SIGNAL(triggered()), SLOT(undo())); connect(ui->actionRedo, SIGNAL(triggered()), SLOT(redo())); connect(ui->actionImport, SIGNAL(triggered()), SLOT(importProject())); connect(ui->actionExport, SIGNAL(triggered()), SLOT(exportProject())); connect(ui->actionAbout, SIGNAL(triggered()), SLOT(showAbout())); connect(ui->actionAbout_Qt, SIGNAL(triggered()), SLOT(showAboutQt())); QString fileName = //"/home/gogi/Downloads/pcsc_pcsc_00001.vcf"; "G:\\pcsc_pcsc_00001.vcf"; QFile file(fileName); //showProject(new VCardProject(file)); updateProjectState(); }
WelcomeBox::WelcomeBox(QWidget *parentWidget, QGraphicsItem *parentItem) : QGraphicsWidget(parentItem) { m_parentWidget = parentWidget; setMinimumSize(BOX_W, BOX_H); setMaximumSize(BOX_W, BOX_H); m_width = static_cast<int>(BOX_W) - 2; m_height = static_cast<int>(BOX_H) - 2; QGraphicsWidget *topEmpty = new QGraphicsWidget; topEmpty->setMinimumSize(BOX_W, TEXT_BOX_H + 40); topEmpty->setMaximumSize(topEmpty->minimumSize()); QGraphicsWidget *leftEmpty = new QGraphicsWidget; leftEmpty->setMinimumSize(25, 20); leftEmpty->setMaximumSize(leftEmpty->minimumSize()); QGraphicsWidget *centerEmpty = new QGraphicsWidget; centerEmpty->setMinimumSize(100, 20); centerEmpty->setMaximumSize(centerEmpty->minimumSize()); QGraphicsWidget *rightEmpty = new QGraphicsWidget; rightEmpty->setMinimumSize(25, 20); rightEmpty->setMaximumSize(rightEmpty->minimumSize()); QGraphicsGridLayout *layout = new QGraphicsGridLayout; layout->addItem(topEmpty, 0, 0, 1, 5); layout->addItem(leftEmpty, 1, 0); layout->addItem(centerEmpty, 1, 2); layout->addItem(rightEmpty, 1, 4); GUIManager *gm = GUIManager::instance(); connect(this, SIGNAL(modeChanged(int)), gm, SLOT(setMode(int))); // Modes QList<Mode> modes = ModeManager::modes(); Mode mode; QAction *act; int i = 1; foreach (mode, modes) { if (mode.id != ModeManager::ID_WELCOME) { act = new QAction(this); act->setText(mode.name); act->setData(mode.id); connect(act, SIGNAL(triggered()), this, SLOT(setMode())); layout->addItem(new WelcomeLink(act), i, 1); i++; } } // about act = new QAction(this); act->setText(tr("About Bmin")); connect(act, SIGNAL(triggered()), this, SLOT(showAbout())); layout->addItem(new WelcomeLink(act), 1, 3); // setting layout setLayout(layout); }
void AboutDialog::buttonClicked() { if (ui->authorsButton->text() == tr("Authors and Contributors")) { showAuthors(); } else if (ui->authorsButton->text() == tr("< About QupZilla")) { showAbout(); } }
int main(void) { char key; timerInitTOD(); screenInit(); progressInit(); g_strFileName[0] = '\0'; g_nDrive = *(uint8_t*)0xba; if (g_nDrive < 8) g_nDrive = 8; internalCartType = INTERNAL_CART_TYPE_NONE; g_bFastLoaderEnabled = 1; updateFastLoaderText(); refreshMainScreen(); showAbout(); refreshMainScreen(); screenBing(); // this also makes visible 16kByte of flash memory checkFlashType(); checkRAM(); for (;;) { setStatus("Ready. Press <m> for Menu."); key = cgetc(); switch (key) { case 'm': execMenu(&menuMain); break; case 'o': execMenu(&menuOptions); break; case 'e': execMenu(&menuExpert); break; case 'h': execMenu(&menuHelp); break; } } return 0; }
Welcom::Welcom(QWidget *parent) : QWidget(parent), ui(new Ui::Welcom) { ui->setupUi(this); this->resize(QSize(800, 480)); this->setWindowFlags(Qt::X11BypassWindowManagerHint); connect(ui->btnWelcom, SIGNAL(clicked()), this, SLOT(enterMain())); connect(ui->btnAbout,SIGNAL(clicked()),this, SLOT(showAbout())); connect(ui->btnExit, SIGNAL(clicked()),this, SLOT(exitProgram())); }
void GhostwriterPlugin::toolWidgetCreated(QWidget *uiWidget) { // Need to initialize the comobo boxes with the logo filenames // find the combo box, it's named bbwmode_combo if ( QComboBox * pCombo = uiWidget->findChild< QComboBox * >( "logofilename1_combo" ) ) { pCombo->clear(); QList<QString>logoNames = readLogoNames(); for (int i = 0; i < logoNames.size(); i++) { pCombo->addItem( logoNames[i], i ); } pCombo->setMaxVisibleItems( pCombo->count() ); } if ( QComboBox * pCombo = uiWidget->findChild< QComboBox * >( "logofilename2_combo" ) ) { pCombo->clear(); QList<QString>logoNames = readLogoNames(); for (int i = 0; i < logoNames.size(); i++) { pCombo->addItem( logoNames[i], i ); } pCombo->setMaxVisibleItems( pCombo->count() ); } // connect the "?" button to a slot to show info about the plugin if ( QAbstractButton * pBtn = uiWidget->findChild< QAbstractButton * >( GHOSTWRITER_ABOUT_BNNAME ) ) { connect( pBtn, SIGNAL( clicked() ), SLOT( showAbout() ) ); } // connect the "Fit" button to a slot if ( QAbstractButton * pBtn = uiWidget->findChild< QAbstractButton * >( GHOSTWRITER_REFRESH_BNNAME ) ) { connect( pBtn, SIGNAL( clicked() ), SLOT( fitIntoCrop() ) ); } // connect the "Save" button to a slot if ( QAbstractButton * pBtn = uiWidget->findChild< QAbstractButton * >( GHOSTWRITER_SAVE_BNNAME ) ) { connect( pBtn, SIGNAL( clicked() ), SLOT( save() ) ); } m_pWindow = uiWidget->window(); }
lmcCore::lmcCore(void) { pMessaging = new lmcMessaging(); connect(pMessaging, SIGNAL(messageReceived(MessageType, QString*, XmlMessage*)), this, SLOT(receiveMessage(MessageType, QString*, XmlMessage*))); connect(pMessaging, SIGNAL(connectionStateChanged()), this, SLOT(connectionStateChanged())); pMainWindow = new lmcMainWindow(); connect(pMainWindow, SIGNAL(appExiting()), this, SLOT(exitApp())); connect(pMainWindow, SIGNAL(chatStarting(QString*)), this, SLOT(startChat(QString*))); connect(pMainWindow, SIGNAL(chatRoomStarting(QString*)), this, SLOT(startChatRoom(QString*))); connect(pMainWindow, SIGNAL(messageSent(MessageType, QString*, XmlMessage*)), this, SLOT(sendMessage(MessageType, QString*, XmlMessage*))); connect(pMainWindow, SIGNAL(showTransfers()), this, SLOT(showTransfers())); connect(pMainWindow, SIGNAL(showHistory()), this, SLOT(showHistory())); connect(pMainWindow, SIGNAL(showSettings()), this, SLOT(showSettings())); connect(pMainWindow, SIGNAL(showHelp(QRect*)), this, SLOT(showHelp(QRect*))); connect(pMainWindow, SIGNAL(showUpdate(QRect*)), this, SLOT(showUpdate(QRect*))); connect(pMainWindow, SIGNAL(showAbout()), this, SLOT(showAbout())); connect(pMainWindow, SIGNAL(showBroadcast()), this, SLOT(showBroadcast())); connect(pMainWindow, SIGNAL(showPublicChat()), this, SLOT(showPublicChat())); connect(pMainWindow, SIGNAL(groupUpdated(GroupOp, QVariant, QVariant)), this, SLOT(updateGroup(GroupOp, QVariant, QVariant))); pPublicChatWindow = new lmcChatRoomWindow(); connect(pPublicChatWindow, SIGNAL(messageSent(MessageType, QString*, XmlMessage*)), this, SLOT(sendMessage(MessageType, QString*, XmlMessage*))); connect(pPublicChatWindow, SIGNAL(chatStarting(QString*)), this, SLOT(startChat(QString*))); chatWindows.clear(); chatRoomWindows.clear(); pTransferWindow = NULL; pHistoryWindow = NULL; pSettingsDialog = NULL; pUserInfoWindow = NULL; pHelpWindow = NULL; pUpdateWindow = NULL; pUserSelectDialog = NULL; pAboutDialog = NULL; pBroadcastWindow = NULL; pTimer = NULL; }
int main(int argc, char *argv[]) { if (getuid()!=0) { string args; for (int i=0; i<argc; i++) { args+=(string) argv[i] + " "; } return system("kdesu " + args); } setlocale(LC_ALL, ""); bindtextdomain( "installpkg-ng", "/usr/share/locale"); textdomain("installpkg-ng"); QApplication app(argc, argv); QTranslator translator; translator.load("/usr/share/mpkg/pkgmanager_ru"); app.installTranslator(&translator); MainWindow mw; QObject::connect(mw.ui.selectAllButton, SIGNAL(clicked()), &mw, SLOT(selectAll())); QObject::connect(mw.ui.deselectAllButton, SIGNAL(clicked()), &mw, SLOT(deselectAll())); QObject::connect(mw.ui.actionQuit, SIGNAL(triggered()), &mw, SLOT(quitApp())); QObject::connect(mw.ui.quitButton, SIGNAL(clicked()), &mw, SLOT(quitApp())); QObject::connect(mw.ui.applyButton, SIGNAL(clicked()), &mw, SLOT(commitChanges())); QObject::connect(mw.ui.actionAbout, SIGNAL(triggered()), &mw, SLOT(showAbout())); QObject::connect(mw.ui.actionReset_changes, SIGNAL(triggered()), &mw, SLOT(resetChanges())); QObject::connect(mw.ui.actionReset_all_queue, SIGNAL(triggered()), &mw, SLOT(resetQueue())); QObject::connect(mw.ui.actionPreferences, SIGNAL(triggered()), &mw, SLOT(showPreferences())); QObject::connect(mw.ui.actionAdd_remove_repositories, SIGNAL(triggered()), &mw, SLOT(showAddRemoveRepositories())); QObject::connect(mw.ui.actionClean_cache, SIGNAL(triggered()), &mw, SLOT(cleanCache())); QObject::connect(mw.ui.actionShow_installed, SIGNAL(triggered()), &mw, SLOT(applyPackageFilter())); QObject::connect(mw.ui.actionShow_deprecated, SIGNAL(triggered()), &mw, SLOT(applyPackageFilter())); QObject::connect(mw.ui.actionShow_available, SIGNAL(triggered()), &mw, SLOT(applyPackageFilter())); QObject::connect(mw.ui.actionShow_queue, SIGNAL(triggered()), &mw, SLOT(applyPackageFilter())); QObject::connect(mw.ui.actionShow_configexist, SIGNAL(triggered()), &mw, SLOT(applyPackageFilter())); QObject::connect(mw.ui.actionShow_unavailable, SIGNAL(triggered()), &mw, SLOT(applyPackageFilter())); QObject::connect(mw.ui.actionCore_settings, SIGNAL(triggered()), &mw, SLOT(showCoreSettings())); QObject::connect(mw.ui.actionUpdate_data, SIGNAL(triggered()), &mw, SLOT(updateData())); QObject::connect(mw.ui.packageTable, SIGNAL(itemSelectionChanged()), &mw, SLOT(showPackageInfo())); QObject::connect(mw.ui.quickPackageSearchEdit, SIGNAL(textEdited(const QString &)), &mw, SLOT(applyPackageFilter())); int ret = app.exec(); return ret; }
SimMainWindow::SimMainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::SimMainWindow) { ui->setupUi(this); mEngine = new LifeEngine(100,100); mView = new LifeEngineView(mEngine); mLifeFileView = new LifeFileView; mLifesView = new LifesView(mEngine); mUndoStack = new QUndoStack(this); mOldLifeCount = 0; ui->dock1->setWidget(mLifeFileView); ui->dock2->setWidget(mLifesView); ui->dock1->setWindowTitle(mLifeFileView->windowTitle()); ui->dock2->setWindowTitle(mLifesView->windowTitle()); setCentralWidget(mView); ui->menuEdit->addActions(mLifeFileView->actions()); ui->menuEdit->addSeparator(); ui->menuEdit->addActions(mLifesView->actions()); connect(mView->gridView()->grid(),SIGNAL(squareClicked(QPoint)),this,SLOT(clicked(QPoint))); connect(ui->actionRun,SIGNAL(triggered()),this,SLOT(startSimulation())); connect(ui->actionNew,SIGNAL(triggered()),this,SLOT(newSim())); connect(ui->actionSave,SIGNAL(triggered()),this,SLOT(saveSim())); connect(ui->actionSaveAs,SIGNAL(triggered()),this,SLOT(saveAsSim())); connect(ui->actionOpen,SIGNAL(triggered()),this,SLOT(openSim())); connect(ui->actionClear,SIGNAL(triggered()),this,SLOT(clear())); connect(ui->actionAnimator,SIGNAL(triggered()),this,SLOT(showAnimator())); connect(ui->actionLifeEditor,SIGNAL(triggered()),this,SLOT(showLifeEditor())); connect(mLifesView,SIGNAL(changed()),this,SLOT(refresh())); connect(mLifesView,SIGNAL(clicked()),this,SLOT(setGridSelection())); connect(ui->actionAboutQt,SIGNAL(triggered()),this,SLOT(showAboutQt())); connect(ui->actionAbout,SIGNAL(triggered()),this,SLOT(showAbout())); connect(ui->actionUndo,SIGNAL(triggered()),mUndoStack,SLOT(undo())); connect(ui->actionRedo,SIGNAL(triggered()),mUndoStack,SLOT(redo())); connect(mUndoStack,SIGNAL(canUndoChanged(bool)),ui->actionUndo,SLOT(setEnabled(bool))); connect(mUndoStack,SIGNAL(canRedoChanged(bool)),ui->actionRedo,SLOT(setEnabled(bool))); ui->actionSave->setEnabled(false); newSim(); }
VerticalMenuWidget::VerticalMenuWidget(QWidget *parent) : AbstractMenuWidget(parent), ui(new Ui::VerticalMenuWidget) { ui->setupUi(this); connect(ui->btnAbout,SIGNAL(clicked()),this,SIGNAL(showAbout())); connect(ui->btnExit,SIGNAL(clicked()),this,SIGNAL(exitClicked())); connect(ui->btnFiles,SIGNAL(clicked()),this,SIGNAL(showFiles())); connect(ui->btnArtists,SIGNAL(clicked()),this,SIGNAL(showArtists())); connect(ui->btnAlbums,SIGNAL(clicked()),this,SIGNAL(showAlbums())); connect(ui->btnConnect,SIGNAL(clicked()),this,SIGNAL(connectClicked())); connect(ui->btnCurrentSong,SIGNAL(clicked()),this,SIGNAL(showCurrentSong())); connect(ui->btnSettings,SIGNAL(clicked()),this,SIGNAL(showSettings())); connect(ui->btnPlaylists,SIGNAL(clicked()),this,SIGNAL(showPlaylist())); }
void MainWindow::linkClicked(const QString &link) { if (link.compare(QLatin1String("settings:"), Qt::CaseInsensitive) == 0) showSettings(); else if (link.compare(QLatin1String("help:"), Qt::CaseInsensitive) == 0) showHelp(); else if (link.compare(QLatin1String("about:"), Qt::CaseInsensitive) == 0) showAbout(); else if (link.startsWith(QLatin1String("examples:"), Qt::CaseInsensitive)) { auto example = link.midRef(9); openPathLater(MapperResource::locate(MapperResource::EXAMPLE) + QLatin1Char('/') + example); } else QDesktopServices::openUrl(link); }
void SpreadSheet::createActions() { cell_sumAction = new QAction(tr("Sum"), this); connect(cell_sumAction, SIGNAL(triggered()), this, SLOT(actionSum())); cell_addAction = new QAction(tr("&Add"), this); cell_addAction->setShortcut(Qt::CTRL | Qt::Key_Plus); connect(cell_addAction, SIGNAL(triggered()), this, SLOT(actionAdd())); cell_subAction = new QAction(tr("&Subtract"), this); cell_subAction->setShortcut(Qt::CTRL | Qt::Key_Minus); connect(cell_subAction, SIGNAL(triggered()), this, SLOT(actionSubtract())); cell_mulAction = new QAction(tr("&Multiply"), this); cell_mulAction->setShortcut(Qt::CTRL | Qt::Key_multiply); connect(cell_mulAction, SIGNAL(triggered()), this, SLOT(actionMultiply())); cell_divAction = new QAction(tr("&Divide"), this); cell_divAction->setShortcut(Qt::CTRL | Qt::Key_division); connect(cell_divAction, SIGNAL(triggered()), this, SLOT(actionDivide())); fontAction = new QAction(tr("Font..."), this); fontAction->setShortcut(Qt::CTRL | Qt::Key_F); connect(fontAction, SIGNAL(triggered()), this, SLOT(selectFont())); colorAction = new QAction(QPixmap(16, 16), tr("Background &Color..."), this); connect(colorAction, SIGNAL(triggered()), this, SLOT(selectColor())); clearAction = new QAction(tr("Clear"), this); clearAction->setShortcut(Qt::Key_Delete); connect(clearAction, SIGNAL(triggered()), this, SLOT(clear())); aboutSpreadSheet = new QAction(tr("About Spreadsheet"), this); connect(aboutSpreadSheet, SIGNAL(triggered()), this, SLOT(showAbout())); exitAction = new QAction(tr("E&xit"), this); connect(exitAction, SIGNAL(triggered()), qApp, SLOT(quit())); printAction = new QAction(tr("&Print"), this); connect(printAction, SIGNAL(triggered()), this, SLOT(print())); firstSeparator = new QAction(this); firstSeparator->setSeparator(true); secondSeparator = new QAction(this); secondSeparator->setSeparator(true); }
TrayIcon::TrayIcon(QmlView * view, QObject *parent) : QSystemTrayIcon(parent) { this->view = view; QMenu * menu = new QMenu(); menu->addAction((tr("&End of day")), this, SLOT(showScore())); menu->addSeparator(); menu->addAction(tr("&Tick"), this, SLOT(showTick())); menu->addAction(tr("&Manage..."), this, SLOT(showManage())); menu->addSeparator(); menu->addAction(tr("&About"), this, SLOT(showAbout())); menu->addAction(tr("About &Qt"), this, SLOT(showAboutQt())); menu->addAction(tr("Exit"), this, SLOT(exitApp())); setContextMenu(menu); this->setIcon(QIcon(":/Gupaa.png")); }
AboutDialog::AboutDialog(QWidget* parent) : QDialog(parent), ui(new Ui::AboutDialog) { ui->setupUi(this); #ifdef Q_WS_WIN if (QtWin::isCompositionEnabled()) { QtWin::extendFrameIntoClientArea(this); ui->verticalLayout->setContentsMargins(0, 0, 0, 0); } #endif connect(ui->buttonBox, SIGNAL(clicked(QAbstractButton*)), this, SLOT(close())); connect(ui->authorsButton, SIGNAL(clicked()), this, SLOT(buttonClicked())); showAbout(); }
void DhcpcdQt::createActions() { preferencesAction = new QAction(tr("&Preferences"), this); preferencesAction->setIcon(QIcon::fromTheme("preferences-system-network")); preferencesAction->setEnabled(false); connect(preferencesAction, SIGNAL(triggered()), this, SLOT(showPreferences())); aboutAction = new QAction(tr("&About"), this); aboutAction->setIcon(QIcon::fromTheme("help-about")); connect(aboutAction, SIGNAL(triggered()), this, SLOT(showAbout())); quitAction = new QAction(tr("&Quit"), this); quitAction->setIcon(QIcon::fromTheme("application-exit")); connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit())); }
bool ParamConverter::initMenuBar() { mainMenuBar = menuBar(); //edit menu editMenu = new QMenu("Edit"); copyAction = new QAction("Copy", this); copyAction->setShortcut(QKeySequence::Copy); connect(copyAction, SIGNAL(triggered()), this, SLOT(editCopy())); cutAction = new QAction("Cut", this); cutAction->setShortcut(QKeySequence::Cut); connect(cutAction, SIGNAL(triggered()), this, SLOT(editCut())); pasteAction = new QAction("Paste", this); pasteAction->setShortcut(QKeySequence::Paste); connect(pasteAction, SIGNAL(triggered()), this, SLOT(editPaste())); convertAction = new QAction("Convert", this); connect(convertAction, SIGNAL(triggered()), this, SLOT(editConvert())); editMenu->addAction(copyAction); editMenu->addAction(cutAction); editMenu->addAction(pasteAction); editMenu->addSeparator(); editMenu->addAction(convertAction); helpMenu = new QMenu("Help"); aboutAction = new QAction("About", this); connect(aboutAction, SIGNAL(triggered()), this, SLOT(showAbout())); aboutQtAction = new QAction("About Qt", this); connect(aboutQtAction, SIGNAL(triggered()), this, SLOT(showAboutQt())); helpMenu->addAction(aboutAction); helpMenu->addAction(aboutQtAction); mainMenuBar->addMenu(editMenu); mainMenuBar->addMenu(helpMenu); return true; }
MainWindow::MainWindow( QWidget *parent ) : QWebView( parent ) , menu( 0 ) { setWindowFlags( Qt::Window|Qt::CustomizeWindowHint|Qt::WindowMinimizeButtonHint|Qt::WindowCloseButtonHint ); page()->mainFrame()->setScrollBarPolicy( Qt::Horizontal, Qt::ScrollBarAlwaysOff ); page()->mainFrame()->setScrollBarPolicy( Qt::Vertical, Qt::ScrollBarAlwaysOff ); setContextMenuPolicy(Qt::PreventContextMenu); setFixedSize( 585, 535 ); appTranslator = new QTranslator( this ); qtTranslator = new QTranslator( this ); commonTranslator = new QTranslator( this ); qApp->installTranslator( appTranslator ); qApp->installTranslator( qtTranslator ); qApp->installTranslator( commonTranslator ); m_jsExtender = new JsExtender( this ); #if defined(Q_OS_MAC) bar = new QMenuBar; menu = bar->addMenu( tr("&File") ); pref = menu->addAction( tr("Settings"), m_jsExtender, SLOT(showSettings()) ); about = menu->addAction( tr("Info"), m_jsExtender, SLOT(showAbout()) ); close = menu->addAction( tr("Close"), qApp, SLOT(quit()) ); pref->setMenuRole( QAction::PreferencesRole ); about->setMenuRole( QAction::AboutRole ); close->setShortcut( Qt::CTRL + Qt::Key_W ); #endif jsEsteidCard = new JsEsteidCard( this ); jsCardManager = new JsCardManager( jsEsteidCard ); connect(jsCardManager, SIGNAL(cardEvent(QString, int)), m_jsExtender, SLOT(jsCall(QString, int))); connect(jsCardManager, SIGNAL(cardError(QString, QString)), m_jsExtender, SLOT(jsCall(QString, QString))); connect(jsEsteidCard, SIGNAL(cardError(QString, QString)), m_jsExtender, SLOT(jsCall(QString, QString))); m_jsExtender->registerObject("esteidData", jsEsteidCard); m_jsExtender->registerObject("cardManager", jsCardManager); load(QUrl("qrc:/html/index.html")); }
void WidgetMain::createConnections() { connect(ui->actionConfigSave, SIGNAL(triggered()), this, SLOT(saveConfig()), Qt::DirectConnection); connect(ui->actionConfigSaveAs, SIGNAL(triggered()), this, SLOT(saveConfigAs()), Qt::DirectConnection); connect(ui->actionConfigOpen, SIGNAL(triggered()), this, SLOT(openConfig()), Qt::DirectConnection); connect(ui->actionQuit, SIGNAL(triggered()), this, SLOT(close()), Qt::DirectConnection); connect(ui->actionAbout, SIGNAL(triggered()), this, SLOT(showAbout()), Qt::DirectConnection); connect(ui->actionAboutQt, SIGNAL(triggered()), qApp, SLOT(aboutQt()), Qt::DirectConnection); connect(d_hponic.data(), SIGNAL(transmissionStatusChanged(Transmission::Status)), this, SLOT(onTransmissionStatusChanged(Transmission::Status)), Qt::DirectConnection); connect(d_hponic.data(), SIGNAL(transmissionCommandSend(Command::Result)), this, SLOT(onTransmissionCommandSend(Command::Result)), Qt::DirectConnection); connect(d_hponic.data(), SIGNAL(exportStarted()), this, SLOT(onExportStarted()), Qt::DirectConnection); connect(d_hponic.data(), SIGNAL(exportStopped()), this, SLOT(onExportStopped()), Qt::DirectConnection); connect(d_hponic.data(), SIGNAL(exportProgress(int,int)), this, SLOT(onExportProgress(int,int)), Qt::DirectConnection); }
void WFrame::manageConnections() { QObject::connect(c,SIGNAL(exitProgram()),this,SLOT(onExit())); QObject::connect(c,SIGNAL(FileLoadedSignal(int)),this,SLOT(FileLoaded(int))); QObject::connect(c,SIGNAL(closeMap()),this,SLOT(onCloseMap())); QObject::connect(this,SIGNAL(closeMapButtonClicked()),c,SLOT(closeMapClicked())); QObject::connect(c,SIGNAL(loadMapSignal()),this,SLOT(loadMap())); QObject::connect(c,SIGNAL(noNodesSignal()),this,SLOT(errorNodes())); QObject::connect(c,SIGNAL(noOSMSignal()),this,SLOT(errorOSM())); QObject::connect(c,SIGNAL(multipleDropSignal()),this,SLOT(multipleDrop())); //ACTION CONNECTS QObject::connect(open,SIGNAL(triggered()),this,SLOT(getFile())); QObject::connect(exit,SIGNAL(triggered()),c,SLOT(exitClicked())); QObject::connect(closeFile,SIGNAL(triggered()),this,SLOT(checkMap())); QObject::connect(about,SIGNAL(triggered()),this,SLOT(showAbout())); QObject::connect(links,SIGNAL(triggered()),this,SLOT(showLinks())); }