Skip to content

PythonQt.QtGui.QGraphicsWidget · declarations 001

Back to PythonQt.QtGui.QGraphicsWidget

actions

actions() -> tuple

X.actions() -> tuple

Supplemental documentation: Qt 5 reference:

QList\<QAction *> QGraphicsWidget::actions() const

Returns the (possibly empty) list of this widget's actions.

This function was introduced in Qt 4.5.

See also insertAction(), removeAction(), QWidget::actions(), QAction::associatedWidgets(), and QAction::associatedGraphicsWidgets().

Upstream PySide2 reference signatures (binding differences may apply):

actions(self) -> typing.List[PySide2.QtWidgets.QAction]

Source: https://doc.qt.io/archives/qt-5.15/qgraphicswidget.html#actions

addAction

addAction(action: Any) -> None

X.addAction(action)

Supplemental documentation: Qt 5 reference:

void QGraphicsWidget::addAction(QAction *action)

Appends the action action to this widget's list of actions.

All QGraphicsWidgets have a list of QActions, however they can be represented graphically in many different ways. The default use of the QAction list (as returned by actions()) is to create a context QMenu.

A QGraphicsWidget should only have one of each action and adding an action it already has will not cause the same action to be in the widget twice.

This function was introduced in Qt 4.5.

See also removeAction(), insertAction(), actions(), and QWidget::addAction().

Upstream PySide2 reference signatures (binding differences may apply):

addAction(self, action: PySide2.QtWidgets.QAction) -> None

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

addActions

addActions(actions: Any) -> None

X.addActions(actions)

Supplemental documentation: Qt 5 reference:

void QGraphicsWidget::addActions(QList\<QAction *> actions)

Appends the actions actions to this widget's list of actions.

This function was introduced in Qt 4.5.

See also removeAction(), QMenu, addAction(), and QWidget::addActions().

Upstream PySide2 reference signatures (binding differences may apply):

addActions(self, actions: typing.Sequence[PySide2.QtWidgets.QAction]) -> None

Source: https://doc.qt.io/archives/qt-5.15/qgraphicswidget.html#addActions

adjustSize

adjustSize() -> None

X.adjustSize()

Supplemental documentation: Qt 5 reference:

void QGraphicsWidget::adjustSize()

Adjusts the size of the widget to its effective preferred size hint.

This function is called implicitly when the item is shown for the first time.

See also effectiveSizeHint() and Qt::MinimumSize.

Upstream PySide2 reference signatures (binding differences may apply):

adjustSize(self) -> None

Source: https://doc.qt.io/archives/qt-5.15/qgraphicswidget.html#adjustSize

autoFillBackground instance-attribute

autoFillBackground: bool

Qt 5 reference:

autoFillBackground : bool

This property holds whether the widget background is filled automatically

If enabled, this property will cause Qt to fill the background of the widget before invoking the paint() method. The color used is defined by the QPalette::Window color role from the widget's palette.

In addition, Windows are always filled with QPalette::Window, unless the WA_OpaquePaintEvent or WA_NoSystemBackground attributes are set.

By default, this property is false.

This property was introduced in Qt 4.7.

Access functions:

bool autoFillBackground() const
void setAutoFillBackground(bool enabled)

See also Qt::WA_OpaquePaintEvent and Qt::WA_NoSystemBackground.

Source: https://doc.qt.io/archives/qt-5.15/qgraphicswidget.html#autoFillBackground

boundingRect

boundingRect() -> Any

X.boundingRect() -> PythonQt.QtCore.QRectF

Supplemental documentation: Qt 5 reference:

[override virtual] QRectF QGraphicsWidget::boundingRect() const

Reimplements: QGraphicsItem::boundingRect() const.

Upstream PySide2 reference signatures (binding differences may apply):

boundingRect(self) -> PySide2.QtCore.QRectF

Source: https://doc.qt.io/archives/qt-5.15/qgraphicswidget.html#boundingRect

changeEvent

changeEvent(event: Any) -> None

X.changeEvent(event)

Supplemental documentation: Qt 5 reference:

[virtual protected] void QGraphicsWidget::changeEvent(QEvent *event)

This event handler can be reimplemented to handle state changes.

The state being changed in this event can be retrieved through event.

Change events include: QEvent::ActivationChange, QEvent::EnabledChange, QEvent::FontChange, QEvent::StyleChange, QEvent::PaletteChange, QEvent::ParentChange, QEvent::LayoutDirectionChange, and QEvent::ContentsRectChange.

Upstream PySide2 reference signatures (binding differences may apply):

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

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

childrenChanged

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

Native PythonQt.QtGui.QGraphicsWidget.childrenChanged; argument details are not documented.

close

close() -> bool

X.close() -> bool

Supplemental documentation: Qt 5 reference:

[slot] bool QGraphicsWidget::close()

Call this function to close the widget.

Returns true if the widget was closed; otherwise returns false. This slot will first send a QCloseEvent to the widget, which may or may not accept the event. If the event was ignored, nothing happens. If the event was accepted, it will hide() the widget.

If the widget has the Qt::WA_DeleteOnClose attribute set it will be deleted.

Upstream PySide2 reference signatures (binding differences may apply):

close(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qgraphicswidget.html#close

closeEvent

closeEvent(event: Any) -> None

X.closeEvent(event)

Supplemental documentation: Qt 5 reference:

[virtual protected] void QGraphicsWidget::closeEvent(QCloseEvent *event)

This event handler, for event, can be reimplemented in a subclass to receive widget close events. The default implementation accepts the event.

See also close() and QCloseEvent.

Upstream PySide2 reference signatures (binding differences may apply):

closeEvent(self, event: PySide2.QtGui.QCloseEvent) -> None

Source: https://doc.qt.io/archives/qt-5.15/qgraphicswidget.html#closeEvent

destroyed

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

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

enabledChanged

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

Native PythonQt.QtGui.QGraphicsWidget.enabledChanged; argument details are not documented.

event

event(event: Any) -> bool

X.event(event) -> bool

Supplemental documentation: Qt 5 reference:

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

Reimplements: QGraphicsObject::event(QEvent *ev).

Handles the event. QGraphicsWidget handles the following events:

Event Usage
Polish Delivered to the widget some time after it has been shown.
GraphicsSceneMove Delivered to the widget after its local position has changed.
GraphicsSceneResize Delivered to the widget after its size has changed.
Show Delivered to the widget before it has been shown.
Hide Delivered to the widget after it has been hidden.
PaletteChange Delivered to the widget after its palette has changed.
FontChange Delivered to the widget after its font has changed.
EnabledChange Delivered to the widget after its enabled state has changed.
StyleChange Delivered to the widget after its style has changed.
LayoutDirectionChange Delivered to the widget after its layout direction has changed.
ContentsRectChange Delivered to the widget after its contents margins/ contents rect has changed.

Upstream PySide2 reference signatures (binding differences may apply):

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

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

focusInEvent

focusInEvent(event: Any) -> None

X.focusInEvent(event)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QGraphicsWidget::focusInEvent(QFocusEvent *event)

Reimplements: QGraphicsItem::focusInEvent(QFocusEvent *event).

Upstream PySide2 reference signatures (binding differences may apply):

focusInEvent(self, event: PySide2.QtGui.QFocusEvent) -> None

Source: https://doc.qt.io/archives/qt-5.15/qgraphicswidget.html#focusInEvent

focusNextPrevChild

focusNextPrevChild(next: bool) -> bool

X.focusNextPrevChild(next) -> bool

Supplemental documentation: Qt 5 reference:

[virtual protected] bool QGraphicsWidget::focusNextPrevChild(bool next)

Finds a new widget to give the keyboard focus to, as appropriate for Tab and Shift+Tab, and returns true if it can find a new widget; returns false otherwise. If next is true, this function searches forward; if next is false, it searches backward.

Sometimes, you will want to reimplement this function to provide special focus handling for your widget and its subwidgets. For example, a web browser might reimplement it to move its current active link forward or backward, and call the base implementation only when it reaches the last or first link on the page.

Child widgets call focusNextPrevChild() on their parent widgets, but only the window that contains the child widgets decides where to redirect focus. By reimplementing this function for an object, you gain control of focus traversal for all child widgets.

See also focusPolicy().

Upstream PySide2 reference signatures (binding differences may apply):

focusNextPrevChild(self, next: bool) -> bool

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

focusOutEvent

focusOutEvent(event: Any) -> None

X.focusOutEvent(event)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QGraphicsWidget::focusOutEvent(QFocusEvent *event)

Reimplements: QGraphicsItem::focusOutEvent(QFocusEvent *event).

Upstream PySide2 reference signatures (binding differences may apply):

focusOutEvent(self, event: PySide2.QtGui.QFocusEvent) -> None

Source: https://doc.qt.io/archives/qt-5.15/qgraphicswidget.html#focusOutEvent

focusPolicy instance-attribute

focusPolicy: Any

Qt 5 reference:

focusPolicy : Qt::FocusPolicy

This property holds the way the widget accepts keyboard focus

The focus policy is Qt::TabFocus if the widget accepts keyboard focus by tabbing, Qt::ClickFocus if the widget accepts focus by clicking, Qt::StrongFocus if it accepts both, and Qt::NoFocus (the default) if it does not accept focus at all.

You must enable keyboard focus for a widget if it processes keyboard events. This is normally done from the widget's constructor. For instance, the QLineEdit constructor calls setFocusPolicy(Qt::StrongFocus).

If you enable a focus policy (i.e., not Qt::NoFocus), QGraphicsWidget will automatically enable the ItemIsFocusable flag. Setting Qt::NoFocus on a widget will clear the ItemIsFocusable flag. If the widget currently has keyboard focus, the widget will automatically lose focus.

Access functions:

Qt::FocusPolicy focusPolicy() const
void setFocusPolicy(Qt::FocusPolicy policy)

See also focusInEvent(), focusOutEvent(), keyPressEvent(), keyReleaseEvent(), and enabled.

Source: https://doc.qt.io/archives/qt-5.15/qgraphicswidget.html#focusPolicy

focusWidget

focusWidget() -> Any

X.focusWidget() -> PythonQt.QtGui.QGraphicsWidget

Supplemental documentation: Qt 5 reference:

QGraphicsWidget *QGraphicsWidget::focusWidget() const

If this widget, a child or descendant of this widget currently has input focus, this function will return a pointer to that widget. If no descendant widget has input focus, nullptr is returned.

See also QGraphicsItem::focusItem() and QWidget::focusWidget().

Upstream PySide2 reference signatures (binding differences may apply):

focusWidget(self) -> PySide2.QtWidgets.QGraphicsWidget

Source: https://doc.qt.io/archives/qt-5.15/qgraphicswidget.html#focusWidget

font instance-attribute

font: QFont

Qt 5 reference:

font : QFont

This property holds the widgets' font

This property provides the widget's font.

QFont consists of font properties that have been explicitly defined and properties implicitly inherited from the widget's parent. Hence, font() can return a different font compared to the one set with setFont(). This scheme allows you to define single entries in a font without affecting the font's inherited entries.

When a widget's font changes, it resolves its entries against its parent widget. If the widget does not have a parent widget, it resolves its entries against the scene. The widget then sends itself a FontChange event and notifies all its descendants so that they can resolve their fonts as well.

By default, this property contains the application's default font.

Access functions:

QFont font() const
void setFont(const QFont \&font)

See also QApplication::font(), QGraphicsScene::font, and QFont::resolve().

Source: https://doc.qt.io/archives/qt-5.15/qgraphicswidget.html#font

geometry instance-attribute

geometry: QRectF

Qt 5 reference:

geometry : QRectF

This property holds the geometry of the widget

Sets the item's geometry to rect. The item's position and size are modified as a result of calling this function. The item is first moved, then resized.

A side effect of calling this function is that the widget will receive a move event and a resize event. Also, if the widget has a layout assigned, the layout will activate.

Access functions:

virtual void setGeometry(const QRectF \&rect) override
void setGeometry(qreal x, qreal y, qreal w, qreal h)

Notifier signal:

void geometryChanged()

See also geometry() and resize().

Source: https://doc.qt.io/archives/qt-5.15/qgraphicswidget.html#geometry

geometryChanged

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

Native PythonQt.QtGui.QGraphicsWidget.geometryChanged; argument details are not documented.

Supplemental documentation: Qt 5 reference:

[signal] void QGraphicsWidget::geometryChanged()

This signal gets emitted whenever the geometry is changed in setGeometry().

Note: Notifier signal for property geometry. Notifier signal for property size.

Source: https://doc.qt.io/archives/qt-5.15/qgraphicswidget.html#geometryChanged

getContentsMargins

getContentsMargins(left: Any, top: Any, right: Any, bottom: Any) -> Any

X.getContentsMargins(left, top, right, bottom)

Supplemental documentation: Qt 5 reference:

[override virtual] void QGraphicsWidget::getContentsMargins(qreal *left, qreal *top, qreal *right, qreal *bottom) const

Reimplements: QGraphicsLayoutItem::getContentsMargins(qreal *left, qreal *top, qreal *right, qreal *bottom) const.

Gets the widget's contents margins. The margins are stored in left, top, right and bottom, as pointers to qreals. Each argument can be omitted by passing nullptr.

See also setContentsMargins().

Upstream PySide2 reference signatures (binding differences may apply):

getContentsMargins(self) -> typing.Tuple[float, float, float, float]

Source: https://doc.qt.io/archives/qt-5.15/qgraphicswidget.html#getContentsMargins

getWindowFrameMargins

getWindowFrameMargins(left: Any, top: Any, right: Any, bottom: Any) -> Any

X.getWindowFrameMargins(left, top, right, bottom)

Supplemental documentation: Qt 5 reference:

void QGraphicsWidget::getWindowFrameMargins(qreal *left, qreal *top, qreal *right, qreal *bottom) const

Gets the widget's window frame margins. The margins are stored in left, top, right and bottom as pointers to qreals. Each argument can be omitted by passing nullptr.

See also setWindowFrameMargins() and windowFrameRect().

Upstream PySide2 reference signatures (binding differences may apply):

getWindowFrameMargins(self) -> typing.Tuple[float, float, float, float]

Source: https://doc.qt.io/archives/qt-5.15/qgraphicswidget.html#getWindowFrameMargins

grabKeyboardEvent

grabKeyboardEvent(event: Any) -> None

X.grabKeyboardEvent(event)

Supplemental documentation: Qt 5 reference:

[virtual protected] void QGraphicsWidget::grabKeyboardEvent(QEvent *event)

This event handler, for event, can be reimplemented in a subclass to receive notifications for QEvent::GrabKeyboard events.

See also grabKeyboard() and grabMouse().

Upstream PySide2 reference signatures (binding differences may apply):

grabKeyboardEvent(self, event: PySide2.QtCore.QEvent) -> None

Source: https://doc.qt.io/archives/qt-5.15/qgraphicswidget.html#grabKeyboardEvent

grabMouseEvent

grabMouseEvent(event: Any) -> None

X.grabMouseEvent(event)

Supplemental documentation: Qt 5 reference:

[virtual protected] void QGraphicsWidget::grabMouseEvent(QEvent *event)

This event handler, for event, can be reimplemented in a subclass to receive notifications for QEvent::GrabMouse events.

See also grabMouse() and grabKeyboard().

Upstream PySide2 reference signatures (binding differences may apply):

grabMouseEvent(self, event: PySide2.QtCore.QEvent) -> None

Source: https://doc.qt.io/archives/qt-5.15/qgraphicswidget.html#grabMouseEvent

grabShortcut

grabShortcut(sequence: Any, context: Any) -> int

X.grabShortcut(sequence, context) -> int

Supplemental documentation: Qt 5 reference:

int QGraphicsWidget::grabShortcut(const QKeySequence \&sequence, Qt::ShortcutContext context \= Qt::WindowShortcut)

Adds a shortcut to Qt's shortcut system that watches for the given key sequence in the given context. If the context is Qt::ApplicationShortcut, the shortcut applies to the application as a whole. Otherwise, it is either local to this widget, Qt::WidgetShortcut, or to the window itself, Qt::WindowShortcut. For widgets that are not part of a window (i.e., top-level widgets and their children), Qt::WindowShortcut shortcuts apply to the scene.

If the same key sequence has been grabbed by several widgets, when the key sequence occurs a QEvent::Shortcut event is sent to all the widgets to which it applies in a non-deterministic order, but with the ``ambiguous'' flag set to true.

Warning: You should not normally need to use this function; instead create QActions with the shortcut key sequences you require (if you also want equivalent menu options and toolbar buttons), or create QShortcuts if you just need key sequences. Both QAction and QShortcut handle all the event filtering for you, and provide signals which are triggered when the user triggers the key sequence, so are much easier to use than this low-level function.

This function was introduced in Qt 4.5.

See also releaseShortcut(), setShortcutEnabled(), and QWidget::grabShortcut().

Upstream PySide2 reference signatures (binding differences may apply):

grabShortcut(self, sequence: PySide2.QtGui.QKeySequence, context: PySide2.QtCore.Qt.ShortcutContext=...) -> int

Source: https://doc.qt.io/archives/qt-5.15/qgraphicswidget.html#grabShortcut

heightChanged

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

Native PythonQt.QtGui.QGraphicsWidget.heightChanged; argument details are not documented.

hideEvent

hideEvent(event: Any) -> None

X.hideEvent(event)

Supplemental documentation: Qt 5 reference:

[virtual protected] void QGraphicsWidget::hideEvent(QHideEvent *event)

This event handler, for Hide events, is delivered after the widget has been hidden, for example, setVisible(false) has been called for the widget or one of its ancestors when the widget was previously shown.

You can reimplement this event handler to detect when your widget is hidden. Calling QEvent::accept() or QEvent::ignore() on event has no effect.

See also showEvent(), QWidget::hideEvent(), and ItemVisibleChange.

Upstream PySide2 reference signatures (binding differences may apply):

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

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

hoverLeaveEvent

hoverLeaveEvent(event: Any) -> None

X.hoverLeaveEvent(event)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QGraphicsWidget::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)

Reimplements: QGraphicsItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event).

Upstream PySide2 reference signatures (binding differences may apply):

hoverLeaveEvent(self, event: PySide2.QtWidgets.QGraphicsSceneHoverEvent) -> None

Source: https://doc.qt.io/archives/qt-5.15/qgraphicswidget.html#hoverLeaveEvent

hoverMoveEvent

hoverMoveEvent(event: Any) -> None

X.hoverMoveEvent(event)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QGraphicsWidget::hoverMoveEvent(QGraphicsSceneHoverEvent *event)

Reimplements: QGraphicsItem::hoverMoveEvent(QGraphicsSceneHoverEvent *event).

Upstream PySide2 reference signatures (binding differences may apply):

hoverMoveEvent(self, event: PySide2.QtWidgets.QGraphicsSceneHoverEvent) -> None

Source: https://doc.qt.io/archives/qt-5.15/qgraphicswidget.html#hoverMoveEvent

initStyleOption

initStyleOption(option: Any) -> None

X.initStyleOption(option)

Supplemental documentation: Qt 5 reference:

[virtual protected] void QGraphicsWidget::initStyleOption(QStyleOption *option) const

Populates a style option object for this widget based on its current state, and stores the output in option. The default implementation populates option with the following properties.

Style Option Property Value
state \& QStyle::State_Enabled Corresponds to QGraphicsItem::isEnabled().
state \& QStyle::State_HasFocus Corresponds to QGraphicsItem::hasFocus().
state \& QStyle::State_MouseOver Corresponds to QGraphicsItem::isUnderMouse().
direction Corresponds to QGraphicsWidget::layoutDirection().
rect Corresponds to QGraphicsWidget::rect().toRect().
palette Corresponds to QGraphicsWidget::palette().
fontMetrics Corresponds to QFontMetrics(QGraphicsWidget::font()).

Subclasses of QGraphicsWidget should call the base implementation, and then test the type of option using qstyleoption_cast\<>() or test QStyleOption::Type before storing widget-specific options.

For example:

void MyGroupBoxWidget::initStyleOption(QStyleOption *option) const
{
    QGraphicsWidget::initStyleOption(option);
    if (QStyleOptionGroupBox *box = qstyleoption_cast<QStyleOptionGroupBox *>(option)) {
        // Add group box specific state.
        box->flat = isFlat();
        ...
    }
}

See also QStyleOption::initFrom().

Upstream PySide2 reference signatures (binding differences may apply):

initStyleOption(self, option: PySide2.QtWidgets.QStyleOption) -> None

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

insertAction

insertAction(before: Any, action: Any) -> None

X.insertAction(before, action)

Supplemental documentation: Qt 5 reference:

void QGraphicsWidget::insertAction(QAction *before, QAction *action)

Inserts the action action to this widget's list of actions, before the action before. It appends the action if before is nullptr or before is not a valid action for this widget.

A QGraphicsWidget should only have one of each action.

This function was introduced in Qt 4.5.

See also removeAction(), addAction(), QMenu, actions(), and QWidget::insertActions().

Upstream PySide2 reference signatures (binding differences may apply):

insertAction(self, before: PySide2.QtWidgets.QAction, action: PySide2.QtWidgets.QAction) -> None

Source: https://doc.qt.io/archives/qt-5.15/qgraphicswidget.html#insertAction

insertActions

insertActions(before: Any, actions: Any) -> None

X.insertActions(before, actions)

Supplemental documentation: Qt 5 reference:

void QGraphicsWidget::insertActions(QAction *before, QList\<QAction *> actions)

Inserts the actions actions to this widget's list of actions, before the action before. It appends the action if before is nullptr or before is not a valid action for this widget.

A QGraphicsWidget can have at most one of each action.

This function was introduced in Qt 4.5.

See also removeAction(), QMenu, insertAction(), and QWidget::insertActions().

Upstream PySide2 reference signatures (binding differences may apply):

insertActions(self, before: PySide2.QtWidgets.QAction, actions: typing.Sequence[PySide2.QtWidgets.QAction]) -> None

Source: https://doc.qt.io/archives/qt-5.15/qgraphicswidget.html#insertActions

isActiveWindow

isActiveWindow() -> bool

X.isActiveWindow() -> bool

Supplemental documentation: Qt 5 reference:

bool QGraphicsWidget::isActiveWindow() const

Returns true if this widget's window is in the active window, or if the widget does not have a window but is in an active scene (i.e., a scene that currently has focus).

The active window is the window that either contains a child widget that currently has input focus, or that itself has input focus.

See also QGraphicsScene::activeWindow(), QGraphicsScene::setActiveWindow(), and isActive().

Upstream PySide2 reference signatures (binding differences may apply):

isActiveWindow(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qgraphicswidget.html#isActiveWindow

itemChange

itemChange(change: Any, value: Any) -> Any

X.itemChange(change, value) -> object

Supplemental documentation: Qt 5 reference:

[override virtual protected] QVariant QGraphicsWidget::itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant \&value)

Reimplements: QGraphicsItem::itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant \&value).

QGraphicsWidget uses the base implementation of this function to catch and deliver events related to state changes in the item. Because of this, it is very important that subclasses call the base implementation.

change specifies the type of change, and value is the new value.

For example, QGraphicsWidget uses ItemVisibleChange to deliver Show and Hide events, ItemPositionHasChanged to deliver Move events, and ItemParentChange both to deliver ParentChange events, and for managing the focus chain.

QGraphicsWidget enables the ItemSendsGeometryChanges flag by default in order to track position changes.

See also QGraphicsItem::itemChange().

Upstream PySide2 reference signatures (binding differences may apply):

itemChange(self, change: PySide2.QtWidgets.QGraphicsItem.GraphicsItemChange, value: typing.Any) -> typing.Any

Source: https://doc.qt.io/archives/qt-5.15/qgraphicswidget.html#itemChange

layout instance-attribute

Qt 5 reference:

layout : QGraphicsLayout*

This property holds the layout of the widget

Any existing layout manager is deleted before the new layout is assigned. If layout is nullptr, the widget is left without a layout. Existing subwidgets' geometries will remain unaffected.

QGraphicsWidget takes ownership of layout.

All widgets that are currently managed by layout or all of its sublayouts, are automatically reparented to this item. The layout is then invalidated, and the child widget geometries are adjusted according to this item's geometry() and contentsMargins(). Children who are not explicitly managed by layout remain unaffected by the layout after it has been assigned to this widget.

If no layout is currently managing this widget, layout() will return nullptr.

Access functions:

QGraphicsLayout * layout() const
void setLayout(QGraphicsLayout *layout)

Notifier signal:

void layoutChanged()

QGraphicsLayout *QGraphicsWidget::layout() const

Returns this widget's layout, or nullptr if no layout is currently managing this widget.

Note: Getter function for property layout.

See also setLayout().

Source: https://doc.qt.io/archives/qt-5.15/qgraphicswidget.html#layout

layoutChanged

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

Native PythonQt.QtGui.QGraphicsWidget.layoutChanged; argument details are not documented.

layoutDirection instance-attribute

layoutDirection: Any

Qt 5 reference:

layoutDirection : Qt::LayoutDirection

This property holds the layout direction for this widget.

This property modifies this widget's and all of its descendants' Qt::WA_RightToLeft attribute. It also sets this widget's Qt::WA_SetLayoutDirection attribute.

The widget's layout direction determines the order in which the layout manager horizontally arranges subwidgets of this widget. The default value depends on the language and locale of the application, and is typically in the same direction as words are read and written. With Qt::LeftToRight, the layout starts placing subwidgets from the left side of this widget towards the right. Qt::RightToLeft does the opposite - the layout will place widgets starting from the right edge moving towards the left.

Subwidgets inherit their layout direction from the parent. Top-level widget items inherit their layout direction from QGraphicsScene::layoutDirection. If you change a widget's layout direction by calling setLayoutDirection(), the widget will send itself a LayoutDirectionChange event, and then propagate the new layout direction to all its descendants.

Access functions:

Qt::LayoutDirection layoutDirection() const
void setLayoutDirection(Qt::LayoutDirection direction)
void unsetLayoutDirection()

See also QWidget::layoutDirection and QApplication::layoutDirection.

Source: https://doc.qt.io/archives/qt-5.15/qgraphicswidget.html#layoutDirection

maximumSize instance-attribute

maximumSize: QSizeF

Qt 5 reference:

maximumSize : const QSizeF

This property holds the maximum size of the widget

See also setMaximumSize(), maximumSize(), minimumSize, and preferredSize.

Source: https://doc.qt.io/archives/qt-5.15/qgraphicswidget.html#maximumSize

minimumSize instance-attribute

minimumSize: QSizeF

Qt 5 reference:

minimumSize : const QSizeF

This property holds the minimum size of the widget

See also setMinimumSize(), minimumSize(), preferredSize, and maximumSize.

Source: https://doc.qt.io/archives/qt-5.15/qgraphicswidget.html#minimumSize