Reputation: 3483
The QSlider documentation says, "A slider accepts focus on Tab and provides both a mouse wheel and a keyboard interface." Is there an easy way to assign a hotkey to it to give it focus similar to how one can assign an Alt key for QCheckboxes?
Upvotes: 1
Views: 681
Reputation: 17956
If you have an associated label, you should be able to use QLabel::setBuddy(QWidget*)
. Otherwise, you could override the keyPressEvent
for the parent form that would have focus and then call QSlider::setFocus(Qt::FocusReason)
.
Upvotes: 2