Skip to content

PythonQt.QtGui.QGraphicsWidget · declarations 002

Back to PythonQt.QtGui.QGraphicsWidget

moveEvent

moveEvent(event: Any) -> None

X.moveEvent(event)

Supplemental documentation: Qt 5 reference:

[virtual protected] void QGraphicsWidget::moveEvent(QGraphicsSceneMoveEvent *event)

This event handler, for GraphicsSceneMove events, is delivered after the widget has moved (e.g., its local position has changed).

This event is only delivered when the item is moved locally. Calling setTransform() or moving any of the item's ancestors does not affect the item's local position.

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

See also ItemPositionChange and ItemPositionHasChanged.

Upstream PySide2 reference signatures (binding differences may apply):

moveEvent(self, event: PySide2.QtWidgets.QGraphicsSceneMoveEvent) -> None

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

objectNameChanged

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

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

opacityChanged

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

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

paint

paint(painter: Any, option: Any, widget: Any) -> None

X.paint(painter, option, widget)

Supplemental documentation: Qt 5 reference:

[override virtual] void QGraphicsWidget::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget \= nullptr)

Reimplements: QGraphicsItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget).

Upstream PySide2 reference signatures (binding differences may apply):

paint(self, painter: PySide2.QtGui.QPainter, option: PySide2.QtWidgets.QStyleOptionGraphicsItem, widget: typing.Optional[PySide2.QtWidgets.QWidget]=...) -> None

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

paintWindowFrame

paintWindowFrame(painter: Any, option: Any, widget: Any) -> None

X.paintWindowFrame(painter, option, widget)

Supplemental documentation: Qt 5 reference:

[virtual] void QGraphicsWidget::paintWindowFrame(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget \= nullptr)

This virtual function is called by QGraphicsScene to draw the window frame for windows using painter, option, and widget, in local coordinates. The base implementation uses the current style to render the frame and title bar.

You can reimplement this function in a subclass of QGraphicsWidget to provide custom rendering of the widget's window frame.

See also QGraphicsItem::paint().

Upstream PySide2 reference signatures (binding differences may apply):

paintWindowFrame(self, painter: PySide2.QtGui.QPainter, option: PySide2.QtWidgets.QStyleOptionGraphicsItem, widget: typing.Optional[PySide2.QtWidgets.QWidget]=...) -> None

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

palette instance-attribute

palette: QPalette

Qt 5 reference:

palette : QPalette

This property holds the widget's palette

This property provides the widget's palette. The palette provides colors and brushes for color groups (e.g., QPalette::Button) and states (e.g., QPalette::Inactive), loosely defining the general look of the widget and its children.

QPalette consists of color groups that have been explicitly defined, and groups that are implicitly inherited from the widget's parent. Because of this, palette() can return a different palette than what has been set with setPalette(). This scheme allows you to define single entries in a palette without affecting the palette's inherited entries.

When a widget's palette changes, it resolves its entries against its parent widget, or if it doesn't have a parent widget, it resolves against the scene. It then sends itself a PaletteChange event, and notifies all its descendants so they can resolve their palettes as well.

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

Access functions:

QPalette palette() const
void setPalette(const QPalette \&palette)

See also QGuiApplication::palette(), QGraphicsScene::palette, and QPalette::resolve().

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

parentChanged

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

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

polishEvent

polishEvent() -> None

X.polishEvent()

Supplemental documentation: Qt 5 reference:

[virtual protected] void QGraphicsWidget::polishEvent()

This event is delivered to the item by the scene at some point after it has been constructed, but before it is shown or otherwise accessed through the scene. You can use this event handler to do last-minute initializations of the widget which require the item to be fully constructed.

The base implementation does nothing.

Upstream PySide2 reference signatures (binding differences may apply):

polishEvent(self) -> None

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

preferredSize instance-attribute

preferredSize: QSizeF

Qt 5 reference:

preferredSize : const QSizeF

This property holds the preferred size of the widget

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

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

propertyChange

propertyChange(propertyName: str, value: Any) -> Any

X.propertyChange(propertyName, value) -> object

Upstream PySide2 reference signatures (binding differences may apply):

propertyChange(self, propertyName: str, value: typing.Any) -> typing.Any

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

rect

rect() -> Any

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

Supplemental documentation: Qt 5 reference:

QRectF QGraphicsWidget::rect() const

Returns the item's local rect as a QRectF. This function is equivalent to QRectF(QPointF(), size()).

See also setGeometry() and resize().

Upstream PySide2 reference signatures (binding differences may apply):

rect(self) -> PySide2.QtCore.QRectF

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

releaseShortcut

releaseShortcut(id: int) -> None

X.releaseShortcut(id)

Supplemental documentation: Qt 5 reference:

void QGraphicsWidget::releaseShortcut(int id)

Removes the shortcut with the given id from Qt's shortcut system. The widget will no longer receive QEvent::Shortcut events for the shortcut's key sequence (unless it has other shortcuts with the same key sequence).

Warning: You should not normally need to use this function since Qt's shortcut system removes shortcuts automatically when their parent widget is destroyed. It is best to use QAction or QShortcut to handle shortcuts, since they are easier to use than this low-level function. Note also that this is an expensive operation.

This function was introduced in Qt 4.5.

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

Upstream PySide2 reference signatures (binding differences may apply):

releaseShortcut(self, id: int) -> None

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

removeAction

removeAction(action: Any) -> None

X.removeAction(action)

Supplemental documentation: Qt 5 reference:

void QGraphicsWidget::removeAction(QAction *action)

Removes the action action from this widget's list of actions.

This function was introduced in Qt 4.5.

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

Upstream PySide2 reference signatures (binding differences may apply):

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

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

resize

resize(w: Any, h: Any) -> None

X.resize(w, h)

Supplemental documentation: Qt 5 reference:

void QGraphicsWidget::resize(qreal w, qreal h)

This is an overloaded function.

Constructs a resize with the given width (w) and height (h). This convenience function is equivalent to calling resize(QSizeF(w, h)).

Note: Setter function for property size.

See also setGeometry() and setTransform().

Upstream PySide2 reference signatures (binding differences may apply):

resize(self, size: PySide2.QtCore.QSizeF) -> None
resize(self, w: float, h: float) -> None

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

resizeEvent

resizeEvent(event: Any) -> None

X.resizeEvent(event)

Supplemental documentation: Qt 5 reference:

[virtual protected] void QGraphicsWidget::resizeEvent(QGraphicsSceneResizeEvent *event)

This event handler, for GraphicsSceneResize events, is delivered after the widget has been resized (i.e., its local size has changed). event contains both the old and the new size.

This event is only delivered when the widget is resized locally; calling setTransform() on the widget or any of its ancestors or view, does not affect the widget's local size.

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

See also geometry() and setGeometry().

Upstream PySide2 reference signatures (binding differences may apply):

resizeEvent(self, event: PySide2.QtWidgets.QGraphicsSceneResizeEvent) -> None

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

rotationChanged

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

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

scaleChanged

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

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

sceneEvent

sceneEvent(event: Any) -> bool

X.sceneEvent(event) -> bool

Supplemental documentation: Qt 5 reference:

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

Reimplements: QGraphicsItem::sceneEvent(QEvent *event).

QGraphicsWidget's implementation of sceneEvent() simply passes event to QGraphicsWidget::event(). You can handle all events for your widget in event() or in any of the convenience functions; you should not have to reimplement this function in a subclass of QGraphicsWidget.

Returns true if event has been recognized and processed; otherwise, returns false.

See also QGraphicsItem::sceneEvent().

Upstream PySide2 reference signatures (binding differences may apply):

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

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

setAttribute

setAttribute(attribute: Any, on: bool) -> None

X.setAttribute(attribute, on)

Supplemental documentation: Qt 5 reference:

void QGraphicsWidget::setAttribute(Qt::WidgetAttribute attribute, bool on \= true)

If on is true, this function enables attribute; otherwise attribute is disabled.

See the class documentation for QGraphicsWidget for a complete list of which attributes are supported, and what they are for.

See also testAttribute() and QWidget::setAttribute().

Upstream PySide2 reference signatures (binding differences may apply):

setAttribute(self, attribute: PySide2.QtCore.Qt.WidgetAttribute, on: bool=...) -> None

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

setAutoFillBackground

setAutoFillBackground(enabled: bool) -> None

X.setAutoFillBackground(enabled)

Upstream PySide2 reference signatures (binding differences may apply):

setAutoFillBackground(self, enabled: bool) -> None

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

setContentsMargins

setContentsMargins(left: Any, top: Any, right: Any, bottom: Any) -> None

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

Supplemental documentation: Qt 5 reference:

void QGraphicsWidget::setContentsMargins(QMarginsF margins)

Sets the widget's contents margins to margins.

Contents margins are used by the assigned layout to define the placement of subwidgets and layouts. Margins are particularly useful for widgets that constrain subwidgets to only a section of its own geometry. For example, a group box with a layout will place subwidgets inside its frame, but below the title.

Changing a widget's contents margins will always trigger an update(), and any assigned layout will be activated automatically. The widget will then receive a ContentsRectChange event.

This function was introduced in Qt 5.14.

See also getContentsMargins() and setGeometry().

void QGraphicsWidget::setContentsMargins(qreal left, qreal top, qreal right, qreal bottom)

This is an overloaded function.

Sets the widget's contents margins to left, top, right and bottom.

Upstream PySide2 reference signatures (binding differences may apply):

setContentsMargins(self, left: float, top: float, right: float, bottom: float) -> None
setContentsMargins(self, margins: PySide2.QtCore.QMarginsF) -> None

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

setFocusPolicy

setFocusPolicy(policy: Any) -> None

X.setFocusPolicy(policy)

Upstream PySide2 reference signatures (binding differences may apply):

setFocusPolicy(self, policy: PySide2.QtCore.Qt.FocusPolicy) -> None

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

setFont

setFont(font: Any) -> None

X.setFont(font)

Upstream PySide2 reference signatures (binding differences may apply):

setFont(self, font: PySide2.QtGui.QFont) -> None

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

setGeometry

setGeometry(rect: Any) -> None

X.setGeometry(rect)

Supplemental documentation: Qt 5 reference:

void QGraphicsWidget::setGeometry(qreal x, qreal y, qreal w, qreal h)

This convenience function is equivalent to calling setGeometry(QRectF( x, y, w, h)).

Note: Setter function for property geometry.

See also geometry() and resize().

Upstream PySide2 reference signatures (binding differences may apply):

setGeometry(self, rect: PySide2.QtCore.QRectF) -> None
setGeometry(self, x: float, y: float, w: float, h: float) -> None

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

setLayout

setLayout(layout: Any) -> None

X.setLayout(layout)

Supplemental documentation: Qt 5 reference:

void QGraphicsWidget::setLayout(QGraphicsLayout *layout)

Sets the layout for this widget to layout. 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.

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.

QGraphicsWidget takes ownership of layout.

Note: Setter function for property layout.

See also layout(), QGraphicsLinearLayout::addItem(), and QGraphicsLayout::invalidate().

Upstream PySide2 reference signatures (binding differences may apply):

setLayout(self, layout: PySide2.QtWidgets.QGraphicsLayout) -> None

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

setLayoutDirection

setLayoutDirection(direction: Any) -> None

X.setLayoutDirection(direction)

Upstream PySide2 reference signatures (binding differences may apply):

setLayoutDirection(self, direction: PySide2.QtCore.Qt.LayoutDirection) -> None

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

setPalette

setPalette(palette: Any) -> None

X.setPalette(palette)

Upstream PySide2 reference signatures (binding differences may apply):

setPalette(self, palette: PySide2.QtGui.QPalette) -> None

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

setShortcutAutoRepeat

setShortcutAutoRepeat(id: int, enabled: bool) -> None

X.setShortcutAutoRepeat(id, enabled)

Supplemental documentation: Qt 5 reference:

void QGraphicsWidget::setShortcutAutoRepeat(int id, bool enabled \= true)

If enabled is true, auto repeat of the shortcut with the given id is enabled; otherwise it is disabled.

This function was introduced in Qt 4.5.

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

Upstream PySide2 reference signatures (binding differences may apply):

setShortcutAutoRepeat(self, id: int, enabled: bool=...) -> None

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

setShortcutEnabled

setShortcutEnabled(id: int, enabled: bool) -> None

X.setShortcutEnabled(id, enabled)

Supplemental documentation: Qt 5 reference:

void QGraphicsWidget::setShortcutEnabled(int id, bool enabled \= true)

If enabled is true, the shortcut with the given id is enabled; otherwise the shortcut is disabled.

Warning: You should not normally need to use this function since Qt's shortcut system enables/disables shortcuts automatically as widgets become hidden/visible and gain or lose focus. It is best to use QAction or QShortcut to handle shortcuts, since they are easier to use than this low-level function.

This function was introduced in Qt 4.5.

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

Upstream PySide2 reference signatures (binding differences may apply):

setShortcutEnabled(self, id: int, enabled: bool=...) -> None

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

setStyle

setStyle(style: Any) -> None

X.setStyle(style)

Supplemental documentation: Qt 5 reference:

void QGraphicsWidget::setStyle(QStyle *style)

Sets the widget's style to style. QGraphicsWidget does not take ownership of style.

If no style is assigned, or style is nullptr, the widget will use QGraphicsScene::style() (if this has been set). Otherwise the widget will use QApplication::style().

This function sets the Qt::WA_SetStyle attribute if style is not nullptr; otherwise it clears the attribute.

See also style().

Upstream PySide2 reference signatures (binding differences may apply):

setStyle(self, style: PySide2.QtWidgets.QStyle) -> None

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

setTabOrder

setTabOrder(first: Any, second: Any) -> None

X.setTabOrder(first, second)

Supplemental documentation: Qt 5 reference:

[static] void QGraphicsWidget::setTabOrder(QGraphicsWidget *first, QGraphicsWidget *second)

Moves the second widget around the ring of focus widgets so that keyboard focus moves from the first widget to the second widget when the Tab key is pressed.

Note that since the tab order of the second widget is changed, you should order a chain like this:

setTabOrder(a, b); // a to b
setTabOrder(b, c); // a to b to c
setTabOrder(c, d); // a to b to c to d

not like this:

// WRONG
setTabOrder(c, d); // c to d
setTabOrder(a, b); // a to b AND c to d
setTabOrder(b, c); // a to b to c, but not c to d

If first is nullptr, this indicates that second should be the first widget to receive input focus should the scene gain Tab focus (i.e., the user hits Tab so that focus passes into the scene). If second is nullptr, this indicates that first should be the first widget to gain focus if the scene gained BackTab focus.

By default, tab order is defined implicitly using widget creation order.

See also focusPolicy and Keyboard Focus in Widgets.

Upstream PySide2 reference signatures (binding differences may apply):

setTabOrder(first: PySide2.QtWidgets.QGraphicsWidget, second: PySide2.QtWidgets.QGraphicsWidget) -> None

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

setWindowFlags

setWindowFlags(wFlags: Any) -> None

X.setWindowFlags(wFlags)

Upstream PySide2 reference signatures (binding differences may apply):

setWindowFlags(self, wFlags: PySide2.QtCore.Qt.WindowFlags) -> None

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

setWindowFrameMargins

setWindowFrameMargins(left: Any, top: Any, right: Any, bottom: Any) -> None

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

Supplemental documentation: Qt 5 reference:

void QGraphicsWidget::setWindowFrameMargins(QMarginsF margins)

Sets the widget's window frame margins to margins. The default frame margins are provided by the style, and they depend on the current window flags.

If you would like to draw your own window decoration, you can set your own frame margins to override the default margins.

This function was introduced in Qt 5.14.

See also unsetWindowFrameMargins(), getWindowFrameMargins(), and windowFrameRect().

void QGraphicsWidget::setWindowFrameMargins(qreal left, qreal top, qreal right, qreal bottom)

This is an overloaded function.

Sets the widget's window frame margins to left, top, right and bottom.

Upstream PySide2 reference signatures (binding differences may apply):

setWindowFrameMargins(self, left: float, top: float, right: float, bottom: float) -> None
setWindowFrameMargins(self, margins: PySide2.QtCore.QMarginsF) -> None

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

setWindowTitle

setWindowTitle(title: str) -> None

X.setWindowTitle(title)

Upstream PySide2 reference signatures (binding differences may apply):

setWindowTitle(self, title: str) -> None

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

shape

shape() -> Any

X.shape() -> PythonQt.QtGui.QPainterPath

Supplemental documentation: Qt 5 reference:

[override virtual] QPainterPath QGraphicsWidget::shape() const

Reimplements: QGraphicsItem::shape() const.

Upstream PySide2 reference signatures (binding differences may apply):

shape(self) -> PySide2.QtGui.QPainterPath

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

showEvent

showEvent(event: Any) -> None

X.showEvent(event)

Supplemental documentation: Qt 5 reference:

[virtual protected] void QGraphicsWidget::showEvent(QShowEvent *event)

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

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

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

Upstream PySide2 reference signatures (binding differences may apply):

showEvent(self, event: PySide2.QtGui.QShowEvent) -> None

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

size instance-attribute

size: QSizeF

Qt 5 reference:

size : QSizeF

This property holds the size of the widget

Calling resize() resizes the widget to a size bounded by minimumSize() and maximumSize(). This property only affects the widget's width and height (e.g., its right and bottom edges); the widget's position and top-left corner remains unaffected.

Resizing a widget triggers the widget to immediately receive a GraphicsSceneResize event with the widget's old and new size. If the widget has a layout assigned when this event arrives, the layout will be activated and it will automatically update any child widgets's geometry.

This property does not affect any layout of the parent widget. If the widget itself is managed by a parent layout; e.g., it has a parent widget with a layout assigned, that layout will not activate.

By default, this property contains a size with zero width and height.

Access functions:

QSizeF size() const
void resize(const QSizeF \&size)
void resize(qreal w, qreal h)

Notifier signal:

void geometryChanged()

See also setGeometry(), QGraphicsSceneResizeEvent, and QGraphicsLayout.

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

sizeHint

sizeHint(which: Any, constraint: Any) -> Any

X.sizeHint(which, constraint) -> PythonQt.QtCore.QSizeF

Supplemental documentation: Qt 5 reference:

[override virtual protected] QSizeF QGraphicsWidget::sizeHint(Qt::SizeHint which, const QSizeF \&constraint \= QSizeF()) const

Reimplements: QGraphicsLayoutItem::sizeHint(Qt::SizeHint which, const QSizeF \&constraint) const.

Upstream PySide2 reference signatures (binding differences may apply):

sizeHint(self, which: PySide2.QtCore.Qt.SizeHint, constraint: PySide2.QtCore.QSizeF=...) -> PySide2.QtCore.QSizeF

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

sizePolicy instance-attribute

sizePolicy: QSizePolicy

Qt 5 reference:

sizePolicy : const QSizePolicy

This property holds the size policy for the widget

See also sizePolicy(), setSizePolicy(), and QWidget::sizePolicy().

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

style

style() -> Any

X.style() -> PythonQt.QtGui.QStyle

Supplemental documentation: Qt 5 reference:

QStyle *QGraphicsWidget::style() const

Returns a pointer to the widget's style. If this widget does not have any explicitly assigned style, the scene's style is returned instead. In turn, if the scene does not have any assigned style, this function returns QApplication::style().

See also setStyle().

Upstream PySide2 reference signatures (binding differences may apply):

style(self) -> PySide2.QtWidgets.QStyle

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