1

I have a QToolButton with a popup menu on a toolbar. Popup menu has a number of checkable actions, and it looks like this:

enter image description here

Problem is - popup menu closes every time I check/uncheck the action, but I want it to stay opened so I can check a number of actions with no need to reopen popup menu. How can I achieve this?

Edited:

Found this workaround - Prevent a QMenu from closing when one of its QAction is triggered

It looks a bit different but still ok for me:

enter image description here

Community
  • 1
  • 1
Bearded Beaver
  • 646
  • 4
  • 21
  • You need to install an event filter and do custom handling. I think you need to do something similar: http://stackoverflow.com/questions/22813494/qcombobox-with-checkboxes – Dmitry Sazonov Nov 13 '16 at 13:06
  • @DmitrySazonov I've tried eventFilter but I couldn't find valid event type. And I also can't find `view()` or `viewport()` in `QToolButton` – Bearded Beaver Nov 13 '16 at 13:49
  • I don't see your attempts or any code sample. And I don't understand, why you are looking `view`or `viewport` in `QToolButton`? – Dmitry Sazonov Nov 13 '16 at 14:54
  • May I suggest that you post your solution as an answer and accept it for yourself? It will make easier to everybody to find it. – cbuchart Apr 06 '17 at 10:00
  • Won't it be considered as a duplicate? – Bearded Beaver Apr 06 '17 at 10:26

0 Answers0