The variable that will receive the return only get the child if it can be casted to it: http://doc.qt.io/qt-5/qobject.html#findChild So you can call it with the button, numeric up/down, etc. Or you can try cast it after call the method.
http://doc.qt.io/qt-5/qobject.html#findChild Em qui, 2 de abr de 2015 às 16:42, Tamás Nagy <tamas.nagy....@gmail.com> escreveu: > Hi, > > I have a Qt Creator UI. There are buttons and other things on it. > > I read a list from a file with widget names, and there are booleans: 0 > - not toggled, 1 - toggled, > or other widget specific parameters. > > I would like to update my UI, based on this list. > > > QWidget widget = ui->centralWidget->findChild(qName, > Qt::FindChildrenRecursively); > > // get type of widget, but how? > > I can get the widget, but how to decide it's type? > If it is a button or a numeric up/down (to set upper and lower limits)...? > > Tamas > _______________________________________________ > Interest mailing list > Interest@qt-project.org > http://lists.qt-project.org/mailman/listinfo/interest >
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest