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.

Pick-to: 6.5 6.5.0
Change-Id: I86d4bb5eabdb5b7a478c03516108a5edf87fcbe3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
Tor Arne Vestbø 2023-03-08 11:51:17 +01:00
parent 3f45905953
commit f2fc2013de
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);