Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-96894

Make ComboBox popup expand to largest item or screen width

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.15.6
    • Fix Version/s: 6.0
    • Component/s: Quick: Controls 2
    • Labels:
      None
    • Platform/s:
      All

      Description

      The ComboBox popup should be able to expand to min(the largest item, screen width) without having to customize the popup:

      import QtQuick 2.15
      import QtQuick.Window 2.15
      import QtQuick.Controls 2.12
      import QtQuick.Layouts 1.3
      
      ApplicationWindow {
          id: window
          width: 640
          height: 480
          visible: true
          title: qsTr("Hello World")
      
          RowLayout {
              width: parent.width
      
              Label {
                  Layout.fillWidth: true
                  text: "Select:"
              }
      
              ComboBox {
                  model:  ["First", "Second longer", "Third even longer text"]
                  Layout.fillWidth: false
              }
          }
      }
      
      

        Attachments

          Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Activity

              People

              Assignee:
              qt.team.quick.subscriptions Qt Quick and Widgets Team
              Reporter:
              DanielSt Peter Staab
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes