PDA

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



soumyadeep_pan
5th May 2009, 05: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 ?????

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

faldzip
5th May 2009, 08: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
QMetaObject:
- className()
- classInfo()
- etc