判断QWidget是否可见,调用isVisible()还是isHidden()?
在写这篇文章之前,我一直以为是一样的,也就是:
isVisible() == !isHidden()
No!No!No!................
看QT文档对isHidden()的说明:
bool QWidget::isHidden() const
Returns true if the widget is hidden, otherwise returns false.
A hidden widget will only become visible when show() is called on it. It will not be automatically shown when the parent is shown.
To check visibility, use !isVisible() instead (notice the exclamation mark).
isHidden() implies !isVisible(), but a widget can be not visible and not hidden at the same time. This is the case for widgets that are childr

最低0.47元/天 解锁文章
1245

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



