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

QComboBox silently invalids the current index, if QStandardItemModel::setItem is called for that index

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.12.0
    • Fix Version/s: 5.15.0 Alpha
    • Component/s: Core: Item Models
    • Labels:
      None
    • Environment:
      openSUSE Leap 15.0
    • Platform/s:
      All
    • Commits:
      4522b17159a29ffd12c4d93be8a6e8e1a05dccd0 (qt/qtbase/5.15)

      Description

      QComboBox silently (i.e. without signal QComboBox::currentIndexChanged) invalidates the current index, if QStandardItemModel::setItem is called for that index of the used model.

      The attached "where.txt" shows the function stack. The silent invalidation occurs within "invalidatePersistentIndex" in QStandardItemPrivate::setModel.

      The application "app" in the attached "qtbug.zip" reproduces the bug. A click on "Test" in the toolbar changes the current text in the combobox from lower case to upper case or vice versa using QStandardItemModel::setItem. Please look at the output of qDebug. You see the current index before and after "setItem" and the indexes received via signal "currentIndexChanged" (if any).

        Attachments

        1. qtbug.zip
          3 kB
        2. where.txt
          7 kB

          Issue Links

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

            Activity

              People

              Assignee:
              dfaure_kdab David Faure
              Reporter:
              wschenke Winfried Schenke
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes