TagImgDlg::TagImgDlg(QWidget *parent, const char *name) : QWidget(parent,name), TagWidget(parent,name) { img = 0L; setCaption(name); initDialog(); buttonImgSource ->setPixmap( UserIcon("open") ); buttonRecalcImgSize ->setPixmap( UserIcon("repaint") ); comboAlign ->insertStrList(align); connect( buttonImgSource, SIGNAL(clicked()), this, SLOT(slotFileSelect()) ); connect( buttonRecalcImgSize, SIGNAL(clicked()), this, SLOT(slotRecalcImgSize()) ); connect( lineImgSource, SIGNAL( returnPressed()), this, SLOT(slotLineFileSelect()) ); }
void Freecell::initMenuBar() { /////////////////////////////////////////////////////////////////// // MENUBAR /////////////////////////////////////////////////////////////////// // menuBar entry fileMenu #ifdef QTOPIA fileMenu = QSoftMenuBar::menuFor(this); #else fileMenu = menuBar()->addMenu("&File"); #endif fileMenu->addAction("Rotate", this, SLOT(slotFileRotate())); fileMenu->addAction("New Game", this, SLOT(slotFileNew())); fileMenu->addAction("Select Game", this, SLOT(slotFileSelect())); fileMenu->addAction("Statistic", this, SLOT(slotFileStatistic())); fileMenu->addAction("Options", this, SLOT(slotFileOptions())); fileMenu->addAction("Exit", this, SLOT(slotFileQuit())); /////////////////////////////////////////////////////////////////// // menuBar entry protocolMenu protocolMenu = new QMenu(); protocolMenu->addAction("Start Protocol", this, SLOT(slotProtocolStart())); protocolMenu->addAction("Stop Protocol", this, SLOT(slotProtocolStop())); /////////////////////////////////////////////////////////////////// // menuBar entry viewMenu //viewMenu=new QPopupMenu(); //viewMenu->setCheckable(true); //viewMenu->insertItem("Tool&bar", this, SLOT(slotViewToolBar()), 0, ID_VIEW_TOOLBAR); //viewMenu->insertItem("&Statusbar", this, SLOT(slotViewStatusBar()), 0, ID_VIEW_STATUSBAR); //viewMenu->setItemChecked(ID_VIEW_TOOLBAR, true); //viewMenu->setItemChecked(ID_VIEW_STATUSBAR, true); /////////////////////////////////////////////////////////////////// // EDIT YOUR APPLICATION SPECIFIC MENUENTRIES HERE /////////////////////////////////////////////////////////////////// // menuBar entry helpMenu helpMenu = new QMenu(); helpMenu->addAction("About...", this, SLOT(slotHelpAbout())); /////////////////////////////////////////////////////////////////// // MENUBAR CONFIGURATION // set menuBar() the current menuBar // menuBar()->insertItem("&File", fileMenu); // menuBar()->insertItem("&Protocol", protocolMenu); // // menuBar()->insertSeparator(); // menuBar()->insertItem("&Help", helpMenu); /////////////////////////////////////////////////////////////////// // CONNECT THE SUBMENU SLOTS WITH SIGNALS connect(fileMenu, SIGNAL(highlighted(int)), SLOT(statusCallback(int))); connect(protocolMenu, SIGNAL(highlighted(int)), SLOT(statusCallback(int))); connect(helpMenu, SIGNAL(highlighted(int)), SLOT(statusCallback(int))); }