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

QComboBox::setModel uses an invalid root for setting the current index.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.5.0
    • 4.8.x, 5.3.2, 5.4.0
    • None
    • 940530ab67a8fd59130b2299fe854707207f041f

    Description

      In the QComboBox::setModel method, the root model index (d->root) can be invalid. Not invalid according to the isValid() method. Not invalid due to some changes inside the model since it is a QPersistentModelIndex. But invalid, because the model and the index aren't even semantically linked.

      If someone creates a QComboBox, attach a model to it with setModel, change the root model index with setRootModelIndex and later update the model with setModel, the root index can mismatch this new model. I guess the expected behaviour is to reinitialize the root index every time the model is updated.

      Attachments

        For Gerrit Dashboard: QTBUG-43350
        # Subject Branch Project Status CR V

        Activity

          People

            peppe Giuseppe D'Angelo
            jguegant Jean Guegant
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes