Qt-interest Archive, August 2006
QWidget: isShown(), isHidden() and isVisible()
Message 1 in thread
Hi,
1. In both Qt3 and Qt4, what is difference between isShown() and isVisible()?
2. In Qt4, why is isShown() deprecated but not isHidden()?
3. My guess is that in both Qt3 and Qt4, this invariant holds:
isVisible () == isShown () && isShown () == !isHidden()
However, the following code suggests isVisible() and isHidden() are unrelated?
~~~~
Qt 4.1 X11 src/gui/kernel/qwidget.h:
inline bool QWidget::isVisible() const
{ return testAttribute(Qt::WA_WState_Visible); }
inline bool QWidget::isHidden() const
{ return testAttribute(Qt::WA_WState_Hidden); }
~~~~
Thanks,
Clarence
--
[ signature omitted ]
Message 2 in thread
I believe the difference, is as follows
A widget that is hidden, can never be visible.
However, a visible widget may be covered and thus, not shown. Ie, don't
repaint.
Scott
> -----Original Message-----
> From: Clarence Dang [mailto:clarence.dang@xxxxxxxxx]
> Sent: Saturday, August 26, 2006 7:22 PM
> To: qt-interest@xxxxxxxxxxxxx
> Subject: QWidget: isShown(), isHidden() and isVisible()
>
> Hi,
>
> 1. In both Qt3 and Qt4, what is difference between isShown() and
> isVisible()?
>
> 2. In Qt4, why is isShown() deprecated but not isHidden()?
>
> 3. My guess is that in both Qt3 and Qt4, this invariant holds:
>
> isVisible () == isShown () && isShown () == !isHidden()
>
> However, the following code suggests isVisible() and isHidden() are
> unrelated?
>
> ~~~~
> Qt 4.1 X11 src/gui/kernel/qwidget.h:
>
> inline bool QWidget::isVisible() const
> { return testAttribute(Qt::WA_WState_Visible); }
>
> inline bool QWidget::isHidden() const
> { return testAttribute(Qt::WA_WState_Hidden); }
> ~~~~
>
> Thanks,
> Clarence
>
> --
> My Blog - http://clarencedang.blogspot.com/
> KolourPaint Project - http://www.kolourpaint.org/
>
> --
> 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/
--
[ signature omitted ]