//virtual void PixButton2State::setupFSM() { m_p_buttonFSM = new QStateMachine(this); m_p_buttonFSM->setObjectName("fsm"); m_p_stateNormal = createState("normal",m_p_buttonFSM); m_p_stateActive = createState("active",m_p_buttonFSM); // ------------------- STATE: normal ----------------------------------- // normal PROPERTIES m_p_stateNormal->assignProperty(this,"stateActive", false); // normal TRANSITIONS m_p_stateNormal->addTransition(this,SIGNAL(signalFSMActivate()),m_p_stateActive); // normal SIDE-EFFECTS // ------------------- STATE: active ------------------------------------ // active PROPERTIES m_p_stateActive->assignProperty(this,"stateActive", true); // active TRANSITIONS QSignalTransition * transition = m_p_stateActive->addTransition(this, SIGNAL(signalFSMDeactivate()),m_p_stateNormal); m_p_stateActive->addTransition(this, SIGNAL(signalActivated()),m_p_stateNormal); m_p_stateActive->addTransition(this, SIGNAL(signalCancel()),m_p_stateNormal); // active SIDE-EFFECTS connect(transition,SIGNAL(triggered()),this,SIGNAL(signalActivated())); /// <---- this one alerts the clients to the action!! m_p_buttonFSM->setInitialState(m_p_stateNormal); }
void StatusBarItemGroup::activate() { m_active = true; if(!m_overlayAnimPtr.isNull()) { m_overlayAnimPtr->stop(); delete m_overlayAnimPtr; } m_overlayAnimPtr = new QPropertyAnimation(); m_overlayAnimPtr->setPropertyName("overlayOpacity"); m_overlayAnimPtr->setEasingCurve(AS_CURVE(statusBarMenuFadeCurve)); m_overlayAnimPtr->setTargetObject(this); m_overlayAnimPtr->setDuration(AS(statusBarMenuFadeDuration)); m_overlayAnimPtr->setEndValue(MENU_OVERLAY_OPACITY); connect(m_overlayAnimPtr, SIGNAL(valueChanged(const QVariant&)), this, SLOT(slotOverlayAnimValueChanged(const QVariant&))); if(m_menuObj) m_menuObj->setVisible(true); if(m_menuObj) m_menuObj->setOpacity(0.0); m_overlayAnimPtr->start(QAbstractAnimation::DeleteWhenStopped); update(); Q_EMIT signalActivated(this); }
//virtual bool PixButton::tapGesture(QTapGesture *tapEvent) { if (!m_trackingTouch) { return true; } Q_EMIT signalContact(); Q_EMIT signalActivated(); return true; }
void SpeechClient::textRemoved(const QString &appId, int jobNum, int state ) { if ( state == KSpeech::jsFinished || state == KSpeech::jsDeleted ) if (d->pendingJobs.contains(jobNum)) { d->pendingJobs.removeAll(jobNum); if (d->pendingJobs.isEmpty()) { emit signalJobsDone(); emit signalActivated(false); } } }
void SpeechClient::slotAbortJobs() { if (!d->pendingJobs.isEmpty()) { for (QList<uint>::ConstIterator it = d->pendingJobs.constBegin(); it != d->pendingJobs.constEnd(); ++it) { //removeText(*it); } d->pendingJobs.clear(); emit signalJobsDone(); emit signalActivated(false); } }