Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.9.3
-
None
Description
The function QWidget::setVisible(bool) in qwidget.cpp is not implemented uniformly in regard to the parentWidget() property, sometimes there is a pointer check on the return value of this function and sometimes there isn't. Especially line 8250 caused a crash in our case:
if (isWindow() || parentWidget()->isVisible()) {
should be:
if (isWindow() || (parentWidget() && parentWidget()->isVisible())) {
There are more occurences of using the return value of parentWidget() without a pointer check in QWidget::serVisible(bool):
QWidget *pw = parentWidget();
if (!testAttribute(Qt::WA_WState_Created)
&& (isWindow() || pw->testAttribute(Qt::WA_WState_Created))) {
create();
}
and
// adjust size if necessary if (!wasResized && (isWindow() || !parentWidget()>d_func()>layout)) {