basctl/uiconfig/basicide/ui/sortmenu.ui | 2 +- vcl/qt5/QtBuilder.cxx | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-)
New commits: commit 2c21266d195b407ca359d869f958257632579702 Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Tue Jun 3 12:42:23 2025 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Wed Jun 4 07:34:41 2025 +0200 tdf#130857 qt weld: Implement submenu support This will be used e.g. for this menu with SAL_VCL_QT_USE_WELDED_WIDGETS=1, once QtInstanceBuilder declares support for its .ui file ("modules/BasicIDE/ui/sortmenu.ui"): * "Macros" -> "Organize Macros" -> "Basic" * right-click on entry in the "Existing Macros In: <module>" treeview Change-Id: Ie47e791116f1f72b1fc61a042233cfbea7409030 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186154 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> diff --git a/vcl/qt5/QtBuilder.cxx b/vcl/qt5/QtBuilder.cxx index c41a24c25e9e..8b02dff004a9 100644 --- a/vcl/qt5/QtBuilder.cxx +++ b/vcl/qt5/QtBuilder.cxx @@ -675,11 +675,17 @@ void QtBuilder::setMenuActionGroup(QMenu* pMenu, QAction* pAction, const OUStrin void QtBuilder::insertMenuObject(QMenu* pParent, QMenu* pSubMenu, const OUString& rClass, const OUString& rId, stringmap& rProps, stringmap&, accelmap&) { - assert(!pSubMenu && "Handling not implemented yet"); - (void)pSubMenu; - const QString sLabel = convertAccelerator(extractLabel(rProps)); - QAction* pAction = pParent->addAction(sLabel); + QAction* pAction = nullptr; + if (pSubMenu) + { + pAction = pParent->addMenu(pSubMenu); + pAction->setText(sLabel); + } + else + { + pAction = pParent->addAction(sLabel); + } pAction->setObjectName(toQString(rId)); const OUString sActionName(extractActionName(rProps)); commit 61a6f20326e38f92f990842e8d558a05e083136e Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Tue Jun 3 12:14:02 2025 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Wed Jun 4 07:34:28 2025 +0200 tdf#130857 basctl: Use id of first radio item for group ID .. not the last lone. This helps the QtBuilder logic implemented in commit 5492c9bfa51ab45b936c6191066640608384c0e1 Author: Michael Weghorn <m.wegh...@posteo.de> Date: Fri Apr 11 10:24:33 2025 +0200 tdf#130857 qt weld: Support "GtkRadioMenuItem" to find the group when needed, instead of triggering an assert in a test branch where support for that menu is declared for native Qt widgets with SAL_VCL_QT_USE_WELDED_WIDGETS=1. To trigger the menu from Writer: * "Macros" -> "Organize Macros" -> "Basic" * right-click on entry in the "Existing Macros In: <module>" treeview Change-Id: Id34b5d7efabbc29d732e414c20b487f65e6a0ac5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186153 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> diff --git a/basctl/uiconfig/basicide/ui/sortmenu.ui b/basctl/uiconfig/basicide/ui/sortmenu.ui index bd40fcb8f123..1f3c06cc1234 100644 --- a/basctl/uiconfig/basicide/ui/sortmenu.ui +++ b/basctl/uiconfig/basicide/ui/sortmenu.ui @@ -22,7 +22,6 @@ <property name="label" translatable="yes" context="sortmenu|alphabetically">_Alphabetically</property> <property name="use-underline">True</property> <property name="draw-as-radio">True</property> - <property name="group">properorder</property> </object> </child> <child> @@ -32,6 +31,7 @@ <property name="label" translatable="yes" context="sortmenu|properorder">_Proper order</property> <property name="use-underline">True</property> <property name="draw-as-radio">True</property> + <property name="group">alphabetically</property> </object> </child> </object>