How can I find which type of my variable?Is there a pratical way?EX.QComboBox *combo;
type(combo)==QComboBox mean;
How can I find which type of my variable?Is there a pratical way?EX.QComboBox *combo;
type(combo)==QComboBox mean;
If you want type information about non-Qt objects you will have to use some reflection mechanism(there are a few libraries available).
For Qt objects, you have QObject::inherits and QMetaObject::className and QMetaObject::superClass.
Or you can use dynamic_cast:
Note in this case you need a pointer to QComboBox.Qt Code:
if(dynamic_cast<QComboBox*>(combo) != null) // do someyhingTo copy to clipboard, switch view to plain text mode
Regards
hgedek (9th September 2007)
Bookmarks