[Qt-interest] [RESOLVED] Unable to hide widget

Alex Ivasyuv industral at gmail.com
Tue Nov 2 11:24:24 CET 2010


On 11/02/2010 12:05 PM, Andre Somers wrote:
> 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é

Ah man,... While I wrote you how does it work, I found my bug :)
I load widget from ui, showed it, and later load widget again in another 
pointer to hide some widgets...

That's why it didn't work. I hide widgets from unused one...
Really stupid bug...

Thanks :)

>
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest


-- 
Best regards,
Alex Ivasyuv
Senior WebUI Software Engineer
ReelRoles, Inc.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20101102/83b77967/attachment.html 


More information about the Qt-interest-old mailing list