From 0f3cf3091666ef393e189b539aa9a808e168df81 Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Fri, 20 Dec 2024 23:48:25 +0100 Subject: tdf#130857 qt weld: Set menu button's menu defined in .ui file Make the existing local helper function `extractPopupMenu` used by VclBuilder a static method in the BuilderBase base class for reuse by QtBuilder. Use it in QtBuilder::makeObject to evaluate the "popup" property for a "GtkMenuButton" object, get the corresponding QMenu and set it for the button. The code currently assumes that the corresponding menu is aleady known, i.e. was defined earlier in the .ui file than the menu button it belongs to. VclBuilder doesn't rely on that, so a handling similar to there could be implemented as and when needed. Change-Id: I95446fb7a369f2cfee0d8d51432933582bbfd570 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178972 Tested-by: Jenkins Reviewed-by: Michael Weghorn --- vcl/source/window/builder.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'vcl/source') diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index ed59785cc791..df2df8235f68 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -878,11 +878,6 @@ namespace return extractBoolEntry(rMap, u"draw-value"_ustr, true); } - OUString extractPopupMenu(VclBuilder::stringmap& rMap) - { - return extractStringEntry(rMap, u"popup"_ustr); - } - OUString extractWidgetName(VclBuilder::stringmap& rMap) { return extractStringEntry(rMap, u"name"_ustr); @@ -3407,6 +3402,11 @@ OUString BuilderBase::extractLabel(VclBuilder::stringmap& rMap) return extractStringEntry(rMap, u"label"_ustr); } +OUString BuilderBase::extractPopupMenu(stringmap& rMap) +{ + return extractStringEntry(rMap, u"popup"_ustr); +} + bool BuilderBase::extractResizable(stringmap& rMap) { return extractBoolEntry(rMap, u"resizable"_ustr, true); -- cgit