From afb980283a9909aaecb6737018a05c891c9dc2b8 Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Mon, 21 Oct 2024 18:16:22 +0200 Subject: [PATCH] tdf#130857 qt weld: Create QGridLayout for "GtkGrid" Create a QGridLayout [1] when encountering a "GtkGrid" object in a .ui file. This will be needed e.g. by Writer's "Tools" -> "Word Count" dialog. With this commit in place, adding "modules/swriter/ui/wordcount.ui" to the list of supported .ui files in QtInstanceBuilder::IsUIFileSupported would already result in each of the labels in the dialog showing up, but each one as a single row rather than they being properly arranged in rows and columns. (That will be handled in an upcoming commit.) [1] https://doc.qt.io/qt-6/qgridlayout.html Change-Id: Ib9a9de4aa2820ac7e6771acf884072768508fe59 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175365 Tested-by: Jenkins Reviewed-by: Michael Weghorn --- vcl/qt5/QtBuilder.cxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vcl/qt5/QtBuilder.cxx b/vcl/qt5/QtBuilder.cxx index 10c2c49bb6ec..b2c009c61e56 100644 --- a/vcl/qt5/QtBuilder.cxx +++ b/vcl/qt5/QtBuilder.cxx @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -155,6 +156,10 @@ QObject* QtBuilder::makeObject(QObject* pParent, std::u16string_view sName, cons { pObject = new QGroupBox(pParentWidget); } + else if (sName == u"GtkGrid") + { + pObject = new QGridLayout(pParentWidget); + } else if (sName == u"GtkLabel") { extractMnemonicWidget(sID, rMap);