[solved] QObject::children problem
-
What is wrong?
@
QObject* parentObject;
QObjectList ol = parentObject->children();
@When the parentObject is empty, I got this error:
(Internal error: pc 0xf in read in psymtab, but not in symtab.)
...
(Internal error: pc 0x10 in read in psymtab, but not in symtab.)
can't find linker symbol for virtual table forQObject' value found
qt_meta_stringdata_QAbstractItemView' instead
...
can't find linker symbol for virtual table forQObject' value found
qt_meta_stringdata_QAbstractItemView' instead
(Internal error: pc 0xf in read in psymtab, but not in symtab.)
...
(Internal error: pc 0x10 in read in psymtab, but not in symtab.)
can't find linker symbol for virtual table forQObject' value found
qt_meta_stringdata_QAbstractItemView' instead
can't find linker symbol for virtual table forQObject' value found
qt_meta_stringdata_QAbstractItemView' instead
can't find linker symbol for virtual table forQObject' value found
qt_meta_stringdata_QAbstractItemView' instead
...
can't find linker symbol for virtual table forQObject' value found
qt_meta_stringdata_QAbstractItemView' instead
(Internal error: pc 0xf in read in psymtab, but not in symtab.)
...
can't find linker symbol for virtual table forQObject' value found
qt_meta_stringdata_QAbstractItemView' instead
...
can't find linker symbol for virtual table forQObject' value found
qt_meta_stringdata_QAbstractItemView' instead
(Internal error: pc 0xf in read in psymtab, but not in symtab.)
....
can't find linker symbol for virtual table forQObject' value found
qt_meta_stringdata_QAbstractItemView' instead
...
can't find linker symbol for virtual table forQObject' value found
qt_meta_stringdata_QAbstractItemView' instead
found `qt_meta_stringdata_QAbstractItemView' instead
...
ASSERT: "d" in file c:\Digia\Qt\4.8.3\include/QtCore/../../src/corelib/tools/qscopedpointer.h, line 112
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function. -
parentObject is an invalid pointer. You need to create an object with the new keyword and assign it to the pointer.
-
Thanks, I've modified the code according to your suggestion.
But:
I got the same error message:
ASSERT: "d" in file c:\Digia\Qt\4.8.3\include/QtCore/../../src/corelib/tools/qscopedpointer.h, line 112
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function. -
Make sure to rerun qmake so that moc picks up your changes.
-
[quote author="sierdzio" date="1353932193"]Make sure to rerun qmake so that moc picks up your changes.[/quote]
I made a full clean-up, made a qmake run, made a full rebuild and
I have no success.
('m gonna crayzeeee...) -
Waaaaaaaaaaaahhhhh! Solved!
The problem was in full other place!
I had an object on the stack, and after the code goes out of scope
that object is cleared.... -
Ah, good to know, because I was out of ideas here :)
-
That's quite strange. Can you make a minimal program that shows that behaviour (e.g. put the buggy code in int main() ) and post it here?
-
Whoops, too late :) Glad to hear you solved it
-
Typical C++ happyness:
The point of crash and the error message was
totally misleading (for me) :)
Thanks to all!