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 Popup Placement
Forum Updated to NodeBB v4.3 + New Features

QComboBox Popup Placement

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 3 Posters 1.7k 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.
  • W Offline
    W Offline
    WBest
    wrote on last edited by
    #1

    Hello All,
    I'm wondering if there is a way to always get the QComboBox to extend down.

    Right now if I've got a selection of the last item on the list the popup extends above the control so that that last item on the list is scrolled to the control area.

    Thanks,
    WTB

    raven-worxR 1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      You would likely have to create a proxy style and customize the drawing of the combo box.

      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
      • W WBest

        Hello All,
        I'm wondering if there is a way to always get the QComboBox to extend down.

        Right now if I've got a selection of the last item on the list the popup extends above the control so that that last item on the list is scrolled to the control area.

        Thanks,
        WTB

        raven-worxR Offline
        raven-worxR Offline
        raven-worx
        Moderators
        wrote on last edited by
        #3

        @WBest
        QComboBox has a virtual method showPopup() where the positioning is calculated.
        The only way to achieve what you want is to override this method and position the popup yourself.
        You should get the toplevel container/window with view()->window()

        --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
        If you have a question please use the forum so others can benefit from the solution in the future

        W 1 Reply Last reply
        3
        • raven-worxR raven-worx

          @WBest
          QComboBox has a virtual method showPopup() where the positioning is calculated.
          The only way to achieve what you want is to override this method and position the popup yourself.
          You should get the toplevel container/window with view()->window()

          W Offline
          W Offline
          WBest
          wrote on last edited by
          #4

          @raven-worx

          That's what I'm looking for.

          THANKS!

          WTB

          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