0

In my application, I don't want to clutter the screen with too many buttons, so I want to add multiple actions to one button. Even thought I could accomplish it through things like double clicking or modifier keys, those solutions are in no way intuitive for the user. I want to have a button that has an additional dropdown menu, which can be used to change the action of the button. To illustrate, here is a rough sketch of what that would look like:

created in paint, the ui designers best friend

Is this possible PyQt5 or PySide6? Thank you for your help.

  • Sounds like you want a [`QComboBox`](https://doc.qt.io/qtforpython/PySide6/QtWidgets/QComboBox.html). – jfaccioni May 24 '22 at 12:30
  • 2
    Use QToolButton with [`setMenu()`](https://doc.qt.io/qt-5/qtoolbutton.html#setMenu), [`setPopupMode(QToolButton.InstantPopup)`](https://doc.qt.io/qt-5/qtoolbutton.html#popupMode-prop) and [`setDefaultAction()`](https://doc.qt.io/qt-5/qtoolbutton.html#setDefaultAction). – musicamante May 24 '22 at 12:34

0 Answers0