QComboBox Dropdown behavior question
-
Folks,
I have a question about the behavior of the QComboBox Dropdown.
I arm using Qt 5.12.5.
I have an app that has a large main window, and many subwindows. Some are always visible, and some are only visible at specific times. This concerns 2 of those windows.
The first is about 4 controls high, and is located in the top left corner of the main window. On the bottom line is a QComboBox used strictly as a display/selector. It is always visible.
The second is about 2 controls high, and is located also in the top left corner of the main window. It also was a QComboBox at the bottom, and has the same data, properties, and style as the QComboBox in the first window. The difference is what the selected data is eventually used for. The setup code for both is identical.
When the dropdown button is pressed for the QComboBox in the first window, the dropdown appears below the display box, as desired. When the dropdown button is pressed for the second QComboBox, the dropdown sits on top of the display box, which is not desired. I want it to work like is does in the first window. Not the main window is more than large enough to hold the dropdown list in both cases.So my question is : When does the second window behave differently. Am I missing a property that affects how the dropdown behaves ? How can I fix this ?
Thanks,
Dale Pennington -
@DalePennington said in QComboBox Dropdown behavior question:
When the dropdown button is pressed for the second QComboBox, the dropdown sits on top of the display box, which is not desired. I want it to work like is does in the first window. Not the main window is more than large enough to hold the dropdown list in both cases.
So my question is : When does the second window behave differently. Am I missing a property that affects how the dropdown behaves ? How can I fix this ?
Either coordinate mapping or Window manager display issue, I would say.
What OS/platform are you on?
WhatQComboBox
class is this? Your subclass or a standardQComboBox
?
Did you implement the dropdown and data model/view yourself or also used the Qt one?What is the
parent
from both of theQComboxes
? Their widget/window respectively or one global widget? -
The Operating System is RHEL8. The version of Qt is from their repository.
I am using the base QComboBox using the build in model (so using addItem to build up the internal list).
For the first window, the parentage is main window -> first window -> frame -> QComboBox
For the second window, the parentage is main window -> second window -> QComboBox
In both cases the code logic in in the window class (which is based on QWidget)Thanks for the help
Dale -
Hi,
It might also be related to the position of the combo box pop with regard to the screen.
Do you have the same behaviour if your main window is lower on the screen ? -
The main window is the entire screen in this application, so its not moveable. So basically both of the subwindows are at the top of the screen in the upper left corner.
-
Do you use Wayland as window manager?
-
Not that I am aware of. If I remember which is the Window Manager, its actually a minimal custom job that is being used (this is a set of kiosk-like applications).