Hi
I'm having a weird problem where my application crashes while cycling through the item in the list returned by the QObject::children() function:
MyObject::function() {
foreach
(QObject *object, children
) { doSomethigWith(object);
}
}
MyObject::function() {
foreach(QObject *object, children) {
doSomethigWith(object);
}
}
To copy to clipboard, switch view to plain text mode
The call stack is as follows:
#0 0x100004ad6 in QBasicAtomicInt::ref at qatomic_x86_64.h:121
#1 0x1000506a3 in QList<QObject*>::QList at qlist.h:114
#2 0x1000506dd in QForeachContainer<QList<QObject*> const>::QForeachContainer at qglobal.h:2227
In my app I have a hierarchy of QObject derived classes. Also there is a model that presents this hierarchy. This crash occurs when I assign this model to the QComboBox widget.
if I call that function MyObject::function right before the assignment, it wont crash.
Any ideas why that might be happening?
Thanks
Bookmarks