vcl/CustomTarget_qt5_moc.mk | 1 + vcl/CustomTarget_qt6_moc.mk | 1 + vcl/inc/qt5/QtInstanceComboBox.hxx | 7 ++++++- vcl/qt5/QtInstanceBuilder.cxx | 1 + vcl/qt5/QtInstanceComboBox.cxx | 6 ++++++ 5 files changed, 15 insertions(+), 1 deletion(-)
New commits: commit f1247eba6485a080df3486021b53072018113015 Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Wed Oct 23 22:32:50 2024 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Thu Oct 24 09:09:41 2024 +0200 tdf#130857 qt weld: Declare support for "Printer Settings" dialog Add .ui file of the "File" -> "Printer Settings..." dialog available e.g. in Writer to list of files supported by QtInstanceBuilder, so that native Qt widgets are used for that dialog now when using the qt5/qt6 VCL plugins, unless environment variable SAL_VCL_QT_NO_WELDED_WIDGETS=1 is set. Change-Id: I7806688102f690faa02fb5e712943d6ae216ff9a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175522 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> diff --git a/vcl/qt5/QtInstanceBuilder.cxx b/vcl/qt5/QtInstanceBuilder.cxx index 4b8c9fe2ea87..908d2ba3e6bb 100644 --- a/vcl/qt5/QtInstanceBuilder.cxx +++ b/vcl/qt5/QtInstanceBuilder.cxx @@ -43,6 +43,7 @@ bool QtInstanceBuilder::IsUIFileSupported(const OUString& rUIFile) u"modules/swriter/ui/wordcount.ui"_ustr, u"sfx/ui/licensedialog.ui"_ustr, u"sfx/ui/querysavedialog.ui"_ustr, + u"svt/ui/printersetupdialog.ui"_ustr, u"svt/ui/restartdialog.ui"_ustr, }; commit 8c8a48eb06c692ded03e29c1ab493935e2a12228 Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Wed Oct 23 22:26:10 2024 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Thu Oct 24 09:09:34 2024 +0200 tdf#130857 qt weld: Signal when current combobox item changes Connect to the QComboBox::currentIndexChanged signal and call `weld::ComboBox::signal_changed` to notify of that change. This is in preparation for upcoming Change-Id: I7806688102f690faa02fb5e712943d6ae216ff9a Author: Michael Weghorn <m.wegh...@posteo.de> tdf#130857 qt weld: Declare support for "Printer Settings" dialog and causes the infos for the printer previously selected in the combobox in the "File" -> "Printer Settings" dialog to be shown after selecting a printer other than the initially selected one in the combobox, then clicking the "Properties" button in that dialog. (Without this, properties of the initially selected printer would always be shown.) Change-Id: I9a8609e172fd1d6783a86395ff58e64b7cf5c4d2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175521 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> diff --git a/vcl/CustomTarget_qt5_moc.mk b/vcl/CustomTarget_qt5_moc.mk index ec580d76358a..857b3eb41a65 100644 --- a/vcl/CustomTarget_qt5_moc.mk +++ b/vcl/CustomTarget_qt5_moc.mk @@ -14,6 +14,7 @@ $(call gb_CustomTarget_get_target,vcl/qt5) : \ $(gb_CustomTarget_workdir)/vcl/qt5/QtFilePicker.moc \ $(gb_CustomTarget_workdir)/vcl/qt5/QtFrame.moc \ $(gb_CustomTarget_workdir)/vcl/qt5/QtInstance.moc \ + $(gb_CustomTarget_workdir)/vcl/qt5/QtInstanceComboBox.moc \ $(gb_CustomTarget_workdir)/vcl/qt5/QtInstanceDialog.moc \ $(gb_CustomTarget_workdir)/vcl/qt5/QtInstanceMessageDialog.moc \ $(gb_CustomTarget_workdir)/vcl/qt5/QtMainWindow.moc \ diff --git a/vcl/CustomTarget_qt6_moc.mk b/vcl/CustomTarget_qt6_moc.mk index 28fb0100f40e..a58f79a2bbf4 100644 --- a/vcl/CustomTarget_qt6_moc.mk +++ b/vcl/CustomTarget_qt6_moc.mk @@ -14,6 +14,7 @@ $(call gb_CustomTarget_get_target,vcl/qt6) : \ $(gb_CustomTarget_workdir)/vcl/qt6/QtFilePicker.moc \ $(gb_CustomTarget_workdir)/vcl/qt6/QtFrame.moc \ $(gb_CustomTarget_workdir)/vcl/qt6/QtInstance.moc \ + $(gb_CustomTarget_workdir)/vcl/qt6/QtInstanceComboBox.moc \ $(gb_CustomTarget_workdir)/vcl/qt6/QtInstanceDialog.moc \ $(gb_CustomTarget_workdir)/vcl/qt6/QtInstanceMessageDialog.moc \ $(gb_CustomTarget_workdir)/vcl/qt6/QtMainWindow.moc \ diff --git a/vcl/inc/qt5/QtInstanceComboBox.hxx b/vcl/inc/qt5/QtInstanceComboBox.hxx index 53d81bc9aadc..2c1ea133df23 100644 --- a/vcl/inc/qt5/QtInstanceComboBox.hxx +++ b/vcl/inc/qt5/QtInstanceComboBox.hxx @@ -13,8 +13,10 @@ #include <QtWidgets/QComboBox> -class QtInstanceComboBox : public QtInstanceWidget, public virtual weld::ComboBox +class QtInstanceComboBox : public QObject, public QtInstanceWidget, public virtual weld::ComboBox { + Q_OBJECT + QComboBox* m_pComboBox; bool m_bSorted; @@ -83,6 +85,9 @@ public: private: void sortItems(); + +private slots: + void handleCurrentIndexChanged(); }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/qt5/QtInstanceComboBox.cxx b/vcl/qt5/QtInstanceComboBox.cxx index e2284b33ef4a..296370ebf292 100644 --- a/vcl/qt5/QtInstanceComboBox.cxx +++ b/vcl/qt5/QtInstanceComboBox.cxx @@ -8,6 +8,7 @@ */ #include <QtInstanceComboBox.hxx> +#include <QtInstanceComboBox.moc> QtInstanceComboBox::QtInstanceComboBox(QComboBox* pComboBox) : QtInstanceWidget(pComboBox) @@ -15,6 +16,9 @@ QtInstanceComboBox::QtInstanceComboBox(QComboBox* pComboBox) , m_bSorted(false) { assert(pComboBox); + + QObject::connect(m_pComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, + &QtInstanceComboBox::handleCurrentIndexChanged); } void QtInstanceComboBox::insert(int nPos, const OUString& rStr, const OUString* pId, @@ -249,4 +253,6 @@ void QtInstanceComboBox::set_max_drop_down_rows(int) { assert(false && "Not impl void QtInstanceComboBox::sortItems() { m_pComboBox->model()->sort(0, Qt::AscendingOrder); } +void QtInstanceComboBox::handleCurrentIndexChanged() { signal_changed(); } + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */