Hi,

I’m playing with QtQuick TreeView with custom QAbstractItemModel in C++. The 
program runs fine, except some error logs when program exits:


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()

This is what I found.

Error messages come from QItemSelectionModelPrivate::initModel, which is called 
(at least) twice, one during app start to set the model and connect some 
signals, one during app close to disconnect signals and set model to NULL.

At app starting, m->metaObject()->className() is correct (my custom model class 
name).

At app closing, m->metaObject() value changes, and m->metaObject()->className() 
is “QObject”, which doesn’t have those signals, thus the error message.

Can metaobject be modified during execution? If so, why?

Thanks in advance
songziming
-- 
Development mailing list
Development@qt-project.org
https://lists.qt-project.org/listinfo/development

Reply via email to