Is it possible to implement something like this?
-
This post is deleted!
-
I guess it is quite simple as tool buttons are made to have an optional menu in Qt. Have a look at the documentation for
QToolButton. It has a funtionsetMenu(QMenu*). I guess this is what you are looking for (I have never used this feature myself, so I am not entirely sure if this is the right function).If you are creating your toolbar from
QActions,QActionalso has asetMenu(QMenu*)function. I would assume it works the same if you add the action to the toolbar. -
Yes, you can create a custom QWidget subclass for this (or maybe even a QMenu subclass).
-
I guess it is quite simple as tool buttons are made to have an optional menu in Qt. Have a look at the documentation for
QToolButton. It has a funtionsetMenu(QMenu*). I guess this is what you are looking for (I have never used this feature myself, so I am not entirely sure if this is the right function).If you are creating your toolbar from
QActions,QActionalso has asetMenu(QMenu*)function. I would assume it works the same if you add the action to the toolbar.