Unsolved How to implement hot key for QComboBox?
-
Buttons are simply enough using the & before the key to use as a hotkey, how do I add a hotkey to a QComboBox?
-
@SPlatten What should the hotkey do?
You can always move the focus to QComboBox via Tab key and then presss enter. -
@jsulm , same thing as it would for any control, trigger the control same as clicking the combo, bring down the list.
-
Hi,
So a shortcut that would call showPopup ?
-
@SGaist , yes, the only reason I posted was because I thought there would already be an implemented method of doing this?
-
@SPlatten said in How to implement hot key for QComboBox?:
I thought there would already be an implemented method of doing this?
Maybe my answer is out off topic, but did you tried out
QShortcut
class?Something like:
auto shortcut = new QShortcut(QKeySequence(QKeySequence(Qt::CTRL + Qt::Key_X), this); connect(shortcut, &QShortcut::activated, [this]() { myCombo->showPopup(); });
-
@KroMignon , no but I will, thank you.