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

Scott Aron Bloom Scott.Bloom at sabgroup.com
Fri Mar 20 15:59:05 CET 2009


Take a look at QWizardPage (and QWizard) which does this exact analysis..

 

Scott

 

From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Malyushytsky, Alex
Sent: Friday, March 20, 2009 1:07 AM
To: Qt-interest at trolltech.com
Subject: Re: [Qt-interest] how I can know the widget is editable?

 

Little correction.

You don’t need to know the actual class name. 

You need to know  the class name the widget is derived from.

I mention this because it can make a difference.

 

If it is not, for example if you want to cover QTreeView derived classes, you are out of luck.

There is no common for QWidget “editable” property. 

If you want only to cover your project classes or known QT classes (or other in-house projects), there are various ways around this problem. 

But as far as I see it, there is no way to handle it in general.

 

Alex

 

 

________________________________

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/b5b0f1a8/attachment.html 


More information about the Qt-interest-old mailing list