forked from qt-creator/qt-creator
Core: Guard against pages that forgot to create their widgets
This should not happen, but when it happens, the resulting crash is quite cryptic. Make it a bit more obvious. Change-Id: Icbe40206cfdbae93ccb072d7027fcaf109f2f39f Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
@@ -345,9 +345,12 @@ private:
|
||||
void showEvent(QShowEvent *event) final
|
||||
{
|
||||
if (!widget()) {
|
||||
QWidget *inner = m_page->widget();
|
||||
setWidget(inner);
|
||||
inner->setAutoFillBackground(false);
|
||||
if (QWidget *inner = m_page->widget()) {
|
||||
setWidget(inner);
|
||||
inner->setAutoFillBackground(false);
|
||||
} else {
|
||||
QTC_CHECK(false);
|
||||
}
|
||||
}
|
||||
|
||||
QScrollArea::showEvent(event);
|
||||
|
||||
Reference in New Issue
Block a user