diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2024-12-20 23:48:25 +0100 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2024-12-21 09:31:03 +0100 |
commit | 0f3cf3091666ef393e189b539aa9a808e168df81 (patch) | |
tree | b2647e404f7f7cadf59e73e6b4465ec3c6b6e5ac /vcl/source | |
parent | 9c11d1f4350a1a49eb955d9d280dff0adcabf33b (diff) |
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 <m.weghorn@posteo.de>
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/window/builder.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
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); |