Widgets Classes¶
The primary elements for designing user interfaces in Qt.
The Widget Classes¶
The following sections list the widget classes. See the Qt Widget Gallery for some examples.
Basic Widget Classes¶
These basic widgets (controls), e.g. buttons, comboboxes and scroll bars, are designed for direct use.
PySide2.QtWidgets.QWidget
The QWidget class is the base class of all user interface objects.
PySide2.QtWidgets.QCheckBox
The QCheckBox widget provides a checkbox with a text label.
PySide2.QtWidgets.QComboBox
The QComboBox widget is a combined button and popup list.
PySide2.QtWidgets.QCommandLinkButton
The QCommandLinkButton widget provides a Vista style command link button.
PySide2.QtWidgets.QDateTimeEdit
The QDateTimeEdit class provides a widget for editing dates and times.
PySide2.QtWidgets.QTimeEdit
The QTimeEdit class provides a widget for editing times based on the QDateTimeEdit widget.
PySide2.QtWidgets.QDateEdit
The QDateEdit class provides a widget for editing dates based on the QDateTimeEdit widget.
PySide2.QtWidgets.QDial
The QDial class provides a rounded range control (like a speedometer or potentiometer).
PySide2.QtWidgets.QFocusFrame
The QFocusFrame widget provides a focus frame which can be outside of a widget’s normal paintable area.
PySide2.QtWidgets.QFontComboBox
The QFontComboBox widget is a combobox that lets the user select a font family.
PySide2.QtWidgets.QLabel
The QLabel widget provides a text or image display.
PySide2.QtWidgets.QLCDNumber
The QLCDNumber widget displays a number with LCD-like digits.
PySide2.QtWidgets.QLineEdit
The QLineEdit widget is a one-line text editor.
PySide2.QtWidgets.QMenu
The QMenu class provides a menu widget for use in menu bars, context menus, and other popup menus.
PySide2.QtWidgets.QProgressBar
The QProgressBar widget provides a horizontal or vertical progress bar.
PySide2.QtWidgets.QPushButton
The QPushButton widget provides a command button.
PySide2.QtWidgets.QRadioButton
The QRadioButton widget provides a radio button with a text label.
PySide2.QtWidgets.QScrollArea
The QScrollArea class provides a scrolling view onto another widget.
PySide2.QtWidgets.QScrollBar
The QScrollBar widget provides a vertical or horizontal scroll bar.
PySide2.QtWidgets.QSizeGrip
The QSizeGrip class provides a resize handle for resizing top-level windows.
PySide2.QtWidgets.QSlider
The QSlider widget provides a vertical or horizontal slider.
PySide2.QtWidgets.QSpinBox
The QSpinBox class provides a spin box widget.
PySide2.QtWidgets.QDoubleSpinBox
The QDoubleSpinBox class provides a spin box widget that takes doubles.
PySide2.QtWidgets.QTabBar
The QTabBar class provides a tab bar, e.g. for use in tabbed dialogs.
PySide2.QtWidgets.QTabWidget
The QTabWidget class provides a stack of tabbed widgets.
PySide2.QtWidgets.QToolBox
The QToolBox class provides a column of tabbed widget items.
PySide2.QtWidgets.QToolButton
The QToolButton class provides a quick-access button to commands or options, usually used inside a QToolBar.
Advanced Widget Classes¶
Advanced GUI widgets, e.g. tab widgets and progress bars, provide more complex user interface controls.
PySide2.QtWidgets.QColumnView
The QColumnView class provides a model/view implementation of a column view.
PySide2.QtWidgets.QDataWidgetMapper
The QDataWidgetMapper class provides mapping between a section of a data model to widgets.
PySide2.QtWidgets.QListView
The QListView class provides a list or icon view onto a model.
PySide2.QtWidgets.QTableView
The QTableView class provides a default model/view implementation of a table view.
PySide2.QtWidgets.QTreeView
The QTreeView class provides a default model/view implementation of a tree view.
PySide2.QtWidgets.QDesktopWidget
The QDesktopWidget class provides access to screen information on multi-head systems.
PySide2.QtWidgets.QUndoView
The QUndoView class displays the contents of a QUndoStack.
PySide2.QtWidgets.QCalendarWidget
The QCalendarWidget class provides a monthly based calendar widget allowing the user to select a date.
QMacCocoaViewContainer
The QMacCocoaViewContainer class provides a widget for macOS that can be used to wrap arbitrary Cocoa views (i.e., NSView subclasses) and insert them into Qt hierarchies.
QMacNativeWidget
The QMacNativeWidget class provides a widget for macOS that provides a way to put Qt widgets into Cocoa hierarchies.
Abstract Widget Classes¶
The abstract widget classes are base classes. They are not usable as standalone classes but provide functionality when they are subclassed.
PySide2.QtWidgets.QDialog
The QDialog class is the base class of dialog windows.
PySide2.QtWidgets.QAbstractButton
The QAbstractButton class is the abstract base class of button widgets, providing functionality common to buttons.
PySide2.QtWidgets.QAbstractScrollArea
The QAbstractScrollArea widget provides a scrolling area with on-demand scroll bars.
PySide2.QtWidgets.QAbstractSlider
The QAbstractSlider class provides an integer value within a range.
PySide2.QtWidgets.QAbstractSpinBox
The QAbstractSpinBox class provides a spinbox and a line edit to display values.
PySide2.QtWidgets.QFrame
The QFrame class is the base class of widgets that can have a frame.
Organizer Widget Classes¶
Classes like splitters, tab bars, button groups, etc are used for organizing and grouping GUI primitives into more complex applications and dialogs.
PySide2.QtWidgets.QButtonGroup
The QButtonGroup class provides a container to organize groups of button widgets.
PySide2.QtWidgets.QGroupBox
The QGroupBox widget provides a group box frame with a title.
PySide2.QtWidgets.QSplitterHandle
The QSplitterHandle class provides handle functionality for the splitter.
PySide2.QtWidgets.QSplitter
The QSplitter class implements a splitter widget.
PySide2.QtWidgets.QStackedWidget
The QStackedWidget class provides a stack of widgets where only one widget is visible at a time.
PySide2.QtWidgets.QTabWidget
The QTabWidget class provides a stack of tabbed widgets.
Graphics View Classes¶
PySide2.QtWidgets.QGraphicsEffect
The QGraphicsEffect class is the base class for all graphics effects.
PySide2.QtWidgets.QGraphicsAnchorLayout
The QGraphicsAnchorLayout class provides a layout where one can anchor widgets together in Graphics View.
PySide2.QtWidgets.QGraphicsAnchor
The QGraphicsAnchor class represents an anchor between two items in a QGraphicsAnchorLayout.
PySide2.QtWidgets.QGraphicsGridLayout
The QGraphicsGridLayout class provides a grid layout for managing widgets in Graphics View.
PySide2.QtWidgets.QGraphicsItem
The QGraphicsItem class is the base class for all graphical items in a QGraphicsScene.
PySide2.QtWidgets.QGraphicsObject
The QGraphicsObject class provides a base class for all graphics items that require signals, slots and properties.
PySide2.QtWidgets.QAbstractGraphicsShapeItem
The QAbstractGraphicsShapeItem class provides a common base for all path items.
PySide2.QtWidgets.QGraphicsPathItem
The QGraphicsPathItem class provides a path item that you can add to a QGraphicsScene.
PySide2.QtWidgets.QGraphicsRectItem
The QGraphicsRectItem class provides a rectangle item that you can add to a QGraphicsScene.
PySide2.QtWidgets.QGraphicsEllipseItem
The QGraphicsEllipseItem class provides an ellipse item that you can add to a QGraphicsScene.
PySide2.QtWidgets.QGraphicsPolygonItem
The QGraphicsPolygonItem class provides a polygon item that you can add to a QGraphicsScene.
PySide2.QtWidgets.QGraphicsLineItem
The QGraphicsLineItem class provides a line item that you can add to a QGraphicsScene.
PySide2.QtWidgets.QGraphicsPixmapItem
The QGraphicsPixmapItem class provides a pixmap item that you can add to a QGraphicsScene.
PySide2.QtWidgets.QGraphicsTextItem
The QGraphicsTextItem class provides a text item that you can add to a QGraphicsScene to display formatted text.
PySide2.QtWidgets.QGraphicsSimpleTextItem
The QGraphicsSimpleTextItem class provides a simple text path item that you can add to a QGraphicsScene.
PySide2.QtWidgets.QGraphicsItemGroup
The QGraphicsItemGroup class provides a container that treats a group of items as a single item.
PySide2.QtWidgets.QGraphicsItemAnimation
The QGraphicsItemAnimation class provides simple animation support for QGraphicsItem.
PySide2.QtWidgets.QGraphicsLayout
The QGraphicsLayout class provides the base class for all layouts in Graphics View.
PySide2.QtWidgets.QGraphicsLayoutItem
The QGraphicsLayoutItem class can be inherited to allow your custom items to be managed by layouts.
PySide2.QtWidgets.QGraphicsLinearLayout
The QGraphicsLinearLayout class provides a horizontal or vertical layout for managing widgets in Graphics View.
PySide2.QtWidgets.QGraphicsProxyWidget
The QGraphicsProxyWidget class provides a proxy layer for embedding a QWidget in a QGraphicsScene.
PySide2.QtWidgets.QGraphicsScene
The QGraphicsScene class provides a surface for managing a large number of 2D graphical items.
The QGraphicsSceneBspTreeIndex class provides an implementation of a BSP indexing algorithm for discovering items in QGraphicsScene.
PySide2.QtWidgets.QGraphicsSceneEvent
The QGraphicsSceneEvent class provides a base class for all graphics view related events.
PySide2.QtWidgets.QGraphicsSceneMouseEvent
The QGraphicsSceneMouseEvent class provides mouse events in the graphics view framework.
PySide2.QtWidgets.QGraphicsSceneWheelEvent
The QGraphicsSceneWheelEvent class provides wheel events in the graphics view framework.
PySide2.QtWidgets.QGraphicsSceneContextMenuEvent
The QGraphicsSceneContextMenuEvent class provides context menu events in the graphics view framework.
PySide2.QtWidgets.QGraphicsSceneHoverEvent
The QGraphicsSceneHoverEvent class provides hover events in the graphics view framework.
PySide2.QtWidgets.QGraphicsSceneHelpEvent
The QGraphicsSceneHelpEvent class provides events when a tooltip is requested.
PySide2.QtWidgets.QGraphicsSceneDragDropEvent
The QGraphicsSceneDragDropEvent class provides events for drag and drop in the graphics view framework.
PySide2.QtWidgets.QGraphicsSceneResizeEvent
The QGraphicsSceneResizeEvent class provides events for widget resizing in the graphics view framework.
PySide2.QtWidgets.QGraphicsSceneMoveEvent
The QGraphicsSceneMoveEvent class provides events for widget moving in the graphics view framework.
The QGraphicsSceneIndex class provides a base class to implement a custom indexing algorithm for discovering items in QGraphicsScene.
The QGraphicsSceneLinearIndex class provides an implementation of a linear indexing algorithm for discovering items in QGraphicsScene.
PySide2.QtWidgets.QGraphicsTransform
The QGraphicsTransform class is an abstract base class for building advanced transformations on QGraphicsItems.
PySide2.QtWidgets.QGraphicsView
The QGraphicsView class provides a widget for displaying the contents of a QGraphicsScene.
PySide2.QtWidgets.QGraphicsWidget
The QGraphicsWidget class is the base class for all widget items in a QGraphicsScene.
PySide2.QtWidgets.QStyleOptionGraphicsItem
The QStyleOptionGraphicsItem class is used to describe the parameters needed to draw a QGraphicsItem.
Model/View Classes¶
PySide2.QtWidgets.QFileSystemModel
The QFileSystemModel class provides a data model for the local filesystem.
PySide2.QtWidgets.QAbstractItemDelegate
The QAbstractItemDelegate class is used to display and edit data items from a model.
PySide2.QtWidgets.QAbstractItemView
The QAbstractItemView class provides the basic functionality for item view classes.
PySide2.QtWidgets.QColumnView
The QColumnView class provides a model/view implementation of a column view.
PySide2.QtWidgets.QDataWidgetMapper
The QDataWidgetMapper class provides mapping between a section of a data model to widgets.
PySide2.QtWidgets.QDirModel
The QDirModel class provides a data model for the local filesystem.
PySide2.QtWidgets.QHeaderView
The QHeaderView class provides a header row or header column for item views.
PySide2.QtWidgets.QItemDelegate
The QItemDelegate class provides display and editing facilities for data items from a model.
PySide2.QtWidgets.QItemEditorFactory
The QItemEditorFactory class provides widgets for editing item data in views and delegates.
PySide2.QtWidgets.QItemEditorCreatorBase
The QItemEditorCreatorBase class provides an abstract base class that must be subclassed when implementing new item editor creators.
QItemEditorCreator
The QItemEditorCreator class makes it possible to create item editor creator bases without subclassing QItemEditorCreatorBase.
QStandardItemEditorCreator
The QStandardItemEditorCreator class provides the possibility to register widgets without having to subclass QItemEditorCreatorBase.
PySide2.QtWidgets.QListView
The QListView class provides a list or icon view onto a model.
PySide2.QtWidgets.QListWidgetItem
The QListWidgetItem class provides an item for use with the QListWidget item view class.
PySide2.QtWidgets.QListWidget
The QListWidget class provides an item-based list widget.
PySide2.QtWidgets.QStyledItemDelegate
The QStyledItemDelegate class provides display and editing facilities for data items from a model.
PySide2.QtWidgets.QTableView
The QTableView class provides a default model/view implementation of a table view.
PySide2.QtWidgets.QTableWidgetSelectionRange
The QTableWidgetSelectionRange class provides a way to interact with selection in a model without using model indexes and a selection model.
PySide2.QtWidgets.QTableWidgetItem
The QTableWidgetItem class provides an item for use with the QTableWidget class.
PySide2.QtWidgets.QTableWidget
The QTableWidget class provides an item-based table view with a default model.
PySide2.QtWidgets.QTreeView
The QTreeView class provides a default model/view implementation of a tree view.
PySide2.QtWidgets.QTreeWidgetItem
The QTreeWidgetItem class provides an item for use with the QTreeWidget convenience class.
PySide2.QtWidgets.QTreeWidget
The QTreeWidget class provides a tree view that uses a predefined tree model.
PySide2.QtWidgets.QTreeWidgetItemIterator
The QTreeWidgetItemIterator class provides a way to iterate over the items in a QTreeWidget instance.
Layout Classes¶
PySide2.QtWidgets.QGraphicsAnchorLayout
The QGraphicsAnchorLayout class provides a layout where one can anchor widgets together in Graphics View.
PySide2.QtWidgets.QGraphicsAnchor
The QGraphicsAnchor class represents an anchor between two items in a QGraphicsAnchorLayout.
PySide2.QtWidgets.QBoxLayout
The QBoxLayout class lines up child widgets horizontally or vertically.
PySide2.QtWidgets.QHBoxLayout
The QHBoxLayout class lines up widgets horizontally.
PySide2.QtWidgets.QVBoxLayout
The QVBoxLayout class lines up widgets vertically.
PySide2.QtWidgets.QFormLayout
The QFormLayout class manages forms of input widgets and their associated labels.
PySide2.QtWidgets.QGridLayout
The QGridLayout class lays out widgets in a grid.
PySide2.QtWidgets.QLayout
The QLayout class is the base class of geometry managers.
PySide2.QtWidgets.QLayoutItem
The QLayoutItem class provides an abstract item that a QLayout manipulates.
PySide2.QtWidgets.QSpacerItem
The QSpacerItem class provides blank space in a layout.
PySide2.QtWidgets.QWidgetItem
The QWidgetItem class is a layout item that represents a widget.
PySide2.QtWidgets.QSizePolicy
The QSizePolicy class is a layout attribute describing horizontal and vertical resizing policy.
PySide2.QtWidgets.QStackedLayout
The QStackedLayout class provides a stack of widgets where only one widget is visible at a time.
PySide2.QtWidgets.QButtonGroup
The QButtonGroup class provides a container to organize groups of button widgets.
PySide2.QtWidgets.QGroupBox
The QGroupBox widget provides a group box frame with a title.
PySide2.QtWidgets.QStackedWidget
The QStackedWidget class provides a stack of widgets where only one widget is visible at a time.
© 2022 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.