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

Make ComboBox popup expand to largest item or screen width

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 6.0
    • 5.15.6
    • Quick: Controls 2
    • None
    • 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

              qt.team.quick.subscriptions Qt Quick and Widgets Team
              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