Qt-interest Archive, January 2008
How disable all QLineEdit
Message 1 in thread
Hi
How can I do to disable all objects of type QLineEdit at once without using setEnabled for each object? This is possible?
Thanks,
Marcelo E. Geyer
_________________________________________________________________
Receba GRÁTIS as mensagens do Messenger no seu celular quando você estiver offline. Conheça o MSN Mobile!
http://mobile.live.com/signup/signup2.aspx?lc=pt-br
--
[ signature omitted ]
Message 2 in thread
if you want to avoid code like:
useredit->setEnabled(false);
passedit->setEnabled(false);
... (and so forth for every line edit you have in your widget)
you can instead iterate through all the line edits in your widget like this:
QList<QLineEdit*> all_lineedit = findChildren<QLineEdit*>();
forach(QLineEdit* p_lineedit, all_lineedit)
p_lineedit->setEnabled(false);
Cheers,
Peter
> -----Ursprüngliche Nachricht-----
> Von: Marcelo Estanislau Geyer [mailto:estanisgeyer@xxxxxxxxxxx]
> Gesendet: Freitag, 11. Januar 2008 18:21
> An: qt-interest@xxxxxxxxxxxxx
> Betreff: How disable all QLineEdit
>
>
> Hi
>
> How can I do to disable all objects of type QLineEdit at once
> without using setEnabled for each object? This is possible?
>
> Thanks,
>
> Marcelo E. Geyer
--
[ signature omitted ]
Message 3 in thread
> QList all_lineedit = findChildren();
> forach(QLineEdit* p_lineedit, all_lineedit)
> p_lineedit->setEnabled(false);
>
Yes, good idea!
Thanks,
Marcelo Geyer
Brazil
> Cheers,
> Peter
>
>>
>> Hi
>>
>> How can I do to disable all objects of type QLineEdit at once
>> without using setEnabled for each object? This is possible?
>>
>> Thanks,
>>
>> Marcelo E. Geyer
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>
_________________________________________________________________
Veja mapas e encontre as melhores rotas para fugir do trânsito com o Live Search Maps!
http://www.livemaps.com.br/index.aspx?tr=true
--
[ signature omitted ]
Message 4 in thread
Hi
If they had a common parent you could just disable the parent.
--
[ signature omitted ]
Message 5 in thread
Why *not* use setEnabled on each object?
Get a list of QLineEdit with QObject::findChildren and then iterate through it.
Sam Dutton
SAM DUTTON
SENIOR SITE DEVELOPER
200 GRAY'S INN ROAD
LONDON
WC1X 8XZ
UNITED KINGDOM
T +44 (0)20 7430 4496
F
E Sam.Dutton@xxxxxxxxx
WWW.ITN.CO.UK
P Please consider the environment. Do you really need to print this email?
-----Original Message-----
From: Marcelo Estanislau Geyer [mailto:estanisgeyer@xxxxxxxxxxx]
Sent: Friday 11 January 2008 17:21
To: qt-interest@xxxxxxxxxxxxx
Subject: How disable all QLineEdit
Hi
How can I do to disable all objects of type QLineEdit at once without using setEnabled for each object? This is possible?
Thanks,
Marcelo E. Geyer
_________________________________________________________________
Receba GRÁTIS as mensagens do Messenger no seu celular quando você estiver offline. Conheça o MSN Mobile!
http://mobile.live.com/signup/signup2.aspx?lc=pt-br
--
[ signature omitted ]