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

QComboBox with AdjustToContents doesn't update size when proxy model is invalidated

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.6.3, 5.9.2
    • None

    Description

      I have a QComboBox on which I have called setSizeAdjustPolicy(QComboBox::AdjustToContents). The combo box's model is set to a QSortFilterProxyModel subclass.

      When the combo box is first shown, the proxy model filters out all items. Later, conditions change and the proxy model no longer filters out all items. However the width of the combo box isn't properly updated.

      To reproduce this, build the attached example and click the Update button. Note that the item in the combo box is elided. This is incorrect behavior.

      To see the expected behavior, uncomment line 55 in the example and rebuild.

      Attachments

        1. Combo_Actual.PNG
          Combo_Actual.PNG
          6 kB
        2. Combo_Expected.PNG
          Combo_Expected.PNG
          8 kB
        3. QComboBoxAdjustSize.zip
          2 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            richard Richard Moe Gustavsen
            aclight Adam Light
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes