diff options
author | Cristián Maureira-Fredes <Cristian.Maureira-Fredes@qt.io> | 2022-04-07 11:00:26 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2022-04-08 01:37:00 +0200 |
commit | c85df0b37c4e91ff4d61091c06d0f75734356990 (patch) | |
tree | a17d92c05ef8a268637f24c81d26a778a32b0ff0 /sources/pyside6/PySide6/glue/qtgui.cpp | |
parent | d375273ba0d6fed567a5b8cc386395b10f5f2bda (diff) |
QAction: Add setMenu() and menu()
After the changes in Qt6 related to moving QAction completely to
QtGui, the 'on-demand' functions associated to QMenu were not properly
exposed.
This patch manually adds setMenu()/menu() using QObject's.
A simple test case was added.
[ChangeLog] QAction.setMenu() and QAction.menu() were implemented.
Done-with: Friedemann Kleint <Friedemann.Kleint@qt.io>
Pick-to: 6.2
Fixes: PYSIDE-1627
Change-Id: Ib8102a9cf513ee2e13ff71751b1167ca0146af31
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'sources/pyside6/PySide6/glue/qtgui.cpp')
-rw-r--r-- | sources/pyside6/PySide6/glue/qtgui.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sources/pyside6/PySide6/glue/qtgui.cpp b/sources/pyside6/PySide6/glue/qtgui.cpp index b312180b7..8cfdd69a3 100644 --- a/sources/pyside6/PySide6/glue/qtgui.cpp +++ b/sources/pyside6/PySide6/glue/qtgui.cpp @@ -136,6 +136,12 @@ QAccessibleInterface *PySideAccessibleFactory::callFactories(const QString &key, PySideAccessibleFactory::ensureInstance()->installFactory(%1); // @snippet qaccessible-installfactory +// @snippet qaction-menu +// %CPPSELF->menu(); // pretend it was called. +QObject *object = %CPPSELF->menu<QObject *>(); +%PYARG_0 = %CONVERTTOPYTHON[QObject*](object); +// @snippet qaction-menu + // @snippet glgetshadersource GLsizei bufSize = 4096; GLsizei length = bufSize - 1; |