/*! \property QAbstractButton::checked \brief whether the button is checked Only checkable buttons can be checked. By default, the button is unchecked. \sa checkable */ void QAbstractButton::setChecked(bool checked) { Q_D(QAbstractButton); if (!d->checkable || d->checked == checked) { if (!d->blockRefresh) checkStateSet(); return; } if (!checked && d->queryCheckedButton() == this) { // the checked button of an exclusive or autoexclusive group cannot be unchecked #ifndef QT_NO_BUTTONGROUP if (d->group ? d->group->d_func()->exclusive : d->autoExclusive) return; if (d->group) d->group->d_func()->detectCheckedButton(); #else if (d->autoExclusive) return; #endif } QPointer<QAbstractButton> guard(this); d->checked = checked; if (!d->blockRefresh) checkStateSet(); d->refresh(); if (guard && checked) d->notifyChecked(); if (guard) emit toggled(checked); }
/*! \property QAbstractButton::checked \brief whether the button is checked Only checkable buttons can be checked. By default, the button is unchecked. \sa checkable */ void QAbstractButton::setChecked(bool checked) { Q_D(QAbstractButton); if (!d->checkable || d->checked == checked) { if (!d->blockRefresh) checkStateSet(); return; } if (!checked && d->queryCheckedButton() == this) { // the checked button of an exclusive or autoexclusive group cannot be unchecked #ifndef QT_NO_BUTTONGROUP if (d->group ? d->group->d_func()->exclusive : d->autoExclusive) return; if (d->group) d->group->d_func()->detectCheckedButton(); #else if (d->autoExclusive) return; #endif } QPointer<QAbstractButton> guard(this); d->checked = checked; if (!d->blockRefresh) checkStateSet(); d->refresh(); if (guard && checked) d->notifyChecked(); if (guard) emit toggled(checked); #ifndef QT_NO_ACCESSIBILITY QAccessible::State s; s.checked = true; QAccessibleStateChangeEvent event(this, s); QAccessible::updateAccessibility(&event); #endif }
void DhQPushButton::DvhcheckStateSet() { return checkStateSet(); }