Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.5.2
-
None
-
-
4f4a8e75a (dev), 703b48a7c (6.5), 9bd2b35bf (6.6), 47dfcef2c (tqtc/lts-6.2)
Description
content of Main.qml:
import QtQuick import QtQuick.ControlsWindow { width: 640 height: 480 visible: true title: qsTr("Hello World") TreeView { anchors.fill: parent model: fsModel selectionModel: ItemSelectionModel {} } }
content of main.cpp:
#include <QGuiApplication> #include <QQmlApplicationEngine> #include <QQmlContext> #include <QFileSystemModel>int main(int argc, char *argv[]) { QGuiApplication app(argc, argv); QQmlApplicationEngine engine; QFileSystemModel model; model.setRootPath(QDir::currentPath()); engine.rootContext()->setContextProperty("fsModel", &model); engine.loadFromModule("quicktest", "Main"); return app.exec(); }
When program closes, the following error log shows:
qt.core.qobject.connect: QObject::disconnect: No such signal QObject::rowsAboutToBeRemoved(QModelIndex,int,int) qt.core.qobject.connect: QObject::disconnect: No such signal QObject::columnsAboutToBeRemoved(QModelIndex,int,int) qt.core.qobject.connect: QObject::disconnect: No such signal QObject::rowsAboutToBeInserted(QModelIndex,int,int) qt.core.qobject.connect: QObject::disconnect: No such signal QObject::columnsAboutToBeInserted(QModelIndex,int,int) qt.core.qobject.connect: QObject::disconnect: No such signal QObject::rowsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int) qt.core.qobject.connect: QObject::disconnect: No such signal QObject::columnsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int) qt.core.qobject.connect: QObject::disconnect: No such signal QObject::rowsMoved(QModelIndex,int,int,QModelIndex,int) qt.core.qobject.connect: QObject::disconnect: No such signal QObject::columnsMoved(QModelIndex,int,int,QModelIndex,int) qt.core.qobject.connect: QObject::disconnect: No such signal QObject::layoutAboutToBeChanged(QList<QPersistentModelIndex>,QAbstractItemModel::LayoutChangeHint) qt.core.qobject.connect: QObject::disconnect: No such signal QObject::layoutChanged(QList<QPersistentModelIndex>,QAbstractItemModel::LayoutChangeHint) qt.core.qobject.connect: QObject::disconnect: No such signal QObject::modelReset()
Note the model is instantiated after engine, so is deleted before engine. During model's destruction, it is removed from the qml engine, so QItemSelectionModelPrivate::initModel is called.
Within QItemSelectionModelPrivate::initModel, meta object show it became QObject instead of QFileSystemModel, so a lot of signals could not be found.
Attachments
Issue Links
- resulted in
-
QTBUG-117200 Reg -> 6.6b4: Exit warning :"QItemSelectionModel: Selecting when no model has been set will result in a no-op" from apps with sort proxy filter model
- Closed