void QAbstractButton::setShortcut(const QKeySequence &key) { Q_D(QAbstractButton); if (d->shortcutId != 0) releaseShortcut(d->shortcutId); d->shortcut = key; d->shortcutId = grabShortcut(key); }
void QLabel::setBuddy(QWidget *buddy) { Q_D(QLabel); d->buddy = buddy; if (d->isTextLabel) { if (d->shortcutId) releaseShortcut(d->shortcutId); d->shortcutId = 0; d->textDirty = true; if (buddy) d->updateShortcut(); // grab new shortcut d->updateLabel(); } }
void QGroupBox::setTitle(const QString &title) { Q_D(QGroupBox); if (d->title == title) // no change return; d->title = title; #ifndef QT_NO_SHORTCUT releaseShortcut(d->shortcutId); d->shortcutId = grabShortcut(QKeySequence::mnemonic(title)); #endif d->calculateFrame(); update(); updateGeometry(); #ifndef QT_NO_ACCESSIBILITY QAccessible::updateAccessibility(this, 0, QAccessible::NameChanged); #endif }