void PiwigoWindow::connectSignals() { connect(d->albumView, SIGNAL(itemSelectionChanged()), this, SLOT(slotAlbumSelected())); connect(d->confButton, SIGNAL(clicked()), this, SLOT(slotSettings())); connect(d->resizeCheckBox, SIGNAL(stateChanged(int)), this, SLOT(slotEnableSpinBox(int))); connect(d->progressDlg, SIGNAL(canceled()), this, SLOT(slotAddPhotoCancel())); connect(d->talker, SIGNAL(signalProgressInfo(QString)), this, SLOT(slotProgressInfo(QString))); connect(d->talker, SIGNAL(signalError(QString)), this, SLOT(slotError(QString))); connect(d->talker, SIGNAL(signalBusy(bool)), this, SLOT(slotBusy(bool))); connect(d->talker, SIGNAL(signalLoginFailed(QString)), this, SLOT(slotLoginFailed(QString))); connect(d->talker, SIGNAL(signalAlbums(QList<PiwigoAlbum>)), this, SLOT(slotAlbums(QList<PiwigoAlbum>))); connect(d->talker, SIGNAL(signalAddPhotoSucceeded()), this, SLOT(slotAddPhotoSucceeded())); connect(d->talker, SIGNAL(signalAddPhotoFailed(QString)), this, SLOT(slotAddPhotoFailed(QString))); }
void CMainWindow::connectSignals() { connect(backend,SIGNAL(sigStatus(CCommand::status_t)), this, SLOT(slotReceivedData(CCommand::status_t))); connect(ui->pushPower, SIGNAL(toggled(bool)), this, SLOT(powerOn(bool))); connect(dbgWin,SIGNAL(sendData(QString&)),this,SLOT(slotSendData(QString&))); //connect(cmd,SIGNAL(sendData(QString&)),this,SLOT(slotSendData(QString&))); connect(ui->volume1, SIGNAL(valueChanged(double)), this,SLOT(slotVolume1(double))); //connect(ui->volume2, SIGNAL(valueChanged(double)), this,SLOT(slotVolume2(double))); connect(ui->knobSquelch,SIGNAL(valueChanged(double)), this, SLOT(slotSquelch(double))); connect(ui->knobIF,SIGNAL(valueChanged(double)), this, SLOT(slotIF(double))); connect(ui->pushNoiseBlanker,SIGNAL(toggled(bool)),this,SLOT(slotNoiseBlanker(bool))); connect(ui->pushAGC,SIGNAL(toggled(bool)),this,SLOT(slotAGC(bool))); connect(ui->pushVSC,SIGNAL(toggled(bool)),this,SLOT(slotVSC(bool))); // Connect filters connect(ui->filterGroup, SIGNAL(buttonClicked(int)), this, SLOT(slotFilter(int))); // Connect Moudlation mode connect(ui->modeGroup,SIGNAL(buttonClicked(int)),this, SLOT(slotModulation(int))); // Frequency connect( display, SIGNAL(frequencyChanged(QString)), this,SLOT(slotFrequency(QString))); connect( myBandScope, SIGNAL(frequencyChanged(QString)), this, SLOT(slotFrequency(QString))); // Set threshold connect(ui->threshold, SIGNAL(valueChanged(int)), backend->getDecoder(), SLOT(slotThreshold(int))); connect(ui->correlationLength,SIGNAL(valueChanged(int)), backend->getDecoder(), SLOT(slotSetCorrelationLength(int))); // Connect Decoder connect(ui->decoderList, SIGNAL(currentIndexChanged(int)), this, SLOT(slotDecoderChange(int))); // Channel change connect(ui->channel, SIGNAL(currentIndexChanged(int)), backend->getDecoder(), SLOT(slotSetChannel(int))); // Connect Scope type connect(ui->cbPlotterType , SIGNAL(currentIndexChanged(int)),this, SLOT(slotScopeChanged(int))); connect(ui->refreshRate, SIGNAL(valueChanged(int)), this, SLOT(slotRefreshRate(int))); connect(ui->cbWindow, SIGNAL(currentIndexChanged(QString)), this, SLOT(slotWindowFunction(QString))); // Band Scope connect(ui->pushBandscope,SIGNAL(clicked(bool)),this,SLOT(slotBandScope(bool))); connect(ui->cbBandwidth, SIGNAL(currentIndexChanged(int)), this, SLOT(slotBandScopeWidth(int))); connect(ui->cbStepsize, SIGNAL(currentIndexChanged(int)), this, SLOT(slotBandScopeStep(int))); // Step size change connect(ui->pushStepUp,SIGNAL(clicked()), this, SLOT(slotStepUp())); connect(ui->pushStepDown,SIGNAL(clicked()), this, SLOT(slotStepDown())); // Connect load file connect(ui->actionLoad, SIGNAL(triggered()), this, SLOT(slotLoadFile())); connect(display, SIGNAL(radioChanged(int)), this, SLOT(slotRadioClicked(int))); connect(ui->actionSettings, SIGNAL(triggered()), this, SLOT(slotSettings())); // Connect spectrum widget connect(backend->getDecoder(),SIGNAL(sigRawSamples(double*,double*,int)),mySpectrum,SLOT(slotRawSamples(double*,double*,int))); // Connect Demodulator to debug windows connect(backend->getDecoder(),SIGNAL(sendData(QString)),this,SLOT(slotDemodulatorData(QString))); }
void KMInstancePage::initActions() { addButton(i18n("New..."), "filenew", SLOT(slotNew())); addButton(i18n("Copy..."), "editcopy", SLOT(slotCopy())); addButton(i18n("Remove"), "edittrash", SLOT(slotRemove())); m_buttons.append(0); addButton(i18n("Set as Default"), "exec", SLOT(slotDefault())); addButton(i18n("Settings"), "configure", SLOT(slotSettings())); m_buttons.append(0); addButton(i18n("Test..."), "fileprint", SLOT(slotTest())); }
KMWDriverTest::KMWDriverTest(QWidget *parent, const char *name) : KMWizardPage(parent, name) { m_ID = KMWizard::DriverTest; m_title = i18n("Printer Test"); m_nextpage = KMWizard::Name; m_needsinitonback = true; m_driver = 0; m_printer = 0; m_manufacturer = new QLabel(this); m_model = new QLabel(this); m_driverinfo = new QLabel(this); m_driverinfo->setTextFormat(Qt::RichText); QLabel *l1 = new QLabel(i18n("<b>Manufacturer:</b>"), this); QLabel *l2 = new QLabel(i18n("<b>Model:</b>"), this); QLabel *l3 = new QLabel(i18n("<b>Description:</b>"), this); m_test = new KPushButton(KGuiItem(i18n("&Test"), "kdeprint_testprinter"), this); m_settings = new KPushButton(KGuiItem(i18n("&Settings"), "configure"), this); QLabel *l0 = new QLabel(this); l0->setText( i18n("<p>Now you can test the printer before finishing installation. " "Use the <b>Settings</b> button to configure the printer driver and " "the <b>Test</b> button to test your configuration. Use the <b>Back</b> " "button to change the driver (your current configuration will be discarded).</p>")); QVBoxLayout *lay1 = new QVBoxLayout(this, 0, 15); QGridLayout *lay2 = new QGridLayout(0, 3, 3, 0, 0); QHBoxLayout *lay3 = new QHBoxLayout(0, 0, 10); lay1->addWidget(l0, 0); lay1->addLayout(lay2, 0); lay1->addLayout(lay3, 0); lay1->addStretch(1); lay2->setColStretch(2, 1); lay2->addColSpacing(1, 10); lay2->addWidget(l1, 0, 0); lay2->addWidget(l2, 1, 0); lay2->addWidget(l3, 2, 0, Qt::AlignLeft | Qt::AlignTop); lay2->addWidget(m_manufacturer, 0, 2); lay2->addWidget(m_model, 1, 2); lay2->addWidget(m_driverinfo, 2, 2); lay3->addWidget(m_test, 0); lay3->addWidget(m_settings, 0); lay3->addStretch(1); connect(m_test, SIGNAL(clicked()), SLOT(slotTest())); connect(m_settings, SIGNAL(clicked()), SLOT(slotSettings())); }
CaptureWgt::CaptureWgt( QWidget * parent ) : QMainWindow( parent ) { pd = new PD(); pd->ui.setupUi( this ); pd->video = 0; pd->imgScale = 1.0; pd->flipX = false; pd->flipY = false; pd->fps = 2.0; pd->imgSize = QSize( 80, 60 ); pd->ui.brightnessDw->setVisible( false ); pd->brightness = new BrightnessWgt( this ); pd->ui.brightnessDw->setWidget( pd->brightness ); connect( pd->brightness, SIGNAL(rangeChanged(const QPointF &)), this, SLOT(slotBrightnessChanged(const QPointF &)) ); connect( pd->ui.brightnessRange, SIGNAL(triggered()), this, SLOT(slotBrightness()) ); connect( pd->ui.resolution, SIGNAL(triggered()), this, SLOT(slotResolution()) ); connect( pd->ui.settings, SIGNAL(triggered()), this, SLOT(slotSettings()) ); Ui_CaptureWgt & ui = pd->ui; connect( ui.capture, SIGNAL(triggered()), this, SLOT(slotCapture()) ); pd->scene = new QGraphicsScene( pd->ui.view ); pd->scene->setBackgroundBrush( QBrush( Qt::gray ) ); pd->ui.view->setScene( pd->scene ); pd->image = new QGraphicsPixmapItem( 0, pd->scene ); pd->image->setPos( 0.0, 0.0 ); pd->lineX1 = new QGraphicsLineItem( pd->image, pd->scene ); pd->lineY1 = new QGraphicsLineItem( pd->image, pd->scene ); pd->lineX2 = new QGraphicsLineItem( pd->image, pd->scene ); pd->lineY2 = new QGraphicsLineItem( pd->image, pd->scene ); //pd->image->setPixmap( QPixmap( ":/images/camera.png" ) ); connect( pd->ui.flipX, SIGNAL(triggered()), this, SLOT(slotFlipX()) ); connect( pd->ui.flipY, SIGNAL(triggered()), this, SLOT(slotFlipY()) ); ui.view->installEventFilter( this ); connect( ui.pixmap, SIGNAL(triggered()), this, SLOT(slotSavePixmap()) ); }
/** Initialize Actions */ void Kiptables::initActions(){ KStdAction::quit(this,SLOT(quitApplication()),actionCollection()); settings=new KAction(i18n("&Settings"),CTRL+Key_S,this,SLOT(slotSettings()),actionCollection(),"conf_settings"); actionHost=new KAction(i18n("Add &Host"),0L,this,SLOT(slotFWAddHost()),actionCollection(),"fw_add_host"); actionHost->setEnabled(false); actionHostModify=new KAction(i18n("Modify H&ost"),0L,this,SLOT(slotFWModifyHost()),actionCollection(),"fw_modify_host"); actionHostModify->setEnabled(false); actionHostDelete=new KAction(i18n("Delete Ho&st"),0L,this,SLOT(slotFWDeleteHost()),actionCollection(),"fw_delete_host"); actionHostDelete->setEnabled(false); actionNetwork=new KAction(i18n("Add &Network"),0L,this,SLOT(slotFWAddNetwork()),actionCollection(),"fw_add_network"); actionNetwork->setEnabled(false); actionNetworkModify=new KAction(i18n("Modify N&etwork"),0L,this,SLOT(slotFWModifyNetwork()),actionCollection(),"fw_modify_network"); actionNetworkDelete=new KAction(i18n("Delete Ne&twork"),0L,this,SLOT(slotFWDeleteNetwork()),actionCollection(),"fw_delete_network"); actionNetworkModify->setEnabled(false); actionNetworkDelete->setEnabled(false); actionTCP=new KAction(i18n("Add &TCP-Port"),0L,this,SLOT(slotFWAddTCPPort()),actionCollection(),"fw_add_tcp_port"); actionTCP->setEnabled(false); actionUDP=new KAction(i18n("Add &UDP-Port"),0L,this,SLOT(slotFWAddUDPPort()),actionCollection(),"fw_add_udp_port"); actionUDP->setEnabled(false); }
void JuffEd::initActions() { CommandStorageInt* st = Juff::Utils::commandStorage(); st->addAction(FILE_NEW, tr("&New"), this, SLOT(slotFileNew())); st->addAction(FILE_OPEN, tr("&Open"), this, SLOT(slotFileOpen())); st->addAction(FILE_SAVE, tr("&Save"), this, SLOT(slotFileSave())); st->addAction(FILE_SAVE_AS, tr("Save as"), this, SLOT(slotFileSaveAs())); st->addAction(FILE_SAVE_ALL, tr("Save all"), this, SLOT(slotFileSaveAll())); st->addAction(FILE_RELOAD, tr("&Reload"), this, SLOT(slotFileReload())); st->addAction(FILE_RENAME, tr("Rename"), this, SLOT(slotFileRename())); st->addAction(FILE_CLOSE, tr("Close"), this, SLOT(slotFileClose())); st->addAction(FILE_CLOSE_ALL, tr("Close All"), this, SLOT(slotFileCloseAll())); st->addAction(FILE_PRINT, tr("&Print"), this, SLOT(slotFilePrint())); st->addAction(FILE_EXIT, tr("Exit"), this, SLOT(slotFileExit())); st->addAction(SESSION_NEW, tr("New session"), this, SLOT(slotSessionNew())); st->addAction(SESSION_OPEN, tr("Open session"), this, SLOT(slotSessionOpen())); st->addAction(SESSION_SAVE, tr("Save session as..."), this, SLOT(slotSessionSaveAs())); st->addAction(EDIT_UNDO, tr("Undo"), this, SLOT(slotEditUndo())); st->addAction(EDIT_REDO, tr("Redo"), this, SLOT(slotEditRedo())); st->addAction(EDIT_CUT, tr("Cut"), this, SLOT(slotEditCut())); st->addAction(EDIT_COPY, tr("Copy"), this, SLOT(slotEditCopy())); st->addAction(EDIT_PASTE, tr("Paste"), this, SLOT(slotEditPaste())); st->addAction(SEARCH_FIND, tr("Find"), this, SLOT(slotFind())); st->addAction(SEARCH_FIND_NEXT, tr("Find next"), this, SLOT(slotFindNext())); st->addAction(SEARCH_FIND_PREV, tr("Find previous"), this, SLOT(slotFindPrev())); st->addAction(SEARCH_REPLACE, tr("Replace"), this, SLOT(slotReplace())); st->addAction(SEARCH_GOTO_LINE, tr("Go to line"), this, SLOT(slotGotoLine())); st->addAction(SEARCH_GOTO_FILE, tr("Go to file"), this, SLOT(slotGotoFile())); st->addAction(VIEW_ZOOM_IN, tr("Zoom In"), this, SLOT(slotZoomIn())); st->addAction(VIEW_ZOOM_OUT, tr("Zoom Out"), this, SLOT(slotZoomOut())); st->addAction(VIEW_ZOOM_100, tr("Zoom 100%"), this, SLOT(slotZoom100())); st->addAction(VIEW_FULLSCREEN, tr("Fullscreen"), this, SLOT(slotFullscreen())); st->addAction(TOOLS_SETTINGS, tr("Settings"), this, SLOT(slotSettings())); st->addAction(HELP_ABOUT, tr("About"), mw_, SLOT(slotAbout())); st->addAction(HELP_ABOUT_QT, tr("About Qt"), mw_, SLOT(slotAboutQt())); }
CMainWindow::CMainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::CMainWindow) ,currentProject("") { ui->setupUi(this); connect(ui->buildNetwork,SIGNAL(clicked()),this,SLOT(slotBuildNetwork())); connect(ui->testNetwork,SIGNAL(clicked()),this,SLOT(slotTestNetwork())); connect(ui->actionNew,SIGNAL(triggered()),this,SLOT(slotNewProject())); connect(ui->actionLoad,SIGNAL(triggered()),this,SLOT(slotLoadProject())); connect(ui->actionClose,SIGNAL(triggered()),this,SLOT(slotCloseProject())); connect(ui->errorLevel,SIGNAL(sliderMoved(int)),this,SLOT(slotErrorLevelChanged(int))); connect(ui->errorPercent,SIGNAL(sliderMoved(int)),this,SLOT(slotErrorPercentChanged(int))); connect(ui->actionSettings,SIGNAL(triggered()),this,SLOT(slotSettings())); ui->buildNetwork->setEnabled(false); ui->testNetwork->setEnabled(false); slotErrorLevelChanged(10); slotErrorPercentChanged(10); network = 0; plotter = 0; }
void PMShell::setupActions( ) { // m_helpMenu = new KHelpMenu( this, PMFactory::aboutData( ), true, // actionCollection( ) ); KStdAction::openNew( this, SLOT( slotFileNew( ) ), actionCollection( ) ); KStdAction::open( this, SLOT( slotFileOpen( ) ), actionCollection( ) ); m_pRecent = KStdAction::openRecent( this, SLOT( slotOpenRecent( const KURL& ) ), actionCollection( ) ); KStdAction::save( this, SLOT( slotFileSave( ) ), actionCollection( ) ); KStdAction::saveAs( this, SLOT( slotFileSaveAs( ) ), actionCollection( ) ); KStdAction::revert( this, SLOT( slotFileRevert( ) ), actionCollection( ) ); KStdAction::print( this, SLOT( slotFilePrint( ) ), actionCollection( ) ); KStdAction::close( this, SLOT( slotFileClose( ) ), actionCollection( ) ); KStdAction::quit( this, SLOT( close( ) ), actionCollection( ) ); m_pPathAction = new KToggleAction( i18n( "Show &Path" ), 0, this, SLOT( slotShowPath( ) ), actionCollection( ), "options_show_path" ); m_pPathAction->setCheckedState(i18n("Hide &Path")); m_pStatusbarAction = KStdAction::showStatusbar( this, SLOT( slotShowStatusbar( ) ), actionCollection( ) ); KStdAction::saveOptions( this, SLOT( saveOptions( ) ), actionCollection( ) ); KStdAction::keyBindings( this, SLOT( slotConfigureKeys( ) ), actionCollection( ) ); KStdAction::configureToolbars( this, SLOT( slotConfigureToolbars( ) ), actionCollection( ) ); KStdAction::preferences( this, SLOT( slotSettings( ) ), actionCollection( ) ); m_pNewTopViewAction = new KAction( i18n( "New Top View" ), 0, this, SLOT( slotNewTopView( ) ), actionCollection( ), "view_new_topview" ); m_pNewBottomViewAction = new KAction( i18n( "New Bottom View" ), 0, this, SLOT( slotNewBottomView( ) ), actionCollection( ), "view_new_bottomview" ); m_pNewLeftViewAction = new KAction( i18n( "New Left View" ), 0, this, SLOT( slotNewLeftView( ) ), actionCollection( ), "view_new_leftview" ); m_pNewRightViewAction = new KAction( i18n( "New Right View" ), 0, this, SLOT( slotNewRightView( ) ), actionCollection( ), "view_new_rightview" ); m_pNewFrontViewAction = new KAction( i18n( "New Front View" ), 0, this, SLOT( slotNewFrontView( ) ), actionCollection( ), "view_new_frontview" ); m_pNewBackViewAction = new KAction( i18n( "New Back View" ), 0, this, SLOT( slotNewBackView( ) ), actionCollection( ), "view_new_back_view" ); m_pNewCameraViewAction = new KAction( i18n( "New Camera View" ), 0, this, SLOT( slotNewCameraView( ) ), actionCollection( ), "view_new_cameraview" ); m_pNewTreeViewAction = new KAction( i18n( "New Object Tree" ), 0, this, SLOT( slotNewTreeView( ) ), actionCollection( ), "view_new_treeview" ); m_pNewDialogViewAction = new KAction( i18n( "New Properties View" ), 0, this, SLOT( slotNewDialogView( ) ), actionCollection( ), "view_new_dialogview" ); #ifdef KPM_WITH_OBJECT_LIBRARY m_pNewLibraryBrowserAction = new KAction( i18n( "New Library Browser" ), 0, this, SLOT( slotNewLibraryBrowserView( ) ), actionCollection( ), "view_new_librarybrowser" ); #endif // Creating the view layouts menu m_pViewLayoutsAction = new KActionMenu( i18n( "View Layouts" ), actionCollection( ), "view_layouts_menu" ); KPopupMenu* menu = m_pViewLayoutsAction->popupMenu( ); connect( menu, SIGNAL( aboutToShow( ) ), SLOT( slotViewsMenuAboutToShow( ) ) ); PMViewLayoutManager::theManager( )->fillPopupMenu( menu ); connect( menu, SIGNAL( activated( int ) ), SLOT( slotSelectedLayout( int ) ) ); m_pSaveViewLayoutAction = new KAction( i18n( "Save View Layout..." ), 0, this, SLOT( slotSaveViewLayout( ) ), actionCollection( ), "save_view_layout" ); }
GalleryWindow::GalleryWindow(Interface* interface, QWidget *parent, Gallery* pGallery) : KDialog(parent), m_interface(interface), mpGallery(pGallery), d(new Private(this)) { setWindowTitle( i18n("Gallery Export") ); setButtons( KDialog::Close | KDialog::User1 | KDialog::Help); setModal(false); // About data. m_about = new KPAboutData(ki18n("Gallery Export"), 0, KAboutData::License_GPL, ki18n("A Kipi plugin to export image collections to a remote Gallery server."), ki18n("(c) 2003-2005, Renchi Raju\n" "(c) 2006-2007, Colin Guthrie\n" "(c) 2006-2009, Gilles Caulier\n" "(c) 2008, Andrea Diamantini\n")); m_about->addAuthor(ki18n("Renchi Raju"), ki18n("Author"), "renchi dot raju at gmail dot com"); m_about->addAuthor(ki18n("Colin Guthrie"), ki18n("Maintainer"), "kde at colin dot guthr dot ie"); m_about->addAuthor(ki18n("Andrea Diamantini"), ki18n("Developer"), "adjam7 at gmail dot com"); m_about->addAuthor(ki18n("Gilles Caulier"), ki18n("Developer"), "caulier dot gilles at gmail dot com"); // help button disconnect(this, SIGNAL(helpClicked()), this, SLOT(slotHelp())); KHelpMenu *helpMenu = new KHelpMenu(this, m_about, false); helpMenu->menu()->removeAction(helpMenu->menu()->actions().first()); QAction *handbook = new QAction(i18n("Handbook"), this); connect(handbook, SIGNAL(triggered(bool)), this, SLOT(slotHelp())); helpMenu->menu()->insertAction(helpMenu->menu()->actions().first(), handbook); button(Help)->setMenu(helpMenu->menu()); // User1 Button : to conf gallery settings KPushButton *confButton = button( User1 ); confButton->setText( i18n("Settings") ); confButton->setIcon( KIcon("configure") ); connect(confButton, SIGNAL(clicked()), this, SLOT(slotSettings()) ); // we need to let m_talker work.. m_talker = new GalleryTalker(d->widget); // setting progressDlg and its numeric hints m_progressDlg = new QProgressDialog(this); m_progressDlg->setModal(true); m_progressDlg->setAutoReset(true); m_progressDlg->setAutoClose(true); m_uploadCount = 0; m_uploadTotal = 0; mpUploadList = new QStringList; // connect functions connectSignals(); // read Settings readSettings(); slotDoLogin(); }
CaptureWgt::CaptureWgt( QWidget * parent ) : QMainWindow( parent ) { pd = new PD(); pd->ui.setupUi( this ); pd->crossFname = "./video.ini"; pd->modifyLaserPos = false; pd->devMenu = 0; pd->resMenu = 0; pd->imgScale = 1.0; pd->drawArrow = false; pd->flipX = false; pd->flipY = false; pd->resolutionAcquired = false; pd->cap = new Capture( this ); pd->ui.brightnessDw->setVisible( false ); pd->brightness = new BrightnessWgt( this ); pd->ui.brightnessDw->setWidget( pd->brightness ); pd->cap->setBrightnessRange( pd->brightness->range() ); connect( pd->brightness, SIGNAL(rangeChanged(const QPointF &)), this, SLOT(slotBrightnessChanged(const QPointF &)) ); connect( pd->ui.brightnessRange, SIGNAL(triggered()), this, SLOT(slotBrightness()) ); Ui_CaptureWgt & ui = pd->ui; connect( ui.capture, SIGNAL(triggered()), this, SLOT(slotCapture()) ); connect( ui.settings, SIGNAL(triggered()), this, SLOT(slotSettings()) ); connect( ui.cross, SIGNAL(triggered()), this, SLOT(slotCrossEmphasis()) ); pd->scene = new QGraphicsScene( pd->ui.view ); pd->scene->setBackgroundBrush( QBrush( Qt::gray ) ); pd->ui.view->setScene( pd->scene ); pd->image = new QGraphicsPixmapItem( 0, pd->scene ); pd->image->setPos( 0.0, 0.0 ); pd->lineX1 = new QGraphicsLineItem( pd->image, pd->scene ); pd->lineY1 = new QGraphicsLineItem( pd->image, pd->scene ); pd->lineX2 = new QGraphicsLineItem( pd->image, pd->scene ); pd->lineY2 = new QGraphicsLineItem( pd->image, pd->scene ); pd->arrow = new QGraphicsPolygonItem( pd->image, pd->scene ); // This is for laser spot position. pd->laserPosImage = new QGraphicsPixmapItem( 0, pd->scene ); pd->laserPosImage->setPixmap( QPixmap( ":/images/laser.png" ) ); pd->laserPosImage->setPos( -pd->laserPosImage->pixmap().width()/2, -pd->laserPosImage->pixmap().height()/2 ); pd->laserPosImage->setVisible( false ); connect( pd->ui.flipX, SIGNAL(triggered()), this, SLOT(slotFlipX()) ); connect( pd->ui.flipY, SIGNAL(triggered()), this, SLOT(slotFlipY()) ); pd->cap = new Capture( this ); listDevices(); connect( pd->cap, SIGNAL(frame(const QImage &)), this, SLOT(slotFrame(const QImage &)) ); ui.view->installEventFilter( this ); pd->inMenu = new QMenu( this ); ui.input->setMenu( pd->inMenu ); QAction * a = new QAction( "Default", this ); a->setCheckable( true ); a->setChecked( true ); pd->inMenu->addAction( a ); pd->inList << a; a = new QAction( "Usb", this ); a->setCheckable( true ); pd->inMenu->addAction( a ); pd->inList << a; a = new QAction( "S-Video", this ); a->setCheckable( true ); pd->inMenu->addAction( a ); pd->inList << a; a = new QAction( "Composite", this ); a->setCheckable( true ); pd->inMenu->addAction( a ); pd->inList << a; for ( int i=0; i<pd->inList.size(); i++ ) { QAction * a = pd->inList[i]; connect( a, SIGNAL(triggered()), this, SLOT(slotInput()) ); } // ƒействи¤ соответствующие фильтрам. pd->filterList << ui.equalizeHist; pd->filterList << ui.fullContrast; pd->filterList << ui.sobel; pd->filterList << ui.median; pd->filterList << ui.timeSmooth; pd->filterList << ui.highPass; pd->filterList << ui.surface; pd->filterList << ui.brightnessRange; for ( int i=0; i<pd->filterList.size(); i++ ) { QAction * a = pd->filterList[i]; connect( a, SIGNAL(triggered()), this, SLOT(slotFilter()) ); } connect( ui.pixmap, SIGNAL(triggered()), this, SLOT(slotPixmap()) ); QToolButton * btn = qobject_cast<QToolButton *>(ui.toolBar->widgetForAction(ui.input)); if ( btn ) btn->setPopupMode(QToolButton::InstantPopup); btn = qobject_cast<QToolButton *>(ui.toolBar->widgetForAction(ui.device)); if ( btn ) btn->setPopupMode(QToolButton::InstantPopup); btn = qobject_cast<QToolButton *>(ui.toolBar->widgetForAction(ui.resolution)); if ( btn ) btn->setPopupMode(QToolButton::InstantPopup); //pd->usbLight = new LightIcon( this ); //ui.toolBar->addWidget( pd->usbLight ); // Laser spot handling. QMenu * m = new QMenu( this ); a = m->addAction( "Set laser spot position" ); connect( a, SIGNAL(triggered()), this, SLOT(slotSetLaserSpot()) ); btn = qobject_cast<QToolButton *>(ui.toolBar->widgetForAction(ui.laser)); btn->setPopupMode( QToolButton::MenuButtonPopup ); ui.laser->setMenu( m ); updateCrossPos(); }