Skip to content

Commit

Permalink
QDialogButtonBox: fix crash when adding a QToolButton
Browse files Browse the repository at this point in the history
Introduced by commit d4f38a3

Pick-to: 6.7 6.6 6.5
Change-Id: I99385249a454c75eeae13c1d17670b356427cb70
Reviewed-by: Axel Spoerl <[email protected]>
  • Loading branch information
dfaure-kdab committed Feb 28, 2024
1 parent 9bf68a4 commit d9b63c9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/widgets/widgets/qdialogbuttonbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ void QDialogButtonBoxPrivate::layoutButtons()
for (QWidget *here : layoutWidgets) {
QWidget::setTabOrder(prev, here);
prev = here;
if (auto *pushButton = qobject_cast<QPushButton *>(prev); pushButton->isDefault())
if (auto *pushButton = qobject_cast<QPushButton *>(prev); pushButton && pushButton->isDefault())
q->setFocusProxy(pushButton);
}
}
Expand Down

0 comments on commit d9b63c9

Please sign in to comment.