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

QSortFilterProxyModel::setSourceModel reverts to empty static model if old model is deleted

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Not Evaluated
    • None
    • 5.11.0
    • Core: Item Models
    • None
    • Windows

    Description

      	auto oldModel = new QStandardItemModel(10, 10);
      
      	auto newModel = new QStandardItemModel(20, 20);
      
      	auto proxy = new QSortFilterProxyModel;
      	proxy->setSourceModel(oldModel);
      
      	QCOMPARE(proxy->rowCount(), 10);
      
      	proxy->setSourceModel(newModel);
      	QCOMPARE(proxy->rowCount(), 20);
      	delete oldModel;
      	QCOMPARE(proxy->rowCount(), 20);
      

      last rowCount returns 0

      Attachments

        Issue Links

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

          Activity

            People

              dfaure_kdab David Faure
              ziv x x
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes