Skip to content

PythonQt.QtGui.QMenu · declarations 001

Back to PythonQt.QtGui.QMenu

aboutToHide

aboutToHide(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QMenu.aboutToHide; argument details are not documented.

Supplemental documentation: Qt 5 reference:

[signal] void QMenu::aboutToHide()

This signal is emitted just before the menu is hidden from the user.

This function was introduced in Qt 4.2.

See also aboutToShow() and hide().

Source: https://doc.qt.io/archives/qt-5.15/qmenu.html#aboutToHide

aboutToShow

aboutToShow(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QMenu.aboutToShow; argument details are not documented.

Supplemental documentation: Qt 5 reference:

[signal] void QMenu::aboutToShow()

This signal is emitted just before the menu is shown to the user.

See also aboutToHide() and show().

Source: https://doc.qt.io/archives/qt-5.15/qmenu.html#aboutToShow

actionAt

actionAt(arg__1: Any) -> Any

X.actionAt(arg__1) -> PythonQt.QtGui.QAction

Supplemental documentation: Qt 5 reference:

QAction *QMenu::actionAt(const QPoint \&pt) const

Returns the item at pt; returns nullptr if there is no item there.

Upstream PySide2 reference signatures (binding differences may apply):

actionAt(self, arg__1: PySide2.QtCore.QPoint) -> PySide2.QtWidgets.QAction

Source: https://doc.qt.io/archives/qt-5.15/qmenu.html#actionAt

actionEvent

actionEvent(arg__1: Any) -> None

X.actionEvent(arg__1)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QMenu::actionEvent(QActionEvent *e)

Reimplements: QWidget::actionEvent(QActionEvent *event).

Upstream PySide2 reference signatures (binding differences may apply):

actionEvent(self, arg__1: PySide2.QtGui.QActionEvent) -> None

Source: https://doc.qt.io/archives/qt-5.15/qmenu.html#actionEvent

actionGeometry

actionGeometry(arg__1: Any) -> Any

X.actionGeometry(arg__1) -> PythonQt.QtCore.QRect

Supplemental documentation: Qt 5 reference:

QRect QMenu::actionGeometry(QAction *act) const

Returns the geometry of action act.

Upstream PySide2 reference signatures (binding differences may apply):

actionGeometry(self, arg__1: PySide2.QtWidgets.QAction) -> PySide2.QtCore.QRect

Source: https://doc.qt.io/archives/qt-5.15/qmenu.html#actionGeometry

activeAction

activeAction() -> Any

X.activeAction() -> PythonQt.QtGui.QAction

Supplemental documentation: Qt 5 reference:

QAction *QMenu::activeAction() const

Returns the currently highlighted action, or nullptr if no action is currently highlighted.

See also setActiveAction().

Upstream PySide2 reference signatures (binding differences may apply):

activeAction(self) -> PySide2.QtWidgets.QAction

Source: https://doc.qt.io/archives/qt-5.15/qmenu.html#activeAction

addAction

addAction(icon: Any, text: Any, receiver: Any, member: Any, shortcut: Any) -> Any

X.addAction(icon, text, receiver, member, shortcut) -> PythonQt.QtGui.QAction

Supplemental documentation: Qt 5 reference:

QAction *QMenu::addAction(const QString \&text)

This convenience function creates a new action with text. The function adds the newly created action to the menu's list of actions, and returns it.

QMenu takes ownership of the returned QAction.

See also QWidget::addAction().

QAction *QMenu::addAction(const QIcon \&icon, const QString \&text)

This is an overloaded function.

This convenience function creates a new action with an icon and some text. The function adds the newly created action to the menu's list of actions, and returns it.

QMenu takes ownership of the returned QAction.

See also QWidget::addAction().

QAction *QMenu::addAction(const QString \&text, const QObject *receiver, const char *member, const QKeySequence \&shortcut \= 0)

This is an overloaded function.

This convenience function creates a new action with the text text and an optional shortcut shortcut. The action's triggered() signal is connected to the receiver's member slot. The function adds the newly created action to the menu's list of actions and returns it.

QMenu takes ownership of the returned QAction.

See also QWidget::addAction().

QAction *QMenu::addAction(const QIcon \&icon, const QString \&text, const QObject *receiver, const char *member, const QKeySequence \&shortcut \= 0)

This is an overloaded function.

This convenience function creates a new action with an icon and some text and an optional shortcut shortcut. The action's triggered() signal is connected to the member slot of the receiver object. The function adds the newly created action to the menu's list of actions, and returns it.

QMenu takes ownership of the returned QAction.

See also QWidget::addAction().

template \<typename Functor> QAction *QMenu::addAction(const QString \&text, Functor functor, const QKeySequence \&shortcut \= 0)

This is an overloaded function.

This convenience function creates a new action with the text text and an optional shortcut shortcut. The action's triggered() signal is connected to the functor. The function adds the newly created action to the menu's list of actions and returns it.

QMenu takes ownership of the returned QAction.

This function was introduced in Qt 5.6.

template \<typename Functor> QAction *QMenu::addAction(const QString \&text, const QObject *context, Functor functor, const QKeySequence \&shortcut \= 0)

This is an overloaded function.

This convenience function creates a new action with the text text and an optional shortcut shortcut. The action's triggered() signal is connected to the functor. The functor can be a pointer to a member function of the context object. The newly created action is added to the menu's list of actions and a pointer to it is returned.

If the context object is destroyed, the functor will not be called.

QMenu takes ownership of the returned QAction.

This function was introduced in Qt 5.6.

template \<typename Functor> QAction *QMenu::addAction(const QIcon \&icon, const QString \&text, Functor functor, const QKeySequence \&shortcut \= 0)

This is an overloaded function.

This convenience function creates a new action with an icon and some text and an optional shortcut shortcut. The action's triggered() signal is connected to the functor. The function adds the newly created action to the menu's list of actions and returns it.

QMenu takes ownership of the returned QAction.

This function was introduced in Qt 5.6.

template \<typename Functor> QAction *QMenu::addAction(const QIcon \&icon, const QString \&text, const QObject *context, Functor functor, const QKeySequence \&shortcut \= 0)

This is an overloaded function.

This convenience function creates a new action with an icon and some text and an optional shortcut shortcut. The action's triggered() signal is connected to the functor. The functor can be a pointer to a member function of the context object. The newly created action is added to the menu's list of actions and a pointer to it is returned.

If context is destroyed, the functor will not be called.

QMenu takes ownership of the returned QAction.

This function was introduced in Qt 5.6.

Upstream PySide2 reference signatures (binding differences may apply):

addAction(self, arg__1: PySide2.QtGui.QIcon, arg__2: str, arg__3: object, arg__4: typing.Optional[PySide2.QtGui.QKeySequence]=...) -> None
addAction(self, arg__1: PySide2.QtWidgets.QAction) -> None
addAction(self, arg__1: str, arg__2: object, arg__3: typing.Optional[PySide2.QtGui.QKeySequence]=...) -> None
addAction(self, icon: PySide2.QtGui.QIcon, text: str) -> PySide2.QtWidgets.QAction
addAction(self, icon: PySide2.QtGui.QIcon, text: str, receiver: PySide2.QtCore.QObject, member: str, shortcut: typing.Optional[PySide2.QtGui.QKeySequence]=...) -> PySide2.QtWidgets.QAction
addAction(self, text: str) -> PySide2.QtWidgets.QAction
addAction(self, text: str, receiver: PySide2.QtCore.QObject, member: str, shortcut: typing.Optional[PySide2.QtGui.QKeySequence]=...) -> PySide2.QtWidgets.QAction

Source: https://doc.qt.io/archives/qt-5.15/qmenu.html#addAction

addMenu

addMenu(icon: Any, title: Any) -> Any

X.addMenu(icon, title) -> PythonQt.QtGui.QAction

Supplemental documentation: Qt 5 reference:

QAction *QMenu::addMenu(QMenu *menu)

This convenience function adds menu as a submenu to this menu. It returns menu's menuAction(). This menu does not take ownership of menu.

See also QWidget::addAction() and QMenu::menuAction().

QMenu *QMenu::addMenu(const QString \&title)

Appends a new QMenu with title to the menu. The menu takes ownership of the menu. Returns the new menu.

See also QWidget::addAction() and QMenu::menuAction().

QMenu *QMenu::addMenu(const QIcon \&icon, const QString \&title)

Appends a new QMenu with icon and title to the menu. The menu takes ownership of the menu. Returns the new menu.

See also QWidget::addAction() and QMenu::menuAction().

Upstream PySide2 reference signatures (binding differences may apply):

addMenu(self, icon: PySide2.QtGui.QIcon, title: str) -> PySide2.QtWidgets.QMenu
addMenu(self, menu: PySide2.QtWidgets.QMenu) -> PySide2.QtWidgets.QAction
addMenu(self, title: str) -> PySide2.QtWidgets.QMenu

Source: https://doc.qt.io/archives/qt-5.15/qmenu.html#addMenu

addSection

addSection(icon: Any, text: str) -> Any

X.addSection(icon, text) -> PythonQt.QtGui.QAction

Supplemental documentation: Qt 5 reference:

QAction *QMenu::addSection(const QString \&text)

This convenience function creates a new section action, i.e. an action with QAction::isSeparator() returning true but also having text hint, and adds the new action to this menu's list of actions. It returns the newly created action.

The rendering of the hint is style and platform dependent. Widget styles can use the text information in the rendering for sections, or can choose to ignore it and render sections like simple separators.

QMenu takes ownership of the returned QAction.

This function was introduced in Qt 5.1.

See also QWidget::addAction().

QAction *QMenu::addSection(const QIcon \&icon, const QString \&text)

This convenience function creates a new section action, i.e. an action with QAction::isSeparator() returning true but also having text and icon hints, and adds the new action to this menu's list of actions. It returns the newly created action.

The rendering of the hints is style and platform dependent. Widget styles can use the text and icon information in the rendering for sections, or can choose to ignore them and render sections like simple separators.

QMenu takes ownership of the returned QAction.

This function was introduced in Qt 5.1.

See also QWidget::addAction().

Upstream PySide2 reference signatures (binding differences may apply):

addSection(self, icon: PySide2.QtGui.QIcon, text: str) -> PySide2.QtWidgets.QAction
addSection(self, text: str) -> PySide2.QtWidgets.QAction

Source: https://doc.qt.io/archives/qt-5.15/qmenu.html#addSection

addSeparator

addSeparator() -> Any

X.addSeparator() -> PythonQt.QtGui.QAction

Supplemental documentation: Qt 5 reference:

QAction *QMenu::addSeparator()

This convenience function creates a new separator action, i.e. an action with QAction::isSeparator() returning true, and adds the new action to this menu's list of actions. It returns the newly created action.

QMenu takes ownership of the returned QAction.

See also QWidget::addAction().

Upstream PySide2 reference signatures (binding differences may apply):

addSeparator(self) -> PySide2.QtWidgets.QAction

Source: https://doc.qt.io/archives/qt-5.15/qmenu.html#addSeparator

changeEvent

changeEvent(arg__1: Any) -> None

X.changeEvent(arg__1)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QMenu::changeEvent(QEvent *e)

Reimplements: QWidget::changeEvent(QEvent *event).

Upstream PySide2 reference signatures (binding differences may apply):

changeEvent(self, arg__1: PySide2.QtCore.QEvent) -> None

Source: https://doc.qt.io/archives/qt-5.15/qmenu.html#changeEvent

clear

clear() -> None

X.clear()

Supplemental documentation: Qt 5 reference:

void QMenu::clear()

Removes all the menu's actions. Actions owned by the menu and not shown in any other widget are deleted.

See also removeAction().

Upstream PySide2 reference signatures (binding differences may apply):

clear(self) -> None

Source: https://doc.qt.io/archives/qt-5.15/qmenu.html#clear

columnCount

columnCount() -> int

X.columnCount() -> int

Supplemental documentation: Qt 5 reference:

[protected] int QMenu::columnCount() const

If a menu does not fit on the screen it lays itself out so that it does fit. It is style dependent what layout means (for example, on Windows it will use multiple columns).

This functions returns the number of columns necessary.

Upstream PySide2 reference signatures (binding differences may apply):

columnCount(self) -> int

Source: https://doc.qt.io/archives/qt-5.15/qmenu.html#columnCount

customContextMenuRequested

customContextMenuRequested(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QMenu.customContextMenuRequested; argument details are not documented.

defaultAction

defaultAction() -> Any

X.defaultAction() -> PythonQt.QtGui.QAction

Supplemental documentation: Qt 5 reference:

QAction *QMenu::defaultAction() const

Returns the current default action.

See also setDefaultAction().

Upstream PySide2 reference signatures (binding differences may apply):

defaultAction(self) -> PySide2.QtWidgets.QAction

Source: https://doc.qt.io/archives/qt-5.15/qmenu.html#defaultAction

destroyed

destroyed(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QMenu.destroyed; argument details are not documented.

enterEvent

enterEvent(arg__1: Any) -> None

X.enterEvent(arg__1)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QMenu::enterEvent(QEvent *)

Reimplements: QWidget::enterEvent(QEvent *event).

Upstream PySide2 reference signatures (binding differences may apply):

enterEvent(self, arg__1: PySide2.QtCore.QEvent) -> None

Source: https://doc.qt.io/archives/qt-5.15/qmenu.html#enterEvent

event

event(arg__1: Any) -> bool

X.event(arg__1) -> bool

Supplemental documentation: Qt 5 reference:

[override virtual protected] bool QMenu::event(QEvent *e)

Reimplements: QWidget::event(QEvent *event).

Upstream PySide2 reference signatures (binding differences may apply):

event(self, arg__1: PySide2.QtCore.QEvent) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qmenu.html#event

exec

exec(pos: Any, at: Any, parent: Any) -> Any

X.exec(pos, at, parent) -> PythonQt.QtGui.QAction

Supplemental documentation: Qt 5 reference:

QAction *QMenu::exec()

Executes this menu synchronously.

This is equivalent to exec(pos()).

This returns the triggered QAction in either the popup menu or one of its submenus, or nullptr if no item was triggered (normally because the user pressed Esc).

In most situations you'll want to specify the position yourself, for example, the current mouse position:

exec(QCursor::pos());

or aligned to a widget:

exec(somewidget.mapToGlobal(QPoint(0,0)));

or in reaction to a QMouseEvent *e:

exec(e->globalPos());

QAction *QMenu::exec(const QPoint \&p, QAction *action \= nullptr)

This is an overloaded function.

Executes this menu synchronously.

Pops up the menu so that the action action will be at the specified global position p. To translate a widget's local coordinates into global coordinates, use QWidget::mapToGlobal().

This returns the triggered QAction in either the popup menu or one of its submenus, or nullptr if no item was triggered (normally because the user pressed Esc).

Note that all signals are emitted as usual. If you connect a QAction to a slot and call the menu's exec(), you get the result both via the signal-slot connection and in the return value of exec().

Common usage is to position the menu at the current mouse position:

exec(QCursor::pos());

or aligned to a widget:

exec(somewidget.mapToGlobal(QPoint(0, 0)));

or in reaction to a QMouseEvent *e:

exec(e->globalPos());

When positioning a menu with exec() or popup(), bear in mind that you cannot rely on the menu's current size(). For performance reasons, the menu adapts its size only when necessary. So in many cases, the size before and after the show is different. Instead, use sizeHint() which calculates the proper size depending on the menu's current contents.

See also popup() and QWidget::mapToGlobal().

[static] QAction *QMenu::exec(QList\<QAction *> actions, const QPoint \&pos, QAction *at \= nullptr, QWidget *parent \= nullptr)

This is an overloaded function.

Executes a menu synchronously.

The menu's actions are specified by the list of actions. The menu will pop up so that the specified action, at, appears at global position pos. If at is not specified then the menu appears at position pos. parent is the menu's parent widget; specifying the parent will provide context when pos alone is not enough to decide where the menu should go (e.g., with multiple desktops or when the parent is embedded in QGraphicsView).

The function returns the triggered QAction in either the popup menu or one of its submenus, or nullptr if no item was triggered (normally because the user pressed Esc).

This is equivalent to:

QMenu menu;
QAction *at = actions[0]; // Assumes actions is not empty
for (QAction *a : qAsConst(actions))
    menu.addAction(a);
menu.exec(pos, at);

See also popup() and QWidget::mapToGlobal().

Source: https://doc.qt.io/archives/qt-5.15/qmenu.html#exec

focusNextPrevChild

focusNextPrevChild(next: bool) -> bool

X.focusNextPrevChild(next) -> bool

Supplemental documentation: Qt 5 reference:

[override virtual protected] bool QMenu::focusNextPrevChild(bool next)

Reimplements: QWidget::focusNextPrevChild(bool next).

Upstream PySide2 reference signatures (binding differences may apply):

focusNextPrevChild(self, next: bool) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qmenu.html#focusNextPrevChild

hideEvent

hideEvent(arg__1: Any) -> None

X.hideEvent(arg__1)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QMenu::hideEvent(QHideEvent *)

Reimplements: QWidget::hideEvent(QHideEvent *event).

Upstream PySide2 reference signatures (binding differences may apply):

hideEvent(self, arg__1: PySide2.QtGui.QHideEvent) -> None

Source: https://doc.qt.io/archives/qt-5.15/qmenu.html#hideEvent

hideTearOffMenu

hideTearOffMenu() -> None

X.hideTearOffMenu()

Supplemental documentation: Qt 5 reference:

void QMenu::hideTearOffMenu()

This function will forcibly hide the torn off menu making it disappear from the user's desktop.

See also showTearOffMenu(), isTearOffMenuVisible(), and isTearOffEnabled().

Upstream PySide2 reference signatures (binding differences may apply):

hideTearOffMenu(self) -> None

Source: https://doc.qt.io/archives/qt-5.15/qmenu.html#hideTearOffMenu

hovered

hovered(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QMenu.hovered; argument details are not documented.

Supplemental documentation: Qt 5 reference:

[signal] void QMenu::hovered(QAction *action)

This signal is emitted when a menu action is highlighted; action is the action that caused the signal to be emitted.

Often this is used to update status information.

See also triggered() and QAction::hovered().

Source: https://doc.qt.io/archives/qt-5.15/qmenu.html#hovered

icon instance-attribute

icon: QIcon

Qt 5 reference:

icon : QIcon

This property holds the icon of the menu

This is equivalent to the QAction::icon property of the menuAction().

By default, if no icon is explicitly set, this property contains a null icon.

Access functions:

QIcon icon() const
void setIcon(const QIcon \&icon)

Source: https://doc.qt.io/archives/qt-5.15/qmenu.html#icon

initStyleOption

initStyleOption(option: Any, action: Any) -> None

X.initStyleOption(option, action)

Supplemental documentation: Qt 5 reference:

[protected] void QMenu::initStyleOption(QStyleOptionMenuItem *option, const QAction *action) const

Initialize option with the values from this menu and information from action. This method is useful for subclasses when they need a QStyleOptionMenuItem, but don't want to fill in all the information themselves.

See also QStyleOption::initFrom() and QMenuBar::initStyleOption().

Upstream PySide2 reference signatures (binding differences may apply):

initStyleOption(self, option: PySide2.QtWidgets.QStyleOptionMenuItem, action: PySide2.QtWidgets.QAction) -> None

Source: https://doc.qt.io/archives/qt-5.15/qmenu.html#initStyleOption

insertMenu

insertMenu(before: Any, menu: Any) -> Any

X.insertMenu(before, menu) -> PythonQt.QtGui.QAction

Supplemental documentation: Qt 5 reference:

QAction *QMenu::insertMenu(QAction *before, QMenu *menu)

This convenience function inserts menu before action before and returns the menus menuAction().

See also QWidget::insertAction() and addMenu().

Upstream PySide2 reference signatures (binding differences may apply):

insertMenu(self, before: PySide2.QtWidgets.QAction, menu: PySide2.QtWidgets.QMenu) -> PySide2.QtWidgets.QAction

Source: https://doc.qt.io/archives/qt-5.15/qmenu.html#insertMenu

insertSection

insertSection(before: Any, icon: Any, text: str) -> Any

X.insertSection(before, icon, text) -> PythonQt.QtGui.QAction

Supplemental documentation: Qt 5 reference:

QAction *QMenu::insertSection(QAction *before, const QString \&text)

This convenience function creates a new title action, i.e. an action with QAction::isSeparator() returning true but also having text hint. The function inserts the newly created action into this menu's list of actions before action before and returns it.

The rendering of the hint is style and platform dependent. Widget styles can use the text information in the rendering for sections, or can choose to ignore it and render sections like simple separators.

QMenu takes ownership of the returned QAction.

This function was introduced in Qt 5.1.

See also QWidget::insertAction() and addSection().

QAction *QMenu::insertSection(QAction *before, const QIcon \&icon, const QString \&text)

This convenience function creates a new title action, i.e. an action with QAction::isSeparator() returning true but also having text and icon hints. The function inserts the newly created action into this menu's list of actions before action before and returns it.

The rendering of the hints is style and platform dependent. Widget styles can use the text and icon information in the rendering for sections, or can choose to ignore them and render sections like simple separators.

QMenu takes ownership of the returned QAction.

This function was introduced in Qt 5.1.

See also QWidget::insertAction() and addSection().

Upstream PySide2 reference signatures (binding differences may apply):

insertSection(self, before: PySide2.QtWidgets.QAction, icon: PySide2.QtGui.QIcon, text: str) -> PySide2.QtWidgets.QAction
insertSection(self, before: PySide2.QtWidgets.QAction, text: str) -> PySide2.QtWidgets.QAction

Source: https://doc.qt.io/archives/qt-5.15/qmenu.html#insertSection

insertSeparator

insertSeparator(before: Any) -> Any

X.insertSeparator(before) -> PythonQt.QtGui.QAction

Supplemental documentation: Qt 5 reference:

QAction *QMenu::insertSeparator(QAction *before)

This convenience function creates a new separator action, i.e. an action with QAction::isSeparator() returning true. The function inserts the newly created action into this menu's list of actions before action before and returns it.

QMenu takes ownership of the returned QAction.

See also QWidget::insertAction() and addSeparator().

Upstream PySide2 reference signatures (binding differences may apply):

insertSeparator(self, before: PySide2.QtWidgets.QAction) -> PySide2.QtWidgets.QAction

Source: https://doc.qt.io/archives/qt-5.15/qmenu.html#insertSeparator

isEmpty

isEmpty() -> bool

X.isEmpty() -> bool

Supplemental documentation: Qt 5 reference:

bool QMenu::isEmpty() const

Returns true if there are no visible actions inserted into the menu, false otherwise.

This function was introduced in Qt 4.2.

See also QWidget::actions().

Upstream PySide2 reference signatures (binding differences may apply):

isEmpty(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qmenu.html#isEmpty

isTearOffEnabled

isTearOffEnabled() -> bool

X.isTearOffEnabled() -> bool

Upstream PySide2 reference signatures (binding differences may apply):

isTearOffEnabled(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qmenu.html#isTearOffEnabled

isTearOffMenuVisible

isTearOffMenuVisible() -> bool

X.isTearOffMenuVisible() -> bool

Supplemental documentation: Qt 5 reference:

bool QMenu::isTearOffMenuVisible() const

When a menu is torn off a second menu is shown to display the menu contents in a new window. When the menu is in this mode and the menu is visible returns true; otherwise false.

See also showTearOffMenu(), hideTearOffMenu(), and isTearOffEnabled().

Upstream PySide2 reference signatures (binding differences may apply):

isTearOffMenuVisible(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qmenu.html#isTearOffMenuVisible

keyPressEvent

keyPressEvent(arg__1: Any) -> None

X.keyPressEvent(arg__1)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QMenu::keyPressEvent(QKeyEvent *e)

Reimplements: QWidget::keyPressEvent(QKeyEvent *event).

Upstream PySide2 reference signatures (binding differences may apply):

keyPressEvent(self, arg__1: PySide2.QtGui.QKeyEvent) -> None

Source: https://doc.qt.io/archives/qt-5.15/qmenu.html#keyPressEvent

leaveEvent

leaveEvent(arg__1: Any) -> None

X.leaveEvent(arg__1)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QMenu::leaveEvent(QEvent *)

Reimplements: QWidget::leaveEvent(QEvent *event).

Upstream PySide2 reference signatures (binding differences may apply):

leaveEvent(self, arg__1: PySide2.QtCore.QEvent) -> None

Source: https://doc.qt.io/archives/qt-5.15/qmenu.html#leaveEvent

menuAction

menuAction() -> Any

X.menuAction() -> PythonQt.QtGui.QAction

Supplemental documentation: Qt 5 reference:

QAction *QMenu::menuAction() const

Returns the action associated with this menu.

Upstream PySide2 reference signatures (binding differences may apply):

menuAction(self) -> PySide2.QtWidgets.QAction

Source: https://doc.qt.io/archives/qt-5.15/qmenu.html#menuAction

mouseMoveEvent

mouseMoveEvent(arg__1: Any) -> None

X.mouseMoveEvent(arg__1)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QMenu::mouseMoveEvent(QMouseEvent *e)

Reimplements: QWidget::mouseMoveEvent(QMouseEvent *event).

Upstream PySide2 reference signatures (binding differences may apply):

mouseMoveEvent(self, arg__1: PySide2.QtGui.QMouseEvent) -> None

Source: https://doc.qt.io/archives/qt-5.15/qmenu.html#mouseMoveEvent

mousePressEvent

mousePressEvent(arg__1: Any) -> None

X.mousePressEvent(arg__1)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QMenu::mousePressEvent(QMouseEvent *e)

Reimplements: QWidget::mousePressEvent(QMouseEvent *event).

Upstream PySide2 reference signatures (binding differences may apply):

mousePressEvent(self, arg__1: PySide2.QtGui.QMouseEvent) -> None

Source: https://doc.qt.io/archives/qt-5.15/qmenu.html#mousePressEvent

mouseReleaseEvent

mouseReleaseEvent(arg__1: Any) -> None

X.mouseReleaseEvent(arg__1)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QMenu::mouseReleaseEvent(QMouseEvent *e)

Reimplements: QWidget::mouseReleaseEvent(QMouseEvent *event).

Upstream PySide2 reference signatures (binding differences may apply):

mouseReleaseEvent(self, arg__1: PySide2.QtGui.QMouseEvent) -> None

Source: https://doc.qt.io/archives/qt-5.15/qmenu.html#mouseReleaseEvent

objectNameChanged

objectNameChanged(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QMenu.objectNameChanged; argument details are not documented.

paintEvent

paintEvent(arg__1: Any) -> None

X.paintEvent(arg__1)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QMenu::paintEvent(QPaintEvent *e)

Reimplements: QWidget::paintEvent(QPaintEvent *event).

Upstream PySide2 reference signatures (binding differences may apply):

paintEvent(self, arg__1: PySide2.QtGui.QPaintEvent) -> None

Source: https://doc.qt.io/archives/qt-5.15/qmenu.html#paintEvent

popup

popup(pos: Any, at: Any) -> None

X.popup(pos, at)

Supplemental documentation: Qt 5 reference:

void QMenu::popup(const QPoint \&p, QAction *atAction \= nullptr)

Displays the menu so that the action atAction will be at the specified global position p. To translate a widget's local coordinates into global coordinates, use QWidget::mapToGlobal().

When positioning a menu with exec() or popup(), bear in mind that you cannot rely on the menu's current size(). For performance reasons, the menu adapts its size only when necessary, so in many cases, the size before and after the show is different. Instead, use sizeHint() which calculates the proper size depending on the menu's current contents.

See also QWidget::mapToGlobal() and exec().

Upstream PySide2 reference signatures (binding differences may apply):

popup(self, pos: PySide2.QtCore.QPoint, at: typing.Optional[PySide2.QtWidgets.QAction]=...) -> None

Source: https://doc.qt.io/archives/qt-5.15/qmenu.html#popup