PythonQt.QtGui.QMenuBar · declarations 001
Back to PythonQt.QtGui.QMenuBar
actionAt
actionAt(arg__1: Any) -> Any
X.actionAt(arg__1) -> PythonQt.QtGui.QAction
Supplemental documentation: Qt 5 reference:
QAction *QMenuBar::actionAt(const QPoint \&pt) const
Returns the QAction at pt. Returns
nullptr if there is no action at pt or if the location has a separator.
See also addAction() and addSeparator().
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/qmenubar.html#actionAt
actionEvent
actionEvent(arg__1: Any) -> None
X.actionEvent(arg__1)
Supplemental documentation: Qt 5 reference:
[override virtual protected] void QMenuBar::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/qmenubar.html#actionEvent
actionGeometry
actionGeometry(arg__1: Any) -> Any
X.actionGeometry(arg__1) -> PythonQt.QtCore.QRect
Supplemental documentation: Qt 5 reference:
QRect QMenuBar::actionGeometry(QAction *act) const
Returns the geometry of action act as a QRect.
See also actionAt().
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/qmenubar.html#actionGeometry
activeAction
activeAction() -> Any
X.activeAction() -> PythonQt.QtGui.QAction
Supplemental documentation: Qt 5 reference:
QAction *QMenuBar::activeAction() const
Returns the QAction that is currently
highlighted, if any, else nullptr.
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/qmenubar.html#activeAction
addAction
addAction(text: Any, receiver: Any, member: Any) -> Any
X.addAction(text, receiver, member) -> PythonQt.QtGui.QAction
Supplemental documentation: Qt 5 reference:
QAction *QMenuBar::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.
See also QWidget::addAction() and QWidget::actions().
QAction *QMenuBar::addAction(const QString \&text, const QObject *receiver, const char *member)
This is an overloaded function.
This convenience function creates a new action with the given text. 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.
See also QWidget::addAction() and QWidget::actions().
template \<typename Obj, typename PointerToMemberFunctionOrFunctor> QAction *QMenuBar::addAction(const QString \&text, const Obj *receiver, PointerToMemberFunctionOrFunctor method)
This is an overloaded function.
This convenience function creates a new action with the given text. The action's triggered() signal is connected to the method of the receiver. The function adds the newly created action to the menu's list of actions and returns it.
QMenuBar takes ownership of the returned QAction.
This function was introduced in Qt 5.11.
See also QWidget::addAction() and QWidget::actions().
template \<typename Functor> QAction *QMenuBar::addAction(const QString \&text, Functor functor)
This is an overloaded function.
This convenience function creates a new action with the given text. 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.
QMenuBar takes ownership of the returned QAction.
This function was introduced in Qt 5.11.
See also QWidget::addAction() and QWidget::actions().
Upstream PySide2 reference signatures (binding differences may apply):
addAction(self, arg__1: PySide2.QtWidgets.QAction) -> None
addAction(self, arg__1: str, arg__2: object) -> None
addAction(self, text: str) -> PySide2.QtWidgets.QAction
addAction(self, text: str, receiver: PySide2.QtCore.QObject, member: str) -> PySide2.QtWidgets.QAction
Source: https://doc.qt.io/archives/qt-5.15/qmenubar.html#addAction
addMenu
addMenu(icon: Any, title: Any) -> Any
X.addMenu(icon, title) -> PythonQt.QtGui.QAction
Supplemental documentation: Qt 5 reference:
QAction *QMenuBar::addMenu(QMenu *menu)
Appends menu to the menu bar. Returns the menu's menuAction(). The menu bar does not take ownership of the menu.
Note: The returned QAction object can be used to hide the corresponding menu.
See also QWidget::addAction() and QMenu::menuAction().
QMenu *QMenuBar::addMenu(const QString \&title)
Appends a new QMenu with title to the menu bar. The menu bar takes ownership of the menu. Returns the new menu.
See also QWidget::addAction() and QMenu::menuAction().
QMenu *QMenuBar::addMenu(const QIcon \&icon, const QString \&title)
Appends a new QMenu with icon and title to the menu bar. The menu bar 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/qmenubar.html#addMenu
addSeparator
addSeparator() -> Any
X.addSeparator() -> PythonQt.QtGui.QAction
Supplemental documentation: Qt 5 reference:
QAction *QMenuBar::addSeparator()
Appends a separator to the menu.
Upstream PySide2 reference signatures (binding differences may apply):
addSeparator(self) -> PySide2.QtWidgets.QAction
Source: https://doc.qt.io/archives/qt-5.15/qmenubar.html#addSeparator
changeEvent
changeEvent(arg__1: Any) -> None
X.changeEvent(arg__1)
Supplemental documentation: Qt 5 reference:
[override virtual protected] void QMenuBar::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/qmenubar.html#changeEvent
clear
clear() -> None
X.clear()
Supplemental documentation: Qt 5 reference:
void QMenuBar::clear()
Removes all the actions from the menu bar.
Note: On macOS, menu items that have been merged to the system menu bar are not removed by this function. One way to handle this would be to remove the extra actions yourself. You can set the menu role on the different menus, so that you know ahead of time which menu items get merged and which do not. Then decide what to recreate or remove yourself.
See also removeAction().
Upstream PySide2 reference signatures (binding differences may apply):
clear(self) -> None
Source: https://doc.qt.io/archives/qt-5.15/qmenubar.html#clear
cornerWidget
cornerWidget(corner: Any) -> Any
X.cornerWidget(corner) -> PythonQt.QtGui.QWidget
Supplemental documentation: Qt 5 reference:
QWidget *QMenuBar::cornerWidget(Qt::Corner corner \= Qt::TopRightCorner) const
Returns the widget on the left of the first or on the right of the last menu item, depending on corner.
Note: Using a corner other than Qt::TopRightCorner or Qt::TopLeftCorner will result in a warning.
See also setCornerWidget().
Upstream PySide2 reference signatures (binding differences may apply):
cornerWidget(self, corner: PySide2.QtCore.Qt.Corner=...) -> PySide2.QtWidgets.QWidget
Source: https://doc.qt.io/archives/qt-5.15/qmenubar.html#cornerWidget
customContextMenuRequested
customContextMenuRequested(*args: Any, **kwargs: Any) -> Any
Native PythonQt.QtGui.QMenuBar.customContextMenuRequested; argument details are not documented.
defaultUp
instance-attribute
defaultUp: Any
Qt 5 reference:
defaultUp : bool
This property holds the popup orientation
The default popup orientation. By default, menus pop "down" the screen. By setting the property to true, the menu will pop "up". You might call this for menus that are below the document to which they refer.
If the menu would not fit on the screen, the other direction is used automatically.
Access functions:
| bool | isDefaultUp() const |
|---|---|
| void | setDefaultUp(bool) |
Source: https://doc.qt.io/archives/qt-5.15/qmenubar.html#defaultUp
destroyed
destroyed(*args: Any, **kwargs: Any) -> Any
Native PythonQt.QtGui.QMenuBar.destroyed; argument details are not documented.
event
event(arg__1: Any) -> bool
X.event(arg__1) -> bool
Supplemental documentation: Qt 5 reference:
[override virtual protected] bool QMenuBar::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/qmenubar.html#event
eventFilter
eventFilter(arg__1: Any, arg__2: Any) -> bool
X.eventFilter(arg__1, arg__2) -> bool
Supplemental documentation: Qt 5 reference:
[override virtual protected] bool QMenuBar::eventFilter(QObject *object, QEvent *event)
Reimplements: QObject::eventFilter(QObject *watched, QEvent *event).
Upstream PySide2 reference signatures (binding differences may apply):
eventFilter(self, arg__1: PySide2.QtCore.QObject, arg__2: PySide2.QtCore.QEvent) -> bool
Source: https://doc.qt.io/archives/qt-5.15/qmenubar.html#eventFilter
focusInEvent
focusInEvent(arg__1: Any) -> None
X.focusInEvent(arg__1)
Supplemental documentation: Qt 5 reference:
[override virtual protected] void QMenuBar::focusInEvent(QFocusEvent *)
Reimplements: QWidget::focusInEvent(QFocusEvent *event).
Upstream PySide2 reference signatures (binding differences may apply):
focusInEvent(self, arg__1: PySide2.QtGui.QFocusEvent) -> None
Source: https://doc.qt.io/archives/qt-5.15/qmenubar.html#focusInEvent
focusOutEvent
focusOutEvent(arg__1: Any) -> None
X.focusOutEvent(arg__1)
Supplemental documentation: Qt 5 reference:
[override virtual protected] void QMenuBar::focusOutEvent(QFocusEvent *)
Reimplements: QWidget::focusOutEvent(QFocusEvent *event).
Upstream PySide2 reference signatures (binding differences may apply):
focusOutEvent(self, arg__1: PySide2.QtGui.QFocusEvent) -> None
Source: https://doc.qt.io/archives/qt-5.15/qmenubar.html#focusOutEvent
heightForWidth
heightForWidth(arg__1: int) -> int
X.heightForWidth(arg__1) -> int
Supplemental documentation: Qt 5 reference:
[override virtual] int QMenuBar::heightForWidth(int) const
Reimplements: QWidget::heightForWidth(int w) const.
Upstream PySide2 reference signatures (binding differences may apply):
heightForWidth(self, arg__1: int) -> int
Source: https://doc.qt.io/archives/qt-5.15/qmenubar.html#heightForWidth
hovered
hovered(*args: Any, **kwargs: Any) -> Any
Native PythonQt.QtGui.QMenuBar.hovered; argument details are not documented.
Supplemental documentation: Qt 5 reference:
[signal] void QMenuBar::hovered(QAction *action)
This signal is emitted when a menu action is highlighted; action is the action that caused the event to be sent.
Often this is used to update status information.
See also triggered() and QAction::hovered().
Source: https://doc.qt.io/archives/qt-5.15/qmenubar.html#hovered
initStyleOption
initStyleOption(option: Any, action: Any) -> None
X.initStyleOption(option, action)
Supplemental documentation: Qt 5 reference:
[protected] void QMenuBar::initStyleOption(QStyleOptionMenuItem *option, const QAction *action) const
Initialize option with the values from the menu bar 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 QMenu::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/qmenubar.html#initStyleOption
insertMenu
insertMenu(before: Any, menu: Any) -> Any
X.insertMenu(before, menu) -> PythonQt.QtGui.QAction
Supplemental documentation: Qt 5 reference:
QAction *QMenuBar::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/qmenubar.html#insertMenu
insertSeparator
insertSeparator(before: Any) -> Any
X.insertSeparator(before) -> PythonQt.QtGui.QAction
Supplemental documentation: Qt 5 reference:
QAction *QMenuBar::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 bar's list of actions before action before and returns it.
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/qmenubar.html#insertSeparator
isDefaultUp
isDefaultUp() -> bool
X.isDefaultUp() -> bool
Upstream PySide2 reference signatures (binding differences may apply):
isDefaultUp(self) -> bool
Source: https://doc.qt.io/archives/qt-5.15/qmenubar.html#isDefaultUp
isNativeMenuBar
isNativeMenuBar() -> bool
X.isNativeMenuBar() -> bool
Upstream PySide2 reference signatures (binding differences may apply):
isNativeMenuBar(self) -> bool
Source: https://doc.qt.io/archives/qt-5.15/qmenubar.html#isNativeMenuBar
keyPressEvent
keyPressEvent(arg__1: Any) -> None
X.keyPressEvent(arg__1)
Supplemental documentation: Qt 5 reference:
[override virtual protected] void QMenuBar::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/qmenubar.html#keyPressEvent
leaveEvent
leaveEvent(arg__1: Any) -> None
X.leaveEvent(arg__1)
Supplemental documentation: Qt 5 reference:
[override virtual protected] void QMenuBar::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/qmenubar.html#leaveEvent
minimumSizeHint
instance-attribute
minimumSizeHint: QSize
Qt 5 reference:
[override virtual] QSize QMenuBar::minimumSizeHint() const
Reimplements an access function for property: QWidget::minimumSizeHint.
Source: https://doc.qt.io/archives/qt-5.15/qmenubar.html#minimumSizeHint
mouseMoveEvent
mouseMoveEvent(arg__1: Any) -> None
X.mouseMoveEvent(arg__1)
Supplemental documentation: Qt 5 reference:
[override virtual protected] void QMenuBar::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/qmenubar.html#mouseMoveEvent
mousePressEvent
mousePressEvent(arg__1: Any) -> None
X.mousePressEvent(arg__1)
Supplemental documentation: Qt 5 reference:
[override virtual protected] void QMenuBar::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/qmenubar.html#mousePressEvent
mouseReleaseEvent
mouseReleaseEvent(arg__1: Any) -> None
X.mouseReleaseEvent(arg__1)
Supplemental documentation: Qt 5 reference:
[override virtual protected] void QMenuBar::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/qmenubar.html#mouseReleaseEvent
nativeMenuBar
instance-attribute
nativeMenuBar: Any
Qt 5 reference:
nativeMenuBar : bool
This property holds whether or not a menubar will be used as a native menubar on platforms that support it
This property specifies whether or not the menubar should be used as a native menubar on
platforms that support it. The currently supported platforms are macOS, and Linux
desktops which use the com.canonical.dbusmenu D-Bus interface (such as Ubuntu Unity). If
this property is true, the menubar is used in the native menubar and is not in the
window of its parent; if false the menubar remains in the window. On other platforms,
setting this attribute has no effect, and reading this attribute will always return
false.
The default is to follow whether the Qt::AA_DontUseNativeMenuBar attribute is set for the application. Explicitly setting this property overrides the presence (or absence) of the attribute.
This property was introduced in Qt 4.6.
Access functions:
| bool | isNativeMenuBar() const |
|---|---|
| void | setNativeMenuBar(bool nativeMenuBar) |
Source: https://doc.qt.io/archives/qt-5.15/qmenubar.html#nativeMenuBar
objectNameChanged
objectNameChanged(*args: Any, **kwargs: Any) -> Any
Native PythonQt.QtGui.QMenuBar.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 QMenuBar::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/qmenubar.html#paintEvent
resizeEvent
resizeEvent(arg__1: Any) -> None
X.resizeEvent(arg__1)
Supplemental documentation: Qt 5 reference:
[override virtual protected] void QMenuBar::resizeEvent(QResizeEvent *)
Reimplements: QWidget::resizeEvent(QResizeEvent *event).
Upstream PySide2 reference signatures (binding differences may apply):
resizeEvent(self, arg__1: PySide2.QtGui.QResizeEvent) -> None
Source: https://doc.qt.io/archives/qt-5.15/qmenubar.html#resizeEvent
setActiveAction
setActiveAction(action: Any) -> None
X.setActiveAction(action)
Supplemental documentation: Qt 5 reference:
void QMenuBar::setActiveAction(QAction *act)
Sets the currently highlighted action to act.
This function was introduced in Qt 4.1.
See also activeAction().
Upstream PySide2 reference signatures (binding differences may apply):
setActiveAction(self, action: PySide2.QtWidgets.QAction) -> None
Source: https://doc.qt.io/archives/qt-5.15/qmenubar.html#setActiveAction
setCornerWidget
setCornerWidget(w: Any, corner: Any) -> None
X.setCornerWidget(w, corner)
Supplemental documentation: Qt 5 reference:
void QMenuBar::setCornerWidget(QWidget *widget, Qt::Corner corner \= Qt::TopRightCorner)
This sets the given widget to be shown directly on the left of the first menu item, or on the right of the last menu item, depending on corner.
The menu bar takes ownership of widget, reparenting it into the menu bar. However, if the corner already contains a widget, this previous widget will no longer be managed and will still be a visible child of the menu bar.
Note: Using a corner other than Qt::TopRightCorner or Qt::TopLeftCorner will result in a warning.
See also cornerWidget().
Upstream PySide2 reference signatures (binding differences may apply):
setCornerWidget(self, w: PySide2.QtWidgets.QWidget, corner: PySide2.QtCore.Qt.Corner=...) -> None
Source: https://doc.qt.io/archives/qt-5.15/qmenubar.html#setCornerWidget
setDefaultUp
setDefaultUp(arg__1: bool) -> None
X.setDefaultUp(arg__1)
Upstream PySide2 reference signatures (binding differences may apply):
setDefaultUp(self, arg__1: bool) -> None
Source: https://doc.qt.io/archives/qt-5.15/qmenubar.html#setDefaultUp
setNativeMenuBar
setNativeMenuBar(nativeMenuBar: bool) -> None
X.setNativeMenuBar(nativeMenuBar)
Upstream PySide2 reference signatures (binding differences may apply):
setNativeMenuBar(self, nativeMenuBar: bool) -> None
Source: https://doc.qt.io/archives/qt-5.15/qmenubar.html#setNativeMenuBar
setVisible
setVisible(visible: bool) -> None
X.setVisible(visible)
Supplemental documentation: Qt 5 reference:
[override virtual slot] void QMenuBar::setVisible(bool visible)
Reimplements an access function for property: QWidget::visible.
Upstream PySide2 reference signatures (binding differences may apply):
setVisible(self, visible: bool) -> None
Source: https://doc.qt.io/archives/qt-5.15/qmenubar.html#setVisible
sizeHint
instance-attribute
sizeHint: QSize
Qt 5 reference:
[override virtual] QSize QMenuBar::sizeHint() const
Reimplements an access function for property: QWidget::sizeHint.
Source: https://doc.qt.io/archives/qt-5.15/qmenubar.html#sizeHint