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

ComboBox.implicitContentWidth is not stable when implicitContentWidthPolicy is set to ComboBox.WidestTextWhenCompleted

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.5
    • Quick: Controls 2
    • None
    • macOS

    Description

      The attached file tries to make the ComboBox narrower by explicitly calculating its implicitWidth based on the implicitContentWidth property.

      In order for the ComboBox have the same width, we set this property:

       implicitContentWidthPolicy: ComboBox.WidestTextWhenCompleted

      WidestTextWhenCompleted is documented to this:

      The implicitContentWidth will be set to the implicit width of the the largest text for the given textRole once after component completion. This option should be used with smaller models, as it can be expensive.

      However, as you can see, it's implicitContentWidth still changes while changing the current item in the ComboBox.

      The ColorInputs.qml in the Color Dialog suffers from the same issue.

      Reproducible with macOS style.
      Can not reproduce in neither Material, Universal nor Fusion style.

      Attachments

        Issue Links

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

          Activity

            People

              mitch_curtis Mitch Curtis
              smd Jan Arve
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes