QObject wrong children list
I'm using 5.8 on ubuntu 64.
I have a project with many subproject as plugins libs.
All subprojects have an ui class with the same name on each but different buttons, labels, etc.
The project call children() for the main widget, the software fail when i try to cast each child to QWidget (null pointer) and also the list of children showed by the debugger is different than any of the ui classes (the capture shows a children with the same pointer than the parent, the ui files as ui header files does not have this structure, all ui are made with the qt creator built in form editor) .
But if I leave only one subproject all running fine.
First try to print class name of each children using obj.metaobject.classname. I suspect that one of the childrens is not widget. So your typecast is failing. Check classname. That shud help to solve the problem.
I did it...
In all the
I print with the next code
qDebug() << "Objet type " << object->metaObject()->className() << " name" << object->objectName();
../../Fuentes/LReportes/Reporte.cpp - line 201 - Objet DateEdit name "filtroPorTipoCuenta"
but in all the software there are only one definition in the ui file
<widget class="LineEdit" name="filtroPorTipoCuenta">
Then the object report a different class (there are many of this problems), i moving to old qt version windows in order to have more information
I'm working on this and have news... the problem begins with multiple plugins.
If i load only one plugin, children() and children()->children()... gets the correct answer, if I load two or more plugins the answer is broken.
The call to children is made from a dynamic library to a widget in the plugins.
Hi and welcome to devnet,
Please show the exact code you are using.
Note that it's still pretty unusual to implement several widgets with the exact same name even if in different plugins.