View Full Version : How to know the object names of any generic application ?

5th May 2009, 04:48
If we develop an application window, which contains different controls such as line edits, label boxes and other objects, created statically (using drag and drop method). How to get the names of the objects present in the application ? ....
Should I have to read the corresponding header file, which present in the .ui directory ??? Is there any other way to get those object names, because I want to know for a generic application ?????

5th May 2009, 05:22
Did you come across QObject::objectName ???
You can directly call this function from any widget..

5th May 2009, 07:11
also take look at the other QObject and QMetaObject (you can get meta object by QObject::metaObject() methods. Some might be useful to get through the complex widget which structure you don't know:
- inherits()
- findChild()
- findChildren()
- etc
- className()
- classInfo()
- etc