PySide6.QtGui#
- Functions
Attribute
Attribute.PySide6.QtGui.QInputMethodEvent.Attribute.type
Attribute.PySide6.QtGui.QInputMethodEvent.Attribute.start
Attribute.PySide6.QtGui.QInputMethodEvent.Attribute.length
Attribute.PySide6.QtGui.QInputMethodEvent.Attribute.value
Element
Element.PySide6.QtGui.QPainterPath.Element.x
Element.PySide6.QtGui.QPainterPath.Element.y
Element.PySide6.QtGui.QPainterPath.Element.type
FormatRange
FormatRange.PySide6.QtGui.QTextLayout.FormatRange.start
FormatRange.PySide6.QtGui.QTextLayout.FormatRange.length
FormatRange.PySide6.QtGui.QTextLayout.FormatRange.format
Key
PaintContext
PaintContext.PySide6.QtGui.QAbstractTextDocumentLayout.PaintContext.cursorPosition
PaintContext.PySide6.QtGui.QAbstractTextDocumentLayout.PaintContext.palette
PaintContext.PySide6.QtGui.QAbstractTextDocumentLayout.PaintContext.clip
PaintContext.PySide6.QtGui.QAbstractTextDocumentLayout.PaintContext.selections
PixmapFragment
PixmapFragment.PySide6.QtGui.QPainter.PixmapFragment.x
PixmapFragment.PySide6.QtGui.QPainter.PixmapFragment.y
PixmapFragment.PySide6.QtGui.QPainter.PixmapFragment.sourceLeft
PixmapFragment.PySide6.QtGui.QPainter.PixmapFragment.sourceTop
PixmapFragment.PySide6.QtGui.QPainter.PixmapFragment.width
PixmapFragment.PySide6.QtGui.QPainter.PixmapFragment.height
PixmapFragment.PySide6.QtGui.QPainter.PixmapFragment.scaleX
PixmapFragment.PySide6.QtGui.QPainter.PixmapFragment.scaleY
PixmapFragment.PySide6.QtGui.QPainter.PixmapFragment.rotation
PixmapFragment.PySide6.QtGui.QPainter.PixmapFragment.opacity
QAbstractFileIconProvider
QAbstractTextDocumentLayout
QAccessible
QAccessibleActionInterface
QAccessibleEditableTextInterface
QAccessibleEvent
QAccessibleInterface
QAccessibleObject
QAccessibleStateChangeEvent
QAccessibleTableCellInterface
QAccessibleTableModelChangeEvent
QAccessibleTextCursorEvent
QAccessibleTextInsertEvent
QAccessibleTextInterface
QAccessibleTextRemoveEvent
QAccessibleTextSelectionEvent
QAccessibleTextUpdateEvent
QAccessibleValueChangeEvent
QAccessibleValueInterface
QAction
QActionEvent
QActionGroup
QBackingStore
QBitmap
QBrush
QChildWindowEvent
QClipboard
QCloseEvent
QColor
QColorConstants
QColorSpace
QColorTransform
QConicalGradient
QContextMenuEvent
QCursor
QDesktopServices
QDoubleValidator
QDrag
QDragEnterEvent
QDragLeaveEvent
QDragMoveEvent
QDropEvent
QEnterEvent
QEventPoint
QExposeEvent
QFileOpenEvent
QFocusEvent
QFont
QFontDatabase
QFontInfo
QFontMetrics
QFontMetricsF
QGlyphRun
QGradient
QGuiApplication
QHelpEvent
QHideEvent
QHoverEvent
QIcon
QIconDragEvent
QIconEngine
QImage
QImageIOHandler
QImageReader
QImageWriter
QInputDevice
QInputEvent
QInputMethod
QInputMethodEvent
QInputMethodQueryEvent
QIntValidator
QKeyEvent
QKeySequence
QLinearGradient
QMatrix2x2
QMatrix2x3
QMatrix2x4
QMatrix3x2
QMatrix3x3
QMatrix3x4
QMatrix4x2
QMatrix4x3
QMatrix4x4
QMouseEvent
QMoveEvent
QMovie
QNativeGestureEvent
QNativeInterface
QOffscreenSurface
QOpenGLContext
QOpenGLContextGroup
QOpenGLExtraFunctions
QOpenGLFunctions
QPageLayout
QPageRanges
QPageSize
QPagedPaintDevice
QPaintDevice
QPaintDevice.PySide6.QtGui.QPaintDevice.painters
QPaintDeviceWindow
QPaintEngine
QPaintEngine.PySide6.QtGui.QPaintEngine.state
QPaintEngine.PySide6.QtGui.QPaintEngine.gccaps
QPaintEngine.PySide6.QtGui.QPaintEngine.active
QPaintEngine.PySide6.QtGui.QPaintEngine.selfDestruct
QPaintEngine.PySide6.QtGui.QPaintEngine.extended
QPaintEngineState
QPaintEngineState.PySide6.QtGui.QPaintEngineState.dirtyFlags
QPaintEvent
QPainter
QPainterPath
QPainterPathStroker
QPalette
QPdfWriter
QPen
QPicture
QPixelFormat
QPixmap
QPixmapCache
QPlatformSurfaceEvent
QPointerEvent
QPointingDevice
QPointingDeviceUniqueId
QPolygon
QPolygonF
QQuaternion
QRadialGradient
QRasterWindow
QRawFont
QRegion
QRegularExpressionValidator
QResizeEvent
QRgba64
QScreen
QScrollEvent
QScrollPrepareEvent
QSessionManager
QShortcut
QShortcutEvent
QShowEvent
QSinglePointEvent
QStandardItem
QStandardItemModel
QStaticText
QStatusTipEvent
QStyleHints
QSurface
QSurface.PySide6.QtGui.QSurface.m_type
QSurfaceFormat
QSyntaxHighlighter
QTabletEvent
QTextBlock
QTextBlockFormat
QTextBlockGroup
QTextBlockUserData
QTextCharFormat
QTextCursor
QTextDocument
QTextDocumentFragment
QTextDocumentWriter
QTextFormat
QTextFragment
QTextFrame
QTextFrameFormat
QTextImageFormat
QTextInlineObject
QTextItem
QTextLayout
QTextLength
QTextLine
QTextList
QTextListFormat
QTextObject
QTextObjectInterface
QTextOption
QTextTable
QTextTableCell
QTextTableCellFormat
QTextTableFormat
QToolBarChangeEvent
QTouchEvent
QTransform
QUndoCommand
QUndoGroup
QUndoStack
QValidator
QVector2D
QVector3D
QVector4D
QWhatsThisClickedEvent
QWheelEvent
QWindow
QWindowStateChangeEvent
QX11Application
Qt
Range
Range.PySide6.QtGui.QPageRanges.Range.from
Range.PySide6.QtGui.QPageRanges.Range.to
ScaledPixmapArgument
ScaledPixmapArgument.PySide6.QtGui.QIconEngine.ScaledPixmapArgument.size
ScaledPixmapArgument.PySide6.QtGui.QIconEngine.ScaledPixmapArgument.mode
ScaledPixmapArgument.PySide6.QtGui.QIconEngine.ScaledPixmapArgument.state
ScaledPixmapArgument.PySide6.QtGui.QIconEngine.ScaledPixmapArgument.scale
ScaledPixmapArgument.PySide6.QtGui.QIconEngine.ScaledPixmapArgument.pixmap
Selection
Selection.PySide6.QtGui.QAbstractTextDocumentLayout.Selection.cursor
Selection.PySide6.QtGui.QAbstractTextDocumentLayout.Selection.format
State
State.PySide6.QtGui.QAccessible.State.disabled
State.PySide6.QtGui.QAccessible.State.selected
State.PySide6.QtGui.QAccessible.State.focusable
State.PySide6.QtGui.QAccessible.State.focused
State.PySide6.QtGui.QAccessible.State.pressed
State.PySide6.QtGui.QAccessible.State.checkable
State.PySide6.QtGui.QAccessible.State.checked
State.PySide6.QtGui.QAccessible.State.checkStateMixed
State.PySide6.QtGui.QAccessible.State.readOnly
State.PySide6.QtGui.QAccessible.State.hotTracked
State.PySide6.QtGui.QAccessible.State.defaultButton
State.PySide6.QtGui.QAccessible.State.expanded
State.PySide6.QtGui.QAccessible.State.collapsed
State.PySide6.QtGui.QAccessible.State.busy
State.PySide6.QtGui.QAccessible.State.expandable
State.PySide6.QtGui.QAccessible.State.marqueed
State.PySide6.QtGui.QAccessible.State.animated
State.PySide6.QtGui.QAccessible.State.invisible
State.PySide6.QtGui.QAccessible.State.offscreen
State.PySide6.QtGui.QAccessible.State.sizeable
State.PySide6.QtGui.QAccessible.State.movable
State.PySide6.QtGui.QAccessible.State.selfVoicing
State.PySide6.QtGui.QAccessible.State.selectable
State.PySide6.QtGui.QAccessible.State.linked
State.PySide6.QtGui.QAccessible.State.traversed
State.PySide6.QtGui.QAccessible.State.multiSelectable
State.PySide6.QtGui.QAccessible.State.extSelectable
State.PySide6.QtGui.QAccessible.State.passwordEdit
State.PySide6.QtGui.QAccessible.State.hasPopup
State.PySide6.QtGui.QAccessible.State.modal
State.PySide6.QtGui.QAccessible.State.active
State.PySide6.QtGui.QAccessible.State.invalid
State.PySide6.QtGui.QAccessible.State.editable
State.PySide6.QtGui.QAccessible.State.multiLine
State.PySide6.QtGui.QAccessible.State.selectableText
State.PySide6.QtGui.QAccessible.State.supportsAutoCompletion
State.PySide6.QtGui.QAccessible.State.searchEdit
Svg
Tab
Tab.PySide6.QtGui.QTextOption.Tab.position
Tab.PySide6.QtGui.QTextOption.Tab.type
Tab.PySide6.QtGui.QTextOption.Tab.delimiter
Tag
iterator
iterator
Detailed Description#
The Qt GUI module provides classes for windowing system integration, event handling, OpenGL and OpenGL ES integration, 2D graphics, basic imaging, fonts, and text. These classes are used internally by Qt’s user interface technologies and can also be used directly, for instance to write applications using low-level OpenGL ES graphics APIs.
For application developers writing user interfaces, Qt provides higher level APIs, like Qt Quick, that are much more suitable than the enablers found in the Qt GUI module.
Application Windows#
The most important classes in the Qt GUI module are
QGuiApplication
and
QWindow
. A Qt application that wants
to show content on screen will need to make use of these.
QGuiApplication
contains the
main event loop, where all events from the window system and other
sources are processed and dispatched. It also handles the
application’s initialization and finalization.
The QWindow
class represents a window
in the underlying windowing system. It provides a number of virtual
functions to handle events ( QEvent
)
from the windowing system, such as touch-input, exposure, focus, key
strokes, and geometry changes.
2D Graphics#
The Qt GUI module contains classes for 2D graphics, imaging, fonts, and advanced typography.
A QWindow
created with the surface
type RasterSurface
can be used in
combination with QBackingStore
and QPainter
, Qt’s highly optimized
2D vector graphics API. QPainter
supports drawing lines, polygons, vector paths, images, and text. For
more information, see Paint System and
Raster Window Example .
Qt can load and save images using the
QImage
and
QPixmap
classes. By default, Qt
supports the most common image formats including JPEG and PNG among
others. Users can add support for additional formats via the
QImageIOPlugin
class. For more information,
see Reading and Writing Image
Files .
Typography in Qt is done with
QTextDocument
, which uses the
QPainter
API in combination with Qt’s
font classes, primarily QFont
.
Applications that prefer more low-level APIs to text and font handling
can use classes like QRawFont
and
QGlyphRun
.
OpenGL and OpenGL ES Integration#
QWindow
supports rendering using
OpenGL and OpenGL ES, depending on what the platform supports. OpenGL
rendering is enabled by setting the
QWindow
‘s surface type to
OpenGLSurface
, choosing the format
attributes with QSurfaceFormat
, and then creating a
QOpenGLContext
to manage the
native OpenGL context. In addition, Qt has
QOpenGLPaintDevice
,
which enables the use of OpenGL accelerated
QPainter
rendering, as well as
convenience classes that simplify the writing of OpenGL code and hides
the complexities of extension handling and the differences between
OpenGL ES 2 and desktop OpenGL. The convenience classes include
QOpenGLFunctions
that lets an
application use all the OpenGL ES 2 functions on desktop OpenGL
without having to manually resolve the OpenGL function pointers. This
enables cross-platform development of applications targeting mobile or
embedded devices, and provides classes that wrap native OpenGL
functionality in a simpler Qt API.
For more information, see the OpenGL Window Example .
The Qt GUI module also contains a few math classes to aid with the
most common mathematical operations related to 3D graphics. These
classes include QMatrix4x4
,
QVector4D
, and
QQuaternion
.
A QWindow
created with the
OpenGLSurface
can be used in combination
with QPainter
and
QOpenGLPaintDevice
to
have OpenGL hardware-accelerated 2D graphics by sacrificing some of
the visual quality.
Vulkan Integration#
Qt GUI has support for the Vulkan API. Qt applications require the presence of the LunarG Vulkan SDK .
On Windows, the SDK sets the environment variable VULKAN_SDK
,
which will be detected by the configure
script.
On Android, Vulkan headers were added in API level 24 of the NDK.
Relevant classes:
- QVulkanDeviceFunctions
QVulkanExtension
QVulkanFunctions
QVulkanInfoVector
QVulkanInstance
QVulkanWindow
QVulkanWindowRenderer
For more information, see the Hello Vulkan Widget Example and the Hello Vulkan Window Example .
Drag and Drop#
Qt GUI includes support for drag and drop. The Drag and Drop overview has more information.
Using the Module#
To include the definitions of modules classes, use the following directive:
import PySide6.QtGui
List of Classes#
A |
|||
B |
|||
C |
|||
D |
|||
E |
|||
F |
|||
G |
|||
H |
|||
I |
|||
K |
|||
L |
|||
M |
|||
N |
|||
O |
|||
P |
|||
Q |
|||
R |
|||
S |
|||
T |
|||
U |
|||
V |
|||
W |
|||
X |