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

QAbstractItemView::isPersistentEditorOpen not checking persistent editors

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3: Somewhat important P3: Somewhat important
    • 6.10.1, 6.11.0 Beta3
    • 5.12.0 RC2, 6.8.0
    • Widgets: Itemviews
    • None
    • c8b7db36a (dev), 0ae648250 (6.10)

      The recently (5.10) added QAbstractItemView::isPersistentEditorOpen() is not checking the persistent editor list and it is returning true even if the index has a regular (non persistent) editor.

       

      I'm attaching a simple test case but it should be obvious by looking at the source code:

      (from http://code.qt.io/cgit/qt/qtbase.git/tree/src/widgets/itemviews/qabstractitemview.cpp)

      bool QAbstractItemView::isPersistentEditorOpen(const QModelIndex &index) const
      {
           Q_D(const QAbstractItemView);
           return d->editorForIndex(index).widget;
      }

       

      I'd expect the method to do something similar to this instead:

       

      bool QAbstractItemView::isPersistentEditorOpen(const QModelIndex &index) const
      {
          Q_D(const QAbstractItemView);
          return d->persistent.contains(d->editorForIndex(index).widget);
      }

       

      PS: the issue appears to affect Qt 6 as well.

       
       

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

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            hippydream Fabrizio Angius
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes