diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2025-01-18 18:58:30 +0100 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2025-01-19 21:35:24 +0100 |
commit | 1052f5cd508a33c4cea3a89d16f03b53ebe18b40 (patch) | |
tree | 40619ef4d20a74c1910abf2e642c497b8b970efe | |
parent | 532618ae4e0f7bf8537c566421f59df473135d7d (diff) |
tdf#130857 qt weld: Signal when toggle button gets toggled
Change-Id: Ia44a203a56a2b560a995446da2dd1c48a736bf60
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180467
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
-rw-r--r-- | vcl/inc/qt5/QtInstanceToggleButton.hxx | 3 | ||||
-rw-r--r-- | vcl/qt5/QtInstanceToggleButton.cxx | 8 |
2 files changed, 11 insertions, 0 deletions
diff --git a/vcl/inc/qt5/QtInstanceToggleButton.hxx b/vcl/inc/qt5/QtInstanceToggleButton.hxx index 1f7566c4cd5f..c7da7454f4d6 100644 --- a/vcl/inc/qt5/QtInstanceToggleButton.hxx +++ b/vcl/inc/qt5/QtInstanceToggleButton.hxx @@ -25,6 +25,9 @@ public: virtual void set_inconsistent(bool bInconsistent) override; virtual bool get_inconsistent() const override; + +private Q_SLOTS: + void signalToggled(); }; /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/vcl/qt5/QtInstanceToggleButton.cxx b/vcl/qt5/QtInstanceToggleButton.cxx index 696a463a4d71..eca59aa95f4a 100644 --- a/vcl/qt5/QtInstanceToggleButton.cxx +++ b/vcl/qt5/QtInstanceToggleButton.cxx @@ -15,6 +15,8 @@ QtInstanceToggleButton::QtInstanceToggleButton(QAbstractButton* pButton) { assert(pButton); pButton->setCheckable(true); + + connect(&getButton(), &QAbstractButton::toggled, this, &QtInstanceToggleButton::signalToggled); } void QtInstanceToggleButton::set_active(bool bActive) @@ -46,4 +48,10 @@ bool QtInstanceToggleButton::get_inconsistent() const return false; }; +void QtInstanceToggleButton::signalToggled() +{ + SolarMutexGuard g; + signal_toggled(); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ |