How to make QComboBox appear as a popup and not a ... combo box?
-
wrote on 1 Aug 2019, 23:23 last edited by davecotter 8 Jan 2019, 23:27
-
@davecotter said in How to make QComboBox appear as a popup and not a ... combo box?:
there's no style flag to say "make it look like a popup"
Yes, that's correct :)
In Designer (with Designer only) it's not possible. But you can create a custom Widget with that behavior and promote it to Qt Designer.
@davecotter said in How to make QComboBox appear as a popup and not a ... combo box?:
but there is no popup widget in UI Designer, that i can find?
Your "popup"-Widget from your first picture looks like a QContextMenu-Popup, which is shown (if enabled), when you right-click something.
I would give it a try.
Edit:
Once you've finished the custom widget, you can use it everywhere (as promoted widget, presented by some standard class in Qt Designer).How to create a new plugin for your Designer, is explained here: Build Custom Widget Plugin
Then you dont have to promote it anymore.wrote on 7 Aug 2019, 23:02 last edited by@pl45m4 i think you got the right answer, thanks so much!
-
can we make it look like this on windows?
currently looks like this:
which i don't think looks as pretty
@davecotter said in How to make QComboBox appear as a popup and not a ... combo box?:
which i don't think looks as pretty
But this is how combo boxes look like on Windows. Changing this would let your application go against Windows design.
-
can we make it look like this on windows?
currently looks like this:
which i don't think looks as pretty
wrote on 2 Aug 2019, 07:33 last edited byYou could replace your comboBox with a custom Widget (Button subclass?), which opens some sort of QMenu (e.g. Context Menu). Your items inside are going to be (checkable) QActions then
-
wrote on 2 Aug 2019, 22:38 last edited by davecotter 8 Feb 2019, 22:40
@Pl45m4 i want to be able to use UI Designer in my dialogs to create these widgets. the only available widget is QComboBox, and there's no style flag to say "make it look like a popup". how could i accomplish this?
@jsulm i WANT to use a popup, which is ALSO used on windows and looks much better than a combo box (see my first screen shot). but there is no popup widget in UI Designer, that i can find?
-
@Pl45m4 i want to be able to use UI Designer in my dialogs to create these widgets. the only available widget is QComboBox, and there's no style flag to say "make it look like a popup". how could i accomplish this?
@jsulm i WANT to use a popup, which is ALSO used on windows and looks much better than a combo box (see my first screen shot). but there is no popup widget in UI Designer, that i can find?
wrote on 3 Aug 2019, 00:22 last edited by Pl45m4 8 Mar 2019, 00:53@davecotter said in How to make QComboBox appear as a popup and not a ... combo box?:
there's no style flag to say "make it look like a popup"
Yes, that's correct :)
In Designer (with Designer only) it's not possible. But you can create a custom Widget with that behavior and promote it to Qt Designer.
@davecotter said in How to make QComboBox appear as a popup and not a ... combo box?:
but there is no popup widget in UI Designer, that i can find?
Your "popup"-Widget from your first picture looks like a QContextMenu-Popup, which is shown (if enabled), when you right-click something.
I would give it a try.
Edit:
Once you've finished the custom widget, you can use it everywhere (as promoted widget, presented by some standard class in Qt Designer).How to create a new plugin for your Designer, is explained here: Build Custom Widget Plugin
Then you dont have to promote it anymore. -
@davecotter said in How to make QComboBox appear as a popup and not a ... combo box?:
there's no style flag to say "make it look like a popup"
Yes, that's correct :)
In Designer (with Designer only) it's not possible. But you can create a custom Widget with that behavior and promote it to Qt Designer.
@davecotter said in How to make QComboBox appear as a popup and not a ... combo box?:
but there is no popup widget in UI Designer, that i can find?
Your "popup"-Widget from your first picture looks like a QContextMenu-Popup, which is shown (if enabled), when you right-click something.
I would give it a try.
Edit:
Once you've finished the custom widget, you can use it everywhere (as promoted widget, presented by some standard class in Qt Designer).How to create a new plugin for your Designer, is explained here: Build Custom Widget Plugin
Then you dont have to promote it anymore.wrote on 7 Aug 2019, 23:02 last edited by@pl45m4 i think you got the right answer, thanks so much!
6/6