QErrorMessage: Reset 'again' check box between each error message

The choice of whether to show a message again is per message,
so when showing a new message we need to reset the check box
back to its default checked state, otherwise the user might
mistakenly dismiss more than the indented message.

[ChangeLog][Widgets] QErrorMessage will now reset the check
box for showing a message again for each new message shown,
as each individual message has its own suppression state.

Change-Id: I86d4bb5eabdb5b7a478c03516108a5edf87fcbe3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit f2fc2013defc2f346fa1936dcf357d34bae3dbba)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Tor Arne Vestbø 2023-03-08 11:51:17 +01:00 committed by Qt Cherry-pick Bot
parent cb14d0ec7f
commit dcf7247e05
2 changed files with 2 additions and 2 deletions

View File

@ -358,6 +358,7 @@ bool QErrorMessagePrivate::nextPending()
#endif
currentMessage = std::move(message);
currentType = std::move(type);
again->setChecked(true);
return true;
}
}

View File

@ -70,8 +70,7 @@ void tst_QErrorMessage::dontShowAgain()
QVERIFY(errorMessageDialog.isVisible());
checkBox = errorMessageDialog.findChild<QCheckBox*>();
QVERIFY(checkBox);
QVERIFY(!checkBox->isChecked());
checkBox->setChecked(true);
QVERIFY(checkBox->isChecked());
errorMessageDialog.close();
errorMessageDialog.showMessage(htmlString);