Important: Please read the Qt Code of Conduct -

Custom (Q?)menu including Buttons, ComboBoxes etc.

  • Hello,

    I want to have some kind of pop up menu on button click. However it has some controls like QLineEdit, QSpinBox, QComboBox inside.

    custom menu

    Bottom section is always visible, clicking bottom right QButton shows the menu. To me the whole bottom section looks kinda like QComboBox however the menu is more complicated.

    What is the correct (or easiest?) way to implement such thing? I have never made such thing so idk if I should reimplement QMenu. It seemd from the docs that it is populated by QActions rather than other widgets.

  • You can just create the upper part as a widget and hide() it then connect the button clicked() signal to this widget's show() slot

  • Yep thats what I've started doing half hour ago. I just thought there was some smarter way to create such menu :D

Log in to reply