hi
i have a function which returns object ,i need to display the object name ,ie. store the object name in qstring ,how to do it.
hi
i have a function which returns object ,i need to display the object name ,ie. store the object name in qstring ,how to do it.
is this what you are looking for?
http://doc.trolltech.com/4.3/qobject...bjectName-prop
thanks u.........
assume there are two classes CLASSA and CLASSB.
object of CLASSA is OBJA.
object of CLASSB is OBJB.
now
CLASSA contains function FA()(return type of FA()is QString) which returns(OBJA.FA()) the name of object(ie.QString("OBJB"))
how to convert this string to object.
Last edited by babu198649; 30th January 2008 at 11:20.
Could you rephrase what do you intend to do? In first post said "object to string" but now you say "string to object".
J-P Nurmi
hi
i meant to get the name of the object by having its address. but as there is no name at run time for an object(please correct me if i am wrong).In first post said "object to string" but now you say "string to object".
i went to the second method where a string is converted to objects name. sorry for the different set of questions.
i have a label which on clicked an object should be created such that the name of the object should be the name of the labels text.
If the object you create is a QObject then you can use
Later, you can get the object's name with obj->objectName().Qt Code:
obj->setObjectName(label->text());To copy to clipboard, switch view to plain text mode
babu198649 (2nd June 2008)
Bookmarks