void RadioButton::mouseClick( MouseEvent &mouseEvent ) { if(mouseEvent.getButton() == MOUSE_BUTTON_LEFT) { nextCheckState(); mouseEvent.consume(); } }
void RadioButton::keyUp( KeyEvent &keyEvent ) { if(!isDoingKeyAction) { return; } isDoingKeyAction = false; if(keyEvent.getKey() == KEY_SPACE || keyEvent.getKey() == KEY_ENTER) { dispatchActionEvent(ActionEvent( this)); modifyRadioButtonState(); nextCheckState(); keyEvent.consume(); } }
/*! Performs a click. All the usual signals associated with a click are emitted as appropriate. If the button is checkable, the state of the button is toggled. This function does nothing if the button is \link setEnabled() disabled. \endlink \sa animateClick() */ void QAbstractButton::click() { if (!isEnabled()) return; Q_D(QAbstractButton); QPointer<QAbstractButton> guard(this); d->down = true; d->emitPressed(); if (guard) { d->down = false; nextCheckState(); if (guard) d->emitReleased(); if (guard) d->emitClicked(); } }
/*!\reimp */ void QAbstractButton::timerEvent(QTimerEvent *e) { Q_D(QAbstractButton); if (e->timerId() == d->repeatTimer.timerId()) { d->repeatTimer.start(d->autoRepeatInterval, this); if (d->down) { QPointer<QAbstractButton> guard(this); nextCheckState(); if (guard) d->emitReleased(); if (guard) d->emitClicked(); if (guard) d->emitPressed(); } } else if (e->timerId() == d->animateTimer.timerId()) { d->animateTimer.stop(); d->click(); } }
void DhQPushButton::DvhnextCheckState() { return nextCheckState(); }