[Qt-interest] Unable to hide widget
Andre Somers
andre at familiesomers.nl
Tue Nov 2 11:05:22 CET 2010
Op 2-11-2010 9:33, Alex Ivasyuv schreef:
> 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?
Unlikely.
I think it is time to show us a small, self-contained, compilable example.
André
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20101102/bfa501e7/attachment.html
More information about the Qt-interest-old
mailing list