1.bool isVisibleTo(const QWidget *) const;
/*!
Returns \c true if this widget would become visible if \a ancestor is
shown; otherwise returns \c false.
The true case occurs if neither the widget itself nor any parent
up to but excluding \a ancestor has been explicitly hidden.
This function will still return true if the widget is obscured by
other windows on the screen, but could be physically visible if it
or they were to be moved.
isVisibleTo(0) is identical to isVisible().
\sa show(), hide(), isVisible()
*/
bool QWidget::isVisibleTo(const QWidget *ancestor) const
{
if (!ancestor)
return isVisible();
const QWidget * w = this;
while (!w->isHidden()
&& !w->isWindow()
&& w->parentWidget()
&& w->parentWidget() != ancestor)
w = w->parentWidget();
return !w->isHidden();
}
如果QWidget本身或任何父级(但不包括祖先)都没有被显式隐藏,则返回true。
2.bool isEnabledTo(const QWidget

本文详细解释了QWidget的isVisibleTo()和isEnabledTo()函数,用于判断控件的显示状态和启用条件,以及isWindow()方法确定窗口属性。同时揭示了visibleRegion()方法计算可见区域的逻辑。
最低0.47元/天 解锁文章
651

被折叠的 条评论
为什么被折叠?



