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

Shabd Swarup V shabd at cadence.com
Fri Mar 20 09:52:49 CET 2009


You would probably need to type cast (using qobject_cast) to each widget kind which CAN be editable and check.

 

Thanks,

Shabd

 

 

From: marslee_suc [mailto:marslee_suc at 163.com] 
Sent: Thursday, March 19, 2009 10:40 PM
To: Malyushytsky, Alex
Cc: Qt-interest at trolltech.com
Subject: Re:Re: [Qt-interest] how I can know the widget is editable?

 

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





________________________________

网易邮箱,中国第一大电子邮件服务商 <http://www.yeah.net>  

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090320/0731afa7/attachment.html 


More information about the Qt-interest-old mailing list