vcl/inc/qt5/QtInstanceButton.hxx | 6 +++++- vcl/qt5/QtInstanceButton.cxx | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-)
New commits: commit 670dc56982793c514d5524b9a1eb472a7f3ebde4 Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Tue Aug 6 15:28:58 2024 +0200 Commit: Adolfo Jayme Barrientos <fit...@ubuntu.com> CommitDate: Fri Aug 9 03:00:22 2024 +0200 tdf#162351 tdf#130857 qt weld: Handle button click In `QtInstanceButton`, connect the `QPushButton::clicked` signal with a newly introduced slot that calls `signal_clicked` from the `weld::Button` base class, which calls the click handler. With this in place, clicking the "More" button in the dialog shown when following the steps from tdf#162351 now actually results in an "Error Details" dialog with more information to show up. Change-Id: I6df43af3ad3bf35b94e712aaaf0158bd7ab57907 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171552 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> (cherry picked from commit c1d671b0d89e1af4e629e11366b1f678f689e152) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171535 Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com> diff --git a/vcl/inc/qt5/QtInstanceButton.hxx b/vcl/inc/qt5/QtInstanceButton.hxx index cd55ddd470be..52f940064332 100644 --- a/vcl/inc/qt5/QtInstanceButton.hxx +++ b/vcl/inc/qt5/QtInstanceButton.hxx @@ -11,9 +11,10 @@ #include "QtInstanceWidget.hxx" +#include <QtCore/QObject> #include <QtWidgets/QPushButton> -class QtInstanceButton : public QtInstanceWidget, public virtual weld::Button +class QtInstanceButton : public QObject, public QtInstanceWidget, public virtual weld::Button { QPushButton* m_pButton; @@ -27,6 +28,9 @@ public: virtual OUString get_label() const override; virtual void set_font(const vcl::Font& rFont) override; virtual void set_custom_button(VirtualDevice* pDevice) override; + +private slots: + void buttonClicked(); }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/qt5/QtInstanceButton.cxx b/vcl/qt5/QtInstanceButton.cxx index 841e4906c34f..a3a08c729adf 100644 --- a/vcl/qt5/QtInstanceButton.cxx +++ b/vcl/qt5/QtInstanceButton.cxx @@ -14,6 +14,8 @@ QtInstanceButton::QtInstanceButton(QPushButton* pButton) , m_pButton(pButton) { assert(m_pButton); + + connect(m_pButton, &QPushButton::clicked, this, &QtInstanceButton::buttonClicked); } void QtInstanceButton::set_label(const OUString& rText) @@ -53,4 +55,6 @@ void QtInstanceButton::set_custom_button(VirtualDevice* /*pDevice*/) assert(false && "Not implemented yet"); } +void QtInstanceButton::buttonClicked() { signal_clicked(); } + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */