AcpiWidget::AcpiWidget (QWidget* parent) :SkLabel (parent) { // setAutoFillBackground (true); timer = new QTimer (this); // 10 second period timer->start (10000); connect (timer, SIGNAL(timeout()), this, SLOT (slotTimer())); // show widget immediatly (cannot call this directly from the constructor) QTimer::singleShot (0, this, SLOT (slotTimer ())); }
BaseCommunicationStarter::StartResult BaseCommunicationStarter::start() { if (state() == Running) { d->errorString = QLatin1String("Internal error, attempt to re-start BaseCommunicationStarter.\n"); return StartError; } // Before we instantiate timers, and such, try to open the device, // which should succeed if another listener is already running in // 'Watch' mode if (d->trkDevice->open(d->device , &(d->errorString))) return ConnectionSucceeded; // Pull up resources for next attempt d->n = 0; if (!initializeStartupResources(&(d->errorString))) return StartError; // Start timer if (!d->timer) { d->timer = new QTimer; connect(d->timer, SIGNAL(timeout()), this, SLOT(slotTimer())); } d->timer->setInterval(d->intervalMS); d->timer->setSingleShot(false); d->timer->start(); d->state = Running; return Started; }
FilmGrainTool::FilmGrainTool(QObject* const parent) : EditorToolThreaded(parent), d(new Private) { setObjectName("filmgrain"); setToolName(i18n("Film Grain")); setToolIcon(SmallIcon("filmgrain")); setInitPreview(true); d->previewWidget = new ImageRegionWidget; setToolView(d->previewWidget); setPreviewModeMask(PreviewToolBar::AllPreviewModes); // ------------------------------------------------------------- d->gboxSettings = new EditorToolSettings; d->gboxSettings->setButtons(EditorToolSettings::Default| EditorToolSettings::Ok| EditorToolSettings::Cancel| EditorToolSettings::Try); d->settingsView = new FilmGrainSettings(d->gboxSettings->plainPage()); setToolSettings(d->gboxSettings); // ------------------------------------------------------------- connect(d->settingsView, SIGNAL(signalSettingsChanged()), this, SLOT(slotTimer())); }
void AcpiWidget::changeEvent (QEvent *event) { if (event->type () == QEvent::LanguageChange) { slotTimer (); } else SkLabel::changeEvent (event); }
instances_dlg::instances_dlg(QWidget * parent) : QDialog(parent) { debugQt("instances_dlg::instances_dlg()"); this->setAttribute(Qt::WA_DeleteOnClose); compteur_objet++; this->setWindowTitle("view instances"); this->setGeometry(QRect(330, 120, 112, 68)); layoutV = new QVBoxLayout(this); appendObject(&instances_dlg::compteur_objet,"instances_dlg"); // this this->setLayout(layoutV); timer = new QTimer (this); connect(timer, SIGNAL(timeout()), this, SLOT(slotTimer())); timer->start(1500); slotTimer(); }
void KardView::slotDisconnect() { kDebug() << "in slot disconnect" << endl; for (int i=0; i<n; i++) { for (int j=0; j<m; j++) { QObject::disconnect (k[i][j], SIGNAL(clicked()),k[i][j], SLOT(slotHide())); QObject::disconnect (k[i][j], SIGNAL(clicked()), this, SLOT(slotTimer())); } } }
void EditorTool::slotInit() { readSettings(); // Unlock signals from preview and settings widgets when init is done. d->view->blockSignals(false); d->settings->blockSignals(false); if (d->initPreview) slotTimer(); }
KMMainView::KMMainView(QWidget *parent, const char *name, KActionCollection *coll) : QWidget(parent, name) { m_current = 0; m_first = true; // create widgets m_printerview = new KMPrinterView(this, "PrinterView"); m_printerpages = new KMPages(this, "PrinterPages"); m_pop = new QPopupMenu(this); m_toolbar = new KToolBar(this, "ToolBar"); m_toolbar->setMovingEnabled(false); m_plugin = new PluginComboBox(this, "Plugin"); /* m_menubar = new KMenuBar( this ); static_cast<KMenuBar*>( m_menubar )->setTopLevelMenu( false ); */ m_menubar = new KToolBar(this, "MenuBar", false, false); m_menubar->setIconText(KToolBar::IconTextRight); m_menubar->setMovingEnabled(false); // layout QVBoxLayout *m_layout = new QVBoxLayout(this, 0, 0); m_layout->addWidget(m_toolbar); m_layout->addWidget(m_menubar); m_boxlayout = new QBoxLayout(QBoxLayout::TopToBottom, 0, 0); m_layout->addLayout(m_boxlayout); m_boxlayout->addWidget(m_printerview); m_boxlayout->addWidget(m_printerpages); m_layout->addSpacing(5); m_layout->addWidget(m_plugin, 0); // connections connect(KMTimer::self(), SIGNAL(timeout()), SLOT(slotTimer())); connect(m_printerview, SIGNAL(printerSelected(const QString &)), SLOT(slotPrinterSelected(const QString &))); connect(m_printerview, SIGNAL(rightButtonClicked(const QString &, const QPoint &)), SLOT(slotRightButtonClicked(const QString &, const QPoint &))); connect(m_pop, SIGNAL(aboutToShow()), KMTimer::self(), SLOT(hold())); connect(m_pop, SIGNAL(aboutToHide()), KMTimer::self(), SLOT(release())); connect(m_manager, SIGNAL(updatePossible(bool)), SLOT(slotUpdatePossible(bool))); // actions if(coll) m_actions = coll; else m_actions = new KActionCollection(this); initActions(); // first update restoreSettings(); loadParameters(); // delay first update until KMManager is ready reset(i18n("Initializing manager..."), true, true); }
void CGalcon::connectSendersToTakers() { connect(m_gui, SIGNAL(SendView(Message::CMessageAddViewPtr)), m_game, SLOT(AddView(Message::CMessageAddViewPtr))); connect(m_game, SIGNAL(SendStartGame(uint,uint)), m_gui, SLOT(TakeFieldSize(uint,uint))); connect(m_game, SIGNAL(SendError(Message::CMessageInformationPtr)), m_gui, SLOT(TakeInInformation(Message::CMessageInformationPtr))); connect(m_game, SIGNAL(SendFinishGame(Message::CMessageFinishGamePtr)), m_gui, SLOT(TakeFinishGame(Message::CMessageFinishGamePtr))); connect(m_game, SIGNAL(signalTimer()), m_game, SLOT(slotTimer())); connect(m_gui, SIGNAL(signalDisconnect()), this, SLOT(slotDisconnect())); connect(m_gui, SIGNAL(SendClientToServer(Message::CMessageConnectToServerPtr)), m_manager, SLOT(TakeServerConnect(Message::CMessageConnectToServerPtr))); connect(m_gui, SIGNAL(SendClientToSingleGame(Message::CMessageConnectToSingleGamePtr)), m_singleGame, SLOT(TakeServerConnect(Message::CMessageConnectToSingleGamePtr)), Qt::QueuedConnection); connect(m_gui, SIGNAL(signalPause()), m_game, SLOT(SlotPause())); connect(m_gui, SIGNAL(signalPause()), m_singleGame, SLOT(TakePause())); connect(m_gui, SIGNAL(signalExit()), m_game, SLOT(SlotExitGame())); connect(m_gui, SIGNAL(signalChoiceNetworkGame()), this, SLOT(slotChoiceNetworkGame())); connect(m_gui, SIGNAL(signalChoiceSingleGame()), this, SLOT(slotChoiceSingleGame())); connect(m_manager, SIGNAL(SendConfirmConnect(Message::CMessageConfirmationConnectToServerPtr)), m_gui, SLOT(TakeConfirmConnectToServer(Message::CMessageConfirmationConnectToServerPtr))); connect(m_manager, SIGNAL(SendError(Message::CMessageErrorPtr)), m_gui, SLOT(TakeError(Message::CMessageErrorPtr))); connect(m_manager, SIGNAL(SendFinishGame(Message::CMessageFinishGamePtr)), m_game, SLOT(SlotFinishGame(Message::CMessageFinishGamePtr))); connect(m_manager, SIGNAL(SendStateMap(Message::CMessageStateMapPtr)), m_game, SLOT(SlotStateMap(Message::CMessageStateMapPtr))); connect(m_manager, SIGNAL(SendStartGame(Message::CMessageStartMapGamePtr)), m_game, SLOT(SlotStartData(Message::CMessageStartMapGamePtr))); connect(m_manager, SIGNAL(SendTimeToStart(Message::CMessageTimeToStartGamePtr)), m_gui, SLOT(TakeTimeStartToGame(Message::CMessageTimeToStartGamePtr))); connect(m_manager, SIGNAL(SendInInformation(Message::CMessageInformationPtr)), m_gui, SLOT(TakeInInformation(Message::CMessageInformationPtr))); connect(m_singleGame, SIGNAL(SendConfirmConnect(Message::CMessageConfirmationConnectToServerPtr)), m_gui, SLOT(TakeConfirmConnectToServer(Message::CMessageConfirmationConnectToServerPtr))); connect(m_singleGame, SIGNAL(SendError(Message::CMessageErrorPtr)), m_gui, SLOT(TakeError(Message::CMessageErrorPtr))); connect(m_singleGame, SIGNAL(SendFinishGame(Message::CMessageFinishGamePtr)), m_game, SLOT(SlotFinishGame(Message::CMessageFinishGamePtr))); connect(m_singleGame, SIGNAL(SendStateMap(Message::CMessageStateMapPtr)), m_game, SLOT(SlotStateMap(Message::CMessageStateMapPtr))); connect(m_singleGame, SIGNAL(SendStartGame(Message::CMessageStartMapGamePtr)), m_game, SLOT(SlotStartData(Message::CMessageStartMapGamePtr))); connect(m_singleGame, SIGNAL(SendTimeToStart(Message::CMessageTimeToStartGamePtr)), m_gui, SLOT(TakeTimeStartToGame(Message::CMessageTimeToStartGamePtr))); connect(m_singleGame, SIGNAL(SendInInformation(Message::CMessageInformationPtr)), m_gui, SLOT(TakeInInformation(Message::CMessageInformationPtr))); }
void LensAutoFixTool::readSettings() { d->gboxSettings->blockSignals(true); KSharedConfig::Ptr config = KSharedConfig::openConfig(); KConfigGroup group = config->group(d->configGroupName); d->showGrid->setChecked(group.readEntry(d->configShowGrid, false)); d->cameraSelector->readSettings(group); d->settingsView->readSettings(group); d->gboxSettings->blockSignals(false); slotTimer(); }
void WhiteBalanceTool::slotAutoAdjustExposure() { kapp->activeWindow()->setCursor(Qt::WaitCursor); ImageIface iface; DImg* const img = iface.original(); WBContainer settings = d->settingsView->settings(); WBFilter::autoExposureAdjustement(img, settings.black, settings.expositionMain); d->settingsView->setSettings(settings); kapp->activeWindow()->unsetCursor(); slotTimer(); }
/****************************************************************************** * Connect to the timer. The timer is started if necessary. */ void SynchTimer::connecT(QObject* receiver, const char* member) { Connection connection(receiver, member); if (mConnections.find(connection) != mConnections.end()) return; // the slot is already connected, so ignore request connect(mTimer, SIGNAL(timeout()), receiver, member); mConnections.append(connection); if (!mTimer->isActive()) { connect(mTimer, SIGNAL(timeout()), this, SLOT(slotTimer())); start(); } }
WhiteBalanceTool::WhiteBalanceTool(QObject* const parent) : EditorToolThreaded(parent), d(new Private) { setObjectName("whitebalance"); setToolName(i18n("White Balance")); setToolIcon(SmallIcon("whitebalance")); setInitPreview(true); // ------------------------------------------------------------- d->previewWidget = new ImageRegionWidget; setToolView(d->previewWidget); setPreviewModeMask(PreviewToolBar::AllPreviewModes); // ------------------------------------------------------------- d->gboxSettings = new EditorToolSettings; d->gboxSettings->setTools(EditorToolSettings::Histogram); d->gboxSettings->setHistogramType(LRGBC); d->gboxSettings->setButtons(EditorToolSettings::Default| EditorToolSettings::Load| EditorToolSettings::SaveAs| EditorToolSettings::Ok| EditorToolSettings::Cancel); // ------------------------------------------------------------- d->settingsView = new WBSettings(d->gboxSettings->plainPage()); setToolSettings(d->gboxSettings); // ------------------------------------------------------------- connect(d->settingsView, SIGNAL(signalSettingsChanged()), this, SLOT(slotTimer())); connect(d->settingsView, SIGNAL(signalAutoAdjustExposure()), this, SLOT(slotAutoAdjustExposure())); connect(d->settingsView, SIGNAL(signalPickerColorButtonActived()), this, SLOT(slotPickerColorButtonActived())); connect(d->previewWidget, SIGNAL(signalCapturedPointFromOriginal(Digikam::DColor,QPoint)), this, SLOT(slotColorSelectedFromOriginal(Digikam::DColor))); /* connect(d->previewWidget, SIGNAL(spotPositionChangedFromTarget(Digikam::DColor,QPoint)), this, SLOT(slotColorSelectedFromTarget(Digikam::DColor))); */ }
void CCamThreadEml::run() { m_timer = new QTimer(); m_timer->setInterval( m_interval ); m_timer->setSingleShot( false ); // Start beforehand. connect( m_timer, SIGNAL(timeout()), this, SLOT(slotTimer()) ); m_timer->start(); m_timer->moveToThread( QApplication::instance()->thread() ); //start(); // Events loop. this->exec(); // Finalization. m_timer->moveToThread( this ); m_timer->deleteLater(); }
void EditorToolThreaded::slotInit() { EditorTool::slotInit(); QWidget* const view = toolView(); if (dynamic_cast<ImageGuideWidget*>(view)) { connect(view, SIGNAL(signalResized()), this, SLOT(slotResized())); } if (dynamic_cast<ImageRegionWidget*>(view)) { connect(view, SIGNAL(signalOriginalClipFocusChanged()), this, SLOT(slotTimer())); } }
//////////////////////////////////////////////////////////// /// \brief ? /// /// \param ? /// \param ? //////////////////////////////////////////////////////////// UI::UI() : engine(time(0)), randomColor(1,3), imageCircle("/usr/local/images/circle.png"), imageTriangle("/usr/local/images/triangle.png"), imageCruciform("/usr/local/images/cruciform.png"), nullPixmap("/usr/local/images/question.png") { //Start ROS std::map<std::string, std::string> args; //Start node nh = new ros::NodeHandle; //sub = nh->subscribe("/odom", 1, &UI::odomCallBack, this); //Setup QT widget.setupUi(this); widget.label_ScanCode->setAlignment(Qt::AlignCenter); widget.label_FindBreak->setAlignment(Qt::AlignCenter); widget.label_CoralSurvey->setAlignment(Qt::AlignCenter); this->setStyleSheet("background-color: gray"); QPalette white(palette()); white.setColor(QPalette::Background, Qt::white); widget.color1->setStyleSheet("background-color: white"); widget.color2->setStyleSheet("background-color: white"); widget.color3->setStyleSheet("background-color: white"); widget.frameCoral->setStyleSheet("background-color: white"); widget.frameBreak->setStyleSheet("background-color: white"); widget.frameCode->setStyleSheet("background-color: white"); timer = new QTimer(); QObject::connect(timer,SIGNAL(timeout()),this,SLOT(slotTimer())); timer->start(1000); widget.statusbar->setStyleSheet("font: bold 18px"); widget.statusbar->showMessage(tr("ROS is alive...")); widget.graphics_Left->setPixmap(nullPixmap.scaled(125,125)); widget.graphics_Right->setPixmap(nullPixmap.scaled(125,125)); }
void WhiteBalanceTool::slotColorSelectedFromOriginal(const DColor& color) { if ( d->settingsView->pickTemperatureIsOn() ) { WBContainer settings = d->settingsView->settings(); DColor dc = color; QColor tc = dc.getQColor(); WBFilter::autoWBAdjustementFromColor(tc, settings.temperature, settings.green); d->settingsView->setSettings(settings); d->settingsView->setOnPickTemperature(false); } else { return; } d->previewWidget->setCapturePointMode(false); slotTimer(); }
void FVAnimation::updateAttributes( ) { QStringList argv; argv.append( QString("setTime") ); argv.append( getAttrValue( tr("Current Time:") ) ); manager->sendMessage( argv, this, true ); update(); int speed = 0; if (tmr != 0) { delete tmr; tmr = 0; } QString s = getAttrValue( tr("Play Speed:") ); if (s == tr("Turtle")) speed = 3000; if (s == tr("Slow")) speed = 1000; if (s == tr("Normal")) speed = 500; if (s == tr("Fast")) speed = 250; if (s == tr("Cheetah")) speed = 100; if (speed > 0) { tmr = new QTimer(); connect( tmr,SIGNAL(timeout()), this, SLOT( slotTimer() ) ); tmr->start( speed ); } if (speed > 0) { acPlay->setEnabled( false ); acPause->setEnabled( true ); acStop->setEnabled( true ); } else { acPlay->setEnabled( true ); acPause->setEnabled( false ); acStop->setEnabled( false ); } }
TClockForm::TClockForm(QWidget *parent, Qt::WFlags f) : QWidget(parent, f) { ui.setupUi(this); ui.gpsTime->setSmallDecimalPoint(true); ui.gpsTime->display("--.--.--"); ui.systemTime->setSmallDecimalPoint(true); ui.systemTime->display("--.--.--"); ui.sysTZ->setText("System: " + formatTimeZone(QTimeZone::current())); _timer.setInterval(1000); _timer.start(); ui.setTZ->setDisabled(true); ui.sync->setDisabled(true); connect(ui.sync, SIGNAL(clicked(bool)), this, SLOT(slotSync(bool))); connect(ui.setTZ, SIGNAL(clicked(bool)), this, SLOT(slotSetTZ(bool))); connect(&_timer, SIGNAL(timeout()), this, SLOT(slotTimer())); }
BCGTool::BCGTool(QObject* const parent) : EditorToolThreaded(parent), d(new Private) { setObjectName("bcgadjust"); setToolName(i18n("Brightness / Contrast / Gamma")); setToolVersion(1); setToolIcon(SmallIcon("contrast")); setToolHelp("bcgadjusttool.anchor"); setToolCategory(FilterAction::ReproducibleFilter); setInitPreview(true); d->previewWidget = new ImageRegionWidget; setToolView(d->previewWidget); setPreviewModeMask(PreviewToolBar::AllPreviewModes); // ------------------------------------------------------------- d->gboxSettings = new EditorToolSettings; d->gboxSettings->setTools(EditorToolSettings::Histogram); d->gboxSettings->setHistogramType(LRGBC); d->gboxSettings->setButtons(EditorToolSettings::Default| EditorToolSettings::Ok| EditorToolSettings::Cancel); // EditorToolSettings::Try); // ------------------------------------------------------------- d->settingsView = new BCGSettings(d->gboxSettings->plainPage()); setToolSettings(d->gboxSettings); // ------------------------------------------------------------- connect(d->settingsView, SIGNAL(signalSettingsChanged()), this, SLOT(slotTimer())); }