summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2023-05-17 13:00:47 +0200
committerEike Ziller <eike.ziller@qt.io>2023-05-17 12:13:34 +0000
commit2cd2324963b7f0ea23e0e6aad5cd04ad42cda049 (patch)
tree864b1b0ce998ff72160e9d43af8e24a416fdb88e /src
parent8121575067f4f0c48de7ca8e9444e3562e4655af (diff)
downloadqt-creator-2cd2324963b7f0ea23e0e6aad5cd04ad42cda049.tar.gz
CheckableMessageBox: Simplify checkbox setup
If the dialog is shown, the checkbox must be unchecked, because otherwise the dialog would not have been shown. Change-Id: I34e8034975baef710997e0cdb3c7d2f8b0c94cd2 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/libs/utils/checkablemessagebox.cpp10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/libs/utils/checkablemessagebox.cpp b/src/libs/utils/checkablemessagebox.cpp
index 29951fd9c4..bf566e53a8 100644
--- a/src/libs/utils/checkablemessagebox.cpp
+++ b/src/libs/utils/checkablemessagebox.cpp
@@ -64,19 +64,11 @@ static QMessageBox::StandardButton exec(
return acceptButton;
msgBox.setCheckBox(new QCheckBox);
+ msgBox.checkBox()->setChecked(false);
std::visit(
[&msgBox](auto &&decider) {
- using T = std::decay_t<decltype(decider)>;
msgBox.checkBox()->setText(decider.text);
- if constexpr (std::is_same_v<T, CheckableMessageBox::BoolDecision>) {
- msgBox.checkBox()->setChecked(decider.doNotAskAgain);
- } else if constexpr (std::is_same_v<T, CheckableMessageBox::SettingsDecision>) {
- msgBox.checkBox()->setChecked(
- decider.settings->value(decider.settingsSubKey, false).toBool());
- } else if constexpr (std::is_same_v<T, CheckableMessageBox::AspectDecision>) {
- msgBox.checkBox()->setChecked(decider.aspect.value());
- }
},
*decider);
}