Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QComboBox Dropdown behavior question
Forum Updated to NodeBB v4.3 + New Features

QComboBox Dropdown behavior question

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 4 Posters 370 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    DalePennington
    wrote on last edited by
    #1

    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

    Pl45m4P 1 Reply Last reply
    0
    • D DalePennington

      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

      Pl45m4P Offline
      Pl45m4P Offline
      Pl45m4
      wrote on last edited by Pl45m4
      #2

      @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?
      What QComboBox class is this? Your subclass or a standard QComboBox?
      Did you implement the dropdown and data model/view yourself or also used the Qt one?

      What is the parent from both of the QComboxes? Their widget/window respectively or one global widget?


      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      1 Reply Last reply
      0
      • D Offline
        D Offline
        DalePennington
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          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 ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • D Offline
            D Offline
            DalePennington
            wrote on last edited by
            #5

            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.

            1 Reply Last reply
            0
            • Christian EhrlicherC Offline
              Christian EhrlicherC Offline
              Christian Ehrlicher
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Do you use Wayland as window manager?

              Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
              Visit the Qt Academy at https://academy.qt.io/catalog

              1 Reply Last reply
              0
              • D Offline
                D Offline
                DalePennington
                wrote on last edited by
                #7

                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).

                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved