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

QComboBox sizeHint not updated on resetting the model

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P4: Low
    • 5.5.0
    • 4.5.2
    • Widgets: Layout
    • None
    • 5aa40e5b00eb8f54157bc1aa01205a8a87e0c661

    Description

      Note: lemma@confuego.org: 08/24/09 07:58:25 PM:
      Name
      Michael Leupold
      Your E-Mail Address
      lemma@confuego.org
      Product
      Qt
      Function
      Layout
      Version
      4.5.2
      Platform
      Linux
      Platform details
      Compilers
      GCC
      Compiler details
      Subject
      QComboBox sizeHint not updated on resetting the model
      Steps to reproduce / test case
      1. Create a QComboBox
      2. Set its sizeAdjustPolicy to AdjustToContents
      3. Set a custom model on the combobox
      4. Call reset() on the model

      Expected outcome: The combobox adjusts its size to the new content
      Actual outcome: The size stays the same
      More information
      Attached test-case illustrates the behaviour by creating 3 comboboxes:
      1. The first uses a model that resets itself and doesn't resize.
      2. The second uses beginRemoveRows()/endRemoveRows() to force invalidation of the sizeHint.
      3. The third doesn't have a model but uses addItem, then clear() and addItem again.

      1. shows the bug, 2. and 3. resize correctly. I would have expected all 3 to behave the same.
      (see main.cpp)

      Attachments

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

        Activity

          People

            dfaure_kdab David Faure
            z35liu Zheng Liu (closed Nokia identity) (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes