[Qt-interest] how I can know the widget is editable?

marslee_suc marslee_suc at 163.com
Fri Mar 20 06:40:28 CET 2009


Thank you , I use the way you mentioned, but In this way I should know the className, If I don't know class name can I do 
that? for example if you get a QWidget pointer points to Kate edit field I found it is not class inherits QLineEdit, QTextEdit  
etc. It use itself class.

BR,

Edward.





2009-03-20,"Malyushytsky, Alex" <alex at wai.com> :
>Use bool QObject::inherits ( const char * className ) to find if your widget is derived frome one of the types you know how to deal with: QLineEdit, QTextEdit, etc. If it is , you can cast pointer to specific type and then check if it is editable ( for example isReadOnly () for QlineEdit )
>
>Regards,
>   Alex
>
>________________________________________
>From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of marslee_suc
>Sent: Thursday, March 19, 2009 8:31 PM
>To: qt-interest at trolltech.com
>Subject: [Qt-interest] how I can know the widget is editable?
>
>Hi all,
>
>I am facing a big problem :how can I know a widget is editable. I get a pointer that point to  QWidget. I want to know
>whether the widget is an input widget such I can input some thing by keyboard .
>
>
>Thank you in advance
>
>
>---------------------------------------------------------------------------------------------------
>Weidlinger Associates, Inc. made the following annotations.
>
>“This message and any attachments are solely for the intended recipient and may contain confidential or privileged information. If you are not the intended recipient, any disclosure, copying, use, or distribution of the information included in this message and any attachments is prohibited. If you have received this communication in error, please notify us by reply e-mail and immediately and permanently delete this message and any attachments. Thank you.”
>
>“Please consider our environment before printing this email.”
>
>_______________________________________________
>Qt-interest mailing list
>Qt-interest at trolltech.com
>http://lists.trolltech.com/mailman/listinfo/qt-interest
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090320/127852b3/attachment.html 


More information about the Qt-interest-old mailing list