[Qt-interest] Unable to hide widget
Alex Ivasyuv
industral at gmail.com
Tue Nov 2 09:33:59 CET 2010
On 11/02/2010 12:42 AM, Malyushytsky, Alex wrote:
> If you want to hide visible widget which is not window or dialog and normally is in the layout,
> You should call setVisible().
As I said I tried setVisible() and hide() and they still don't work.
> If it does not work, check that you find correct "myWidget" - you might have a few widgets with the same name.
Yes, "myWidget" it's correct widget, as I'm able to get all it's
children, e.g.
QList<QWidget *> list = layerWidget -> findChildren<QWidget *> ();
for (int i = 1; i < list.size(); ++i) {
qDebug() << list.at(i) -> objectName();
// list.at(i) -> setVisible(false); // also doesn't work
}
"label_2"
"lineEdit"
"pushButton"
"label_7"
and yes, it's a unique name...
I don't know what's wrong.... Maybe issue in Qt 4.7?
> Regards,
> Alex
>
>
> From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Alex Ivasyuv
> Sent: Sunday, October 31, 2010 4:05 PM
> To: qt-interest at trolltech.com
> Subject: [Qt-interest] Unable to hide widget
>
> Hi,
>
> I'm trying to hide one of widget in other another one, that was loaded from .ui, but it doesn't work.
>
> // widget - loaded widget from .ui
> QWidget * layerWidget = widget -> findChild<QWidget *> ("myWidget");
> layerWidget -> hide(); // doesn't work
>
> setVisible() also doesn't work.
> I also tried update() and repaint() after that, but they also don't have any effect.
>
> What's wrong?
>
> Thanks,
>
>
>
> ---------------------------------------------------------------------------------------------------
> 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/20101102/8ff26191/attachment.html
More information about the Qt-interest-old
mailing list