Hi,

The meta object doesn’t change during execution. The messages probably mean, 
that upon app close, the custom class (inheriting from QObject) is already 
deleted. Only a QObject is left, which is what className() correctly reports.

Maybe throw a qDebug() in the custom class destructor, to check if it is 
reached too early. I personally haven’t seen error logs of that kind. It 
doesn’t seem right that the custom class gets deleted, with its connections 
still being reported as active. Unless there is a bug in the custom class 
implementation, I suggest to file a bug report with a minimal reproducer.

Cheers
Axel

On 14 Aug 2023, at 15:06, Ziming Song <s.zim...@hotmail.com> wrote:

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<mailto:Development@qt-project.org>
https://lists.qt-project.org/listinfo/development

-- 
Development mailing list
Development@qt-project.org
https://lists.qt-project.org/listinfo/development

Reply via email to