summaryrefslogtreecommitdiff
path: root/vcl/qt5
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2025-01-18 18:51:59 +0100
committerMichael Weghorn <m.weghorn@posteo.de>2025-01-19 21:35:17 +0100
commit532618ae4e0f7bf8537c566421f59df473135d7d (patch)
tree1babb33c407bfc12b191b54b479737215e507ef2 /vcl/qt5
parenta2f7ee2f7cdf39d48879843967983c4ba9debd5c (diff)
tdf#130857 qt weld: Support QtInstanceToggleButton::set_inconsistent(false)
While QCheckBox supports an "inconsistent" state (see QCheckBox::tristate), I don't see that for QToolButton/QAbstractButton. Therefore, keep triggering an assert when trying to enable the indeterminate state (and reconsider what to do whenever encountering that example while working on support for more dialogs in the future). However, explicitly *disabling* the inconsistent state is fine: Don't do anything in that case. This gets called by the subclass, weld::Toggleable::set_state when setting the toggle button to checked or unchecked. [1] https://doc.qt.io/qt-6/qcheckbox.html#tristate-prop Change-Id: I4cb1475a4b5e3295ada7ed18dcbfcbf24baa53e9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180466 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'vcl/qt5')
-rw-r--r--vcl/qt5/QtInstanceToggleButton.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/vcl/qt5/QtInstanceToggleButton.cxx b/vcl/qt5/QtInstanceToggleButton.cxx
index 38b1c40509fd..696a463a4d71 100644
--- a/vcl/qt5/QtInstanceToggleButton.cxx
+++ b/vcl/qt5/QtInstanceToggleButton.cxx
@@ -34,7 +34,11 @@ bool QtInstanceToggleButton::get_active() const
return bActive;
};
-void QtInstanceToggleButton::set_inconsistent(bool) { assert(false && "Not implemented yet"); };
+void QtInstanceToggleButton::set_inconsistent(bool bInconsistent)
+{
+ assert(!bInconsistent && "Inconsistent state not supported (yet?)");
+ (void)bInconsistent;
+};
bool QtInstanceToggleButton::get_inconsistent() const
{