QGraphicsWidget¶
The QGraphicsWidget class is the base class for all widget items in a QGraphicsScene
. More…

Inherited by: QGraphicsProxyWidget
Synopsis¶
Functions¶
def
actions
()def
addAction
(action)def
addActions
(actions)def
adjustSize
()def
autoFillBackground
()def
close
()def
focusPolicy
()def
focusWidget
()def
font
()def
geometryChanged
()def
getWindowFrameMargins
()def
grabShortcut
(sequence[, context=Qt.WindowShortcut])def
insertAction
(before, action)def
insertActions
(before, actions)def
isActiveWindow
()def
layout
()def
layoutChanged
()def
layoutDirection
()def
palette
()def
rect
()def
releaseShortcut
(id)def
removeAction
(action)def
resize
(size)def
resize
(w, h)def
setAttribute
(attribute[, on=true])def
setAutoFillBackground
(enabled)def
setContentsMargins
(left, top, right, bottom)def
setContentsMargins
(margins)def
setFocusPolicy
(policy)def
setFont
(font)def
setGeometry
(x, y, w, h)def
setLayout
(layout)def
setLayoutDirection
(direction)def
setPalette
(palette)def
setShortcutAutoRepeat
(id[, enabled=true])def
setShortcutEnabled
(id[, enabled=true])def
setStyle
(style)def
setWindowFlags
(wFlags)def
setWindowFrameMargins
(left, top, right, bottom)def
setWindowFrameMargins
(margins)def
setWindowTitle
(title)def
size
()def
style
()def
testAttribute
(attribute)def
unsetLayoutDirection
()def
unsetWindowFrameMargins
()def
windowFlags
()def
windowFrameGeometry
()def
windowFrameRect
()def
windowTitle
()def
windowType
()
Virtual functions¶
def
changeEvent
(event)def
closeEvent
(event)def
focusNextPrevChild
(next)def
grabKeyboardEvent
(event)def
grabMouseEvent
(event)def
hideEvent
(event)def
initStyleOption
(option)def
moveEvent
(event)def
paintWindowFrame
(painter, option[, widget=None])def
polishEvent
()def
propertyChange
(propertyName, value)def
resizeEvent
(event)def
showEvent
(event)def
ungrabKeyboardEvent
(event)def
ungrabMouseEvent
(event)def
windowFrameEvent
(e)def
windowFrameSectionAt
(pos)
Static functions¶
def
setTabOrder
(first, second)
Detailed Description¶
QGraphicsWidget is an extended base item that provides extra functionality over QGraphicsItem
. It is similar to QWidget in many ways:
Has a defined .
Supports layouts with
setLayout()
andlayout()
.Supports shortcuts and actions with
grabShortcut()
andinsertAction()
Unlike QGraphicsItem
, QGraphicsWidget is not an abstract class; you can create instances of a QGraphicsWidget without having to subclass it. This approach is useful for widgets that only serve the purpose of organizing child widgets into a layout.
QGraphicsWidget can be used as a base item for your own custom item if you require advanced input focus handling, e.g., tab focus and activation, or layouts.
Since QGraphicsWidget resembles QWidget and has similar API, it is easier to port a widget from QWidget to QGraphicsWidget , instead of QGraphicsItem
.
Note
QWidget -based widgets can be directly embedded into a QGraphicsScene
using QGraphicsProxyWidget
.
Noticeable differences between QGraphicsWidget and QWidget are:
QWidget
Coordinates and geometry are defined with qreals (doubles or floats, depending on the platform).
QWidget uses integer geometry (
QPoint
,QRect
).The widget is already visible by default; you do not have to call to display the widget.
QWidget is hidden by default until you call .
A subset of widget attributes are supported.
All widget attributes are supported.
A top-level item’s style defaults to
style
A top-level widget’s style defaults to
style
Graphics View provides a custom drag and drop framework, different from QWidget .
Standard drag and drop framework.
Widget items do not support modality.
Full modality support.
QGraphicsWidget supports a subset of Qt’s widget attributes, ( WidgetAttribute
), as shown in the table below. Any attributes not listed in this table are unsupported, or otherwise unused.
Widget Attribute
Usage
WA_SetLayoutDirection
Set by
setLayoutDirection()
, cleared byunsetLayoutDirection()
. You can test this attribute to check if the widget has been explicitly assigned alayoutDirection
. If the attribute is not set, thelayoutDirection()
is inherited.
WA_RightToLeft
Toggled by
setLayoutDirection()
. Inherited from the parent/scene. If set, the widget’s layout will order horizontally arranged widgets from right to left.
WA_SetStyle
Set and cleared by
setStyle()
. If this attribute is set, the widget has been explicitly assigned a style. If it is unset, the widget will use the scene’s or the application’s style.
WA_Resized
Set by
setGeometry()
andresize()
.
WA_SetPalette
Set by
setPalette()
.
WA_SetFont
Set by
setFont()
.
WA_WindowPropagation
Enables propagation to window widgets.
Although QGraphicsWidget inherits from both QObject
and QGraphicsItem
, you should use the functions provided by QGraphicsItem
, not QObject
, to manage the relationships between parent and child items. These functions control the stacking order of items as well as their ownership.
Note
The parent()
should always return None
for QGraphicsWidgets, but this policy is not strictly defined.
-
class
PySide6.QtWidgets.
QGraphicsWidget
([parent=None[, wFlags=Qt.WindowFlags()]])¶ - Parameters
wFlags –
WindowFlags
parent –
PySide6.QtWidgets.QGraphicsItem
Constructs a QGraphicsWidget instance. The optional parent
argument is passed to QGraphicsItem
‘s constructor. The optional wFlags
argument specifies the widget’s window flags (e.g., whether the widget should be a window, a tool, a popup, etc).
-
PySide6.QtWidgets.QGraphicsWidget.
actions
()¶ - Return type
Returns the (possibly empty) list of this widget’s actions.
See also
insertAction()
removeAction()
actions()
associatedWidgets()
associatedGraphicsWidgets()
-
PySide6.QtWidgets.QGraphicsWidget.
addAction
(action)¶ - Parameters
action –
PySide6.QtGui.QAction
Appends the action action
to this widget’s list of actions.
All QGraphicsWidgets have a list of QAction
s, 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.
See also
-
PySide6.QtWidgets.QGraphicsWidget.
addActions
(actions)¶ - Parameters
actions –
Appends the actions actions
to this widget’s list of actions.
See also
-
PySide6.QtWidgets.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()
MinimumSize
-
PySide6.QtWidgets.QGraphicsWidget.
autoFillBackground
()¶ - Return type
bool
See also
-
PySide6.QtWidgets.QGraphicsWidget.
changeEvent
(event)¶ - Parameters
event –
PySide6.QtCore.QEvent
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: ActivationChange
, EnabledChange
, FontChange
, StyleChange
, PaletteChange
, ParentChange
, LayoutDirectionChange
, and ContentsRectChange
.
-
PySide6.QtWidgets.QGraphicsWidget.
close
()¶ - Return type
bool
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 the widget.
If the widget has the WA_DeleteOnClose
attribute set it will be deleted.
-
PySide6.QtWidgets.QGraphicsWidget.
closeEvent
(event)¶ - Parameters
event –
PySide6.QtGui.QCloseEvent
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()
QCloseEvent
-
PySide6.QtWidgets.QGraphicsWidget.
focusNextPrevChild
(next)¶ - Parameters
next – bool
- Return type
bool
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 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
-
PySide6.QtWidgets.QGraphicsWidget.
focusPolicy
()¶ - Return type
See also
-
PySide6.QtWidgets.QGraphicsWidget.
focusWidget
()¶ - Return type
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, None
is returned.
See also
-
PySide6.QtWidgets.QGraphicsWidget.
font
()¶ - Return type
See also
-
PySide6.QtWidgets.QGraphicsWidget.
geometryChanged
()¶
-
PySide6.QtWidgets.QGraphicsWidget.
getWindowFrameMargins
()¶
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 None
.
See also
-
PySide6.QtWidgets.QGraphicsWidget.
grabKeyboardEvent
(event)¶ - Parameters
event –
PySide6.QtCore.QEvent
This event handler, for event
, can be reimplemented in a subclass to receive notifications for GrabKeyboard
events.
See also
grabKeyboard()
grabMouse()
-
PySide6.QtWidgets.QGraphicsWidget.
grabMouseEvent
(event)¶ - Parameters
event –
PySide6.QtCore.QEvent
This event handler, for event
, can be reimplemented in a subclass to receive notifications for GrabMouse
events.
See also
grabMouse()
grabKeyboard()
-
PySide6.QtWidgets.QGraphicsWidget.
grabShortcut
(sequence[, context=Qt.WindowShortcut])¶ - Parameters
sequence –
PySide6.QtGui.QKeySequence
context –
ShortcutContext
- Return type
int
Adds a shortcut to Qt’s shortcut system that watches for the given key sequence
in the given context
. If the context
is ApplicationShortcut
, the shortcut applies to the application as a whole. Otherwise, it is either local to this widget, WidgetShortcut
, or to the window itself, WindowShortcut
. For widgets that are not part of a window (i.e., top-level widgets and their children), WindowShortcut
shortcuts apply to the scene.
If the same key sequence
has been grabbed by several widgets, when the key sequence
occurs a 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 QAction
s with the shortcut key sequences you require (if you also want equivalent menu options and toolbar buttons), or create QShortcut
s 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.
-
PySide6.QtWidgets.QGraphicsWidget.
hideEvent
(event)¶ - Parameters
event –
PySide6.QtGui.QHideEvent
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 accept()
or ignore()
on event
has no effect.
See also
showEvent()
ItemVisibleChange
-
PySide6.QtWidgets.QGraphicsWidget.
initStyleOption
(option)¶ - Parameters
option –
PySide6.QtWidgets.QStyleOption
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 &
State_Enabled
Corresponds to
isEnabled()
.state &
State_HasFocus
Corresponds to
hasFocus()
.state &
State_MouseOver
Corresponds to
isUnderMouse()
.direction
Corresponds to
layoutDirection()
.rect
Corresponds to .toRect().
palette
Corresponds to
palette()
.fontMetrics
Corresponds to
QFontMetrics
(font()
).
Subclasses of QGraphicsWidget should call the base implementation, and then test the type of option
using qstyleoption_cast<>() or test Type
before storing widget-specific options.
For example:
class MyGroupBoxWidget (QStyleOptionGroupBox): # ... def initStyleOption(option): QGraphicsWidget.initStyleOption(self, option) if isinstance(option, QStyleOptionGroupBox): # Add group box specific state. box.flat = isFlat() # ...See also
-
PySide6.QtWidgets.QGraphicsWidget.
insertAction
(before, action)¶ - Parameters
before –
PySide6.QtGui.QAction
action –
PySide6.QtGui.QAction
Inserts the action action
to this widget’s list of actions, before the action before
. It appends the action if before
is None
or before
is not a valid action for this widget.
A QGraphicsWidget should only have one of each action.
-
PySide6.QtWidgets.QGraphicsWidget.
insertActions
(before, actions)¶ - Parameters
before –
PySide6.QtGui.QAction
actions –
Inserts the actions actions
to this widget’s list of actions, before the action before
. It appends the action if before
is None
or before
is not a valid action for this widget.
A QGraphicsWidget can have at most one of each action.
See also
-
PySide6.QtWidgets.QGraphicsWidget.
isActiveWindow
()¶ - Return type
bool
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
activeWindow()
setActiveWindow()
isActive()
-
PySide6.QtWidgets.QGraphicsWidget.
layout
()¶ - Return type
Returns this widget’s layout, or None
if no layout is currently managing this widget.
See also
-
PySide6.QtWidgets.QGraphicsWidget.
layoutChanged
()¶
-
PySide6.QtWidgets.QGraphicsWidget.
layoutDirection
()¶ - Return type
See also
-
PySide6.QtWidgets.QGraphicsWidget.
moveEvent
(event)¶ - Parameters
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 accept()
or ignore()
on event
has no effect.
See also
ItemPositionChange
ItemPositionHasChanged
-
PySide6.QtWidgets.QGraphicsWidget.
paintWindowFrame
(painter, option[, widget=None])¶ - Parameters
painter –
PySide6.QtGui.QPainter
widget –
PySide6.QtWidgets.QWidget
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
-
PySide6.QtWidgets.QGraphicsWidget.
palette
()¶ - Return type
See also
-
PySide6.QtWidgets.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.
-
PySide6.QtWidgets.QGraphicsWidget.
propertyChange
(propertyName, value)¶ - Parameters
propertyName – str
value – object
- Return type
object
This virtual function is used to notify changes to any property (both dynamic properties, and registered with Q_PROPERTY
) in the widget. Depending on the property itself, the notification can be delivered before or after the value has changed.
propertyName
is the name of the property (e.g., “size” or “font”), and value
is the (proposed) new value of the property. The function returns the new value, which may be different from value
if the notification supports adjusting the property value. The base implementation simply returns value
for any propertyName
.
QGraphicsWidget delivers notifications for the following properties:
propertyName
Property
size
font
palette
See also
itemChange()
-
PySide6.QtWidgets.QGraphicsWidget.
rect
()¶ - Return type
-
PySide6.QtWidgets.QGraphicsWidget.
releaseShortcut
(id)¶ - Parameters
id – int
Removes the shortcut with the given id
from Qt’s shortcut system. The widget will no longer receive 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.
-
PySide6.QtWidgets.QGraphicsWidget.
removeAction
(action)¶ - Parameters
action –
PySide6.QtGui.QAction
Removes the action action
from this widget’s list of actions.
-
PySide6.QtWidgets.QGraphicsWidget.
resize
(size)¶ - Parameters
size –
PySide6.QtCore.QSizeF
-
PySide6.QtWidgets.QGraphicsWidget.
resize
(w, h) - Parameters
w – float
h – float
-
PySide6.QtWidgets.QGraphicsWidget.
resizeEvent
(event)¶ - Parameters
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 accept()
or ignore()
on event
has no effect.
See also
-
PySide6.QtWidgets.QGraphicsWidget.
setAttribute
(attribute[, on=true])¶ - Parameters
attribute –
WidgetAttribute
on – bool
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
-
PySide6.QtWidgets.QGraphicsWidget.
setAutoFillBackground
(enabled)¶ - Parameters
enabled – bool
See also
-
PySide6.QtWidgets.QGraphicsWidget.
setContentsMargins
(margins)¶ - Parameters
margins –
PySide6.QtCore.QMarginsF
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.
See also
getContentsMargins()
setGeometry()
-
PySide6.QtWidgets.QGraphicsWidget.
setContentsMargins
(left, top, right, bottom) - Parameters
left – float
top – float
right – float
bottom – float
This is an overloaded function.
Sets the widget’s contents margins to left
, top
, right
and bottom
.
-
PySide6.QtWidgets.QGraphicsWidget.
setFocusPolicy
(policy)¶ - Parameters
policy –
FocusPolicy
See also
-
PySide6.QtWidgets.QGraphicsWidget.
setFont
(font)¶ - Parameters
font –
PySide6.QtGui.QFont
See also
-
PySide6.QtWidgets.QGraphicsWidget.
setGeometry
(x, y, w, h)¶ - Parameters
x – float
y – float
w – float
h – float
-
PySide6.QtWidgets.QGraphicsWidget.
setLayout
(layout)¶ - Parameters
layout –
PySide6.QtWidgets.QGraphicsLayout
See also
-
PySide6.QtWidgets.QGraphicsWidget.
setLayoutDirection
(direction)¶ - Parameters
direction –
LayoutDirection
See also
-
PySide6.QtWidgets.QGraphicsWidget.
setPalette
(palette)¶ - Parameters
palette –
PySide6.QtGui.QPalette
See also
-
PySide6.QtWidgets.QGraphicsWidget.
setShortcutAutoRepeat
(id[, enabled=true])¶ - Parameters
id – int
enabled – bool
If enabled
is true, auto repeat of the shortcut with the given id
is enabled; otherwise it is disabled.
-
PySide6.QtWidgets.QGraphicsWidget.
setShortcutEnabled
(id[, enabled=true])¶ - Parameters
id – int
enabled – bool
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.
-
PySide6.QtWidgets.QGraphicsWidget.
setStyle
(style)¶ - Parameters
style –
PySide6.QtWidgets.QStyle
Sets the widget’s style to style
. QGraphicsWidget does not take ownership of style
.
If no style is assigned, or style
is None
, the widget will use style()
(if this has been set). Otherwise the widget will use style()
.
This function sets the WA_SetStyle
attribute if style
is not None
; otherwise it clears the attribute.
See also
-
static
PySide6.QtWidgets.QGraphicsWidget.
setTabOrder
(first, second)¶ - Parameters
second –
PySide6.QtWidgets.QGraphicsWidget
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 None
, 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 None
, 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
-
PySide6.QtWidgets.QGraphicsWidget.
setWindowFlags
(wFlags)¶ - Parameters
wFlags –
WindowFlags
See also
-
PySide6.QtWidgets.QGraphicsWidget.
setWindowFrameMargins
(margins)¶ - Parameters
margins –
PySide6.QtCore.QMarginsF
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.
-
PySide6.QtWidgets.QGraphicsWidget.
setWindowFrameMargins
(left, top, right, bottom) - Parameters
left – float
top – float
right – float
bottom – float
This is an overloaded function.
Sets the widget’s window frame margins to left
, top
, right
and bottom
.
-
PySide6.QtWidgets.QGraphicsWidget.
setWindowTitle
(title)¶ - Parameters
title – str
See also
-
PySide6.QtWidgets.QGraphicsWidget.
showEvent
(event)¶ - Parameters
event –
PySide6.QtGui.QShowEvent
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 accept()
or ignore()
on event
has no effect.
See also
hideEvent()
ItemVisibleChange
-
PySide6.QtWidgets.QGraphicsWidget.
size
()¶ - Return type
-
PySide6.QtWidgets.QGraphicsWidget.
style
()¶ - Return type
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 style()
.
See also
-
PySide6.QtWidgets.QGraphicsWidget.
testAttribute
(attribute)¶ - Parameters
attribute –
WidgetAttribute
- Return type
bool
Returns true
if attribute
is enabled for this widget; otherwise, returns false
.
See also
-
PySide6.QtWidgets.QGraphicsWidget.
ungrabKeyboardEvent
(event)¶ - Parameters
event –
PySide6.QtCore.QEvent
This event handler, for event
, can be reimplemented in a subclass to receive notifications for UngrabKeyboard
events.
See also
ungrabKeyboard()
ungrabMouse()
-
PySide6.QtWidgets.QGraphicsWidget.
ungrabMouseEvent
(event)¶ - Parameters
event –
PySide6.QtCore.QEvent
This event handler, for event
, can be reimplemented in a subclass to receive notifications for UngrabMouse
events.
See also
ungrabMouse()
ungrabKeyboard()
-
PySide6.QtWidgets.QGraphicsWidget.
unsetLayoutDirection
()¶
-
PySide6.QtWidgets.QGraphicsWidget.
unsetWindowFrameMargins
()¶
Resets the window frame margins to the default value, provided by the style.
-
PySide6.QtWidgets.QGraphicsWidget.
windowFlags
()¶ - Return type
WindowFlags
See also
-
PySide6.QtWidgets.QGraphicsWidget.
windowFrameEvent
(e)¶ - Parameters
- Return type
bool
This event handler, for event
, receives events for the window frame if this widget is a window. Its base implementation provides support for default window frame interaction such as moving, resizing, etc.
You can reimplement this handler in a subclass of QGraphicsWidget to provide your own custom window frame interaction support.
Returns true
if event
has been recognized and processed; otherwise, returns false
.
See also
event()
-
PySide6.QtWidgets.QGraphicsWidget.
windowFrameGeometry
()¶ - Return type
Returns the widget’s geometry in parent coordinates including any window frame.
-
PySide6.QtWidgets.QGraphicsWidget.
windowFrameRect
()¶ - Return type
Returns the widget’s local rect including any window frame.
-
PySide6.QtWidgets.QGraphicsWidget.
windowFrameSectionAt
(pos)¶ - Parameters
pos –
PySide6.QtCore.QPointF
- Return type
Returns the window frame section at position pos
, or NoSection
if there is no window frame section at this position.
This function is used in QGraphicsWidget ‘s base implementation for window frame interaction.
You can reimplement this function if you want to customize how a window can be interactively moved or resized. For instance, if you only want to allow a window to be resized by the bottom right corner, you can reimplement this function to return NoSection
for all sections except BottomRightSection
.
-
PySide6.QtWidgets.QGraphicsWidget.
windowTitle
()¶ - Return type
str
See also
-
PySide6.QtWidgets.QGraphicsWidget.
windowType
()¶ - Return type
Returns the widgets window type.
See also
windowFlags()
isWindow()
isPanel()
© 2021 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.