[Qt-interest] clear QGridLayout

Malyushytsky, Alex alex at wai.com
Mon Jun 29 22:55:30 CEST 2009


If you want to delete objects anyway, why do you need to be able to cast QObject to QWidget?

If you do need you might want to use standard C++ methods to cast pointers or QT provides qobject_cast, which you can use,
if you are sure that you have QObject derived class.

And the simplest would be delete layout itself. It would delete all children.
So all you would need is to create new layout.

Regards,
    Alex


-----Original Message-----
From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Frank Lutz
Sent: Monday, June 29, 2009 5:44 PM
To: qt-interest at trolltech.com
Subject: [Qt-interest] clear QGridLayout

Hi,

i do have one QGridLayout where i want to remove all children.
Firsty i have the Problem i have also Layouts. But i had put them into a
Widget.
Now i want to pick the children with grid->children().
But so i have them as QObject not QWidget.

So my question, how can I convert the QObject into QWidget,
or is there one better way to clear a QGridLayout?

Thanks very, very, very!!!
_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest


---------------------------------------------------------------------------------------------------
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."




More information about the Qt-interest-old mailing list