Widgets 类

The primary elements for designing user interfaces in Qt.

Widget 类

下列章节列表 Widget 类。见 Qt Widget 画廊 举的一些范例。

基本 Widget 类

这些基本 Widget (控件),如按钮 组合框及滚动条,被设计为可直接使用。

../_images/fusion-label.png ../_images/windowsvista-pushbutton.png ../_images/macos-progressbar.png
../_images/fusion-combobox.png ../_images/windowsvista-radiobutton.png ../_images/macos-lineedit.png

PySide2.QtWidgets.QWidget

QWidget 类是所有用户界面对象的基类。

PySide2.QtWidgets.QCheckBox

The QCheckBox widget provides a checkbox with a text label.

PySide2.QtWidgets.QComboBox

QComboBox 小部件是组合按钮和弹出列表。

PySide2.QtWidgets.QCommandLinkButton

QCommandLinkButton 小部件提供 Vista 风格的命令链接按钮。

PySide2.QtWidgets.QDateTimeEdit

QDateTimeEdit 类提供用于编辑日期和时间的 Widget。

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

QDial 类提供四舍五入范围控制 (像速度计或电位计)。

PySide2.QtWidgets.QFocusFrame

The QFocusFrame widget provides a focus frame which can be outside of a widget’s normal paintable area.

PySide2.QtWidgets.QFontComboBox

QFontComboBox 小部件是让用户选择字体系列的组合框。

PySide2.QtWidgets.QLabel

QLabel 小部件提供文本或图像显示。

PySide2.QtWidgets.QLCDNumber

QLCDNumber 小部件显示带有类似 LCD 数字的数字。

PySide2.QtWidgets.QLineEdit

QLineEdit Widget 是一行文本编辑器。

PySide2.QtWidgets.QMenu

QMenu 类提供用于菜单栏、上下文菜单及其它弹出菜单的菜单 Widget。

PySide2.QtWidgets.QProgressBar

QProgressBar 小部件提供水平 (或垂直) 进度条。

PySide2.QtWidgets.QPushButton

QPushButton Widget 提供命令按钮。

PySide2.QtWidgets.QRadioButton

QRadioButton Widget 提供带文本标签的单选按钮。

PySide2.QtWidgets.QScrollArea

The QScrollArea class provides a scrolling view onto another widget.

PySide2.QtWidgets.QScrollBar

QScrollBar 小部件提供垂直 (或水平) 滚动条。

PySide2.QtWidgets.QSizeGrip

QSizeGrip 类提供用于重置顶层窗口尺寸的重置尺寸手柄。

PySide2.QtWidgets.QSlider

QSlider 小部件提供垂直 (或水平) 滑块。

PySide2.QtWidgets.QSpinBox

QSpinBox 类提供自旋框 Widget。

PySide2.QtWidgets.QDoubleSpinBox

QDoubleSpinBox 类提供采用双精度的自旋框 Widget。

PySide2.QtWidgets.QTabBar

QTabBar 类提供选项卡栏,例如:用于选项卡式对话框。

PySide2.QtWidgets.QTabWidget

QTabWidget 类提供选项卡式 Widget 的堆栈。

PySide2.QtWidgets.QToolBox

QToolBox 类提供选项卡化 Widget 项的列。

PySide2.QtWidgets.QToolButton

The QToolButton class provides a quick-access button to commands or options, usually used inside a QToolBar.

高级 Widget 类

高级 GUI Widget (如:选项卡小部件和进度条),提供更复杂的用户界面控件。

../_images/windows-treeview1.png ../_images/fusion-calendarwidget1.png ../_images/qundoview1.png

PySide2.QtWidgets.QColumnView

The QColumnView class provides a model/view implementation of a column view.

PySide2.QtWidgets.QDataWidgetMapper

QDataWidgetMapper 类提供在数据模型区间与 Widget 之间的映射。

PySide2.QtWidgets.QListView

QListView 类为模型提供列表或图标视图。

PySide2.QtWidgets.QTableView

QTableView 类提供表格视图的默认模型/视图实现。

PySide2.QtWidgets.QTreeView

QTreeView 类提供树视图的默认模型/视图实现。

PySide2.QtWidgets.QDesktopWidget

QDesktopWidget 类提供访问多头系统的屏幕信息。

PySide2.QtWidgets.QUndoView

The QUndoView class displays the contents of a QUndoStack.

PySide2.QtWidgets.QCalendarWidget

QCalendarWidget 类提供允许用户选择日期,基于月份的日历 Widget。

抽象 Widget 类

The abstract widget classes are base classes. They are not usable as standalone classes but provide functionality when they are subclassed.

PySide2.QtWidgets.QDialog

QDialog 类是对话框窗口的基类。

PySide2.QtWidgets.QAbstractButton

QAbstractButton 类是按钮 Widget 的抽象基类,提供按钮共有功能。

PySide2.QtWidgets.QAbstractScrollArea

QAbstractScrollArea 小部件提供带按需滚动条的卷动区域。

PySide2.QtWidgets.QAbstractSlider

QAbstractSlider 类提供在范围内的整数值。

PySide2.QtWidgets.QAbstractSpinBox

QAbstractSpinBox 类提供自旋框和行编辑,以显示值。

PySide2.QtWidgets.QFrame

QFrame 类是可以拥有框架的 Widget 基类。

组织器 Widget 类

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

QButtonGroup 类提供用于组织按钮 Widget 组的容器。

PySide2.QtWidgets.QGroupBox

The QGroupBox widget provides a group box frame with a title.

PySide2.QtWidgets.QSplitterHandle

QSplitterHandle 类为分割器提供手柄功能。

PySide2.QtWidgets.QSplitter

QSplitter 类实现分割器 Widget。

PySide2.QtWidgets.QStackedWidget

QStackedWidget 类提供每次仅一 Widget 可见的 Widget 堆栈。

PySide2.QtWidgets.QTabWidget

QTabWidget 类提供选项卡式 Widget 的堆栈。

图形视图类

PySide2.QtWidgets.QGraphicsEffect

QGraphicsEffect 类是用于所有图形效果的基类。

PySide2.QtWidgets.QGraphicsAnchorLayout

QGraphicsAnchorLayout 类提供可以在图形视图中将 Widget 锚定在一起的布局。

PySide2.QtWidgets.QGraphicsAnchor

The QGraphicsAnchor class represents an anchor between two items in a QGraphicsAnchorLayout.

PySide2.QtWidgets.QGraphicsGridLayout

QGraphicsGridLayout 类提供用于在图形视图中管理 Widget 的栅格布局。

PySide2.QtWidgets.QGraphicsItem

The QGraphicsItem class is the base class for all graphical items in a QGraphicsScene.

PySide2.QtWidgets.QGraphicsObject

QGraphicsObject 类提供基类用于所有要求信号、槽及特性的图形项。

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

QGraphicsItemGroup 类提供将一组项视为单项的容器。

PySide2.QtWidgets.QGraphicsItemAnimation

The QGraphicsItemAnimation class provides simple animation support for QGraphicsItem.

PySide2.QtWidgets.QGraphicsLayout

QGraphicsLayout 类提供基类为图形视图中的所有布局。

PySide2.QtWidgets.QGraphicsLayoutItem

QGraphicsLayoutItem 类可以被继承以允许自定义项由布局进行管理。

PySide2.QtWidgets.QGraphicsLinearLayout

QGraphicsLinearLayout 类提供用于在图形视图中管理 Widget 的水平或垂直布局。

PySide2.QtWidgets.QGraphicsProxyWidget

The QGraphicsProxyWidget class provides a proxy layer for embedding a QWidget in a QGraphicsScene.

PySide2.QtWidgets.QGraphicsScene

QGraphicsScene 类提供用于管理大量 2D 图形项的表面。

The QGraphicsSceneBspTreeIndex class provides an implementation of a BSP indexing algorithm for discovering items in QGraphicsScene.

PySide2.QtWidgets.QGraphicsSceneEvent

QGraphicsSceneEvent 类提供基类为所有图形视图相关事件。

PySide2.QtWidgets.QGraphicsSceneMouseEvent

QGraphicsSceneMouseEvent 类提供在图形视图框架中的鼠标事件。

PySide2.QtWidgets.QGraphicsSceneWheelEvent

QGraphicsSceneWheelEvent 类提供在图形视图框架中的滚轮事件。

PySide2.QtWidgets.QGraphicsSceneContextMenuEvent

QGraphicsSceneContextMenuEvent 类在图形视图框架中提供上下文菜单事件。

PySide2.QtWidgets.QGraphicsSceneHoverEvent

QGraphicsSceneHoverEvent 类提供在图形视图框架中的悬停事件。

PySide2.QtWidgets.QGraphicsSceneHelpEvent

QGraphicsSceneHelpEvent 类提供当请求工具提示时的事件。

PySide2.QtWidgets.QGraphicsSceneDragDropEvent

QGraphicsSceneDragDropEvent 类提供用于图形视图框架的拖放事件。

PySide2.QtWidgets.QGraphicsSceneResizeEvent

QGraphicsSceneResizeEvent 类提供用于在图形视图框架中重置 Widget 尺寸的事件。

PySide2.QtWidgets.QGraphicsSceneMoveEvent

QGraphicsSceneMoveEvent 类提供用于在图形视图框架中移动 Widget 的事件。

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

QGraphicsTransform 类是抽象基类用于在 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.

模型/视图类

PySide2.QtWidgets.QFileSystemModel

QFileSystemModel 类为本地文件系统提供数据模型。

PySide2.QtWidgets.QAbstractItemDelegate

QAbstractItemDelegate 类用于显示和编辑来自模型的数据项。

PySide2.QtWidgets.QAbstractItemView

QAbstractItemView 类为项视图类提供基本功能。

PySide2.QtWidgets.QColumnView

The QColumnView class provides a model/view implementation of a column view.

PySide2.QtWidgets.QDataWidgetMapper

QDataWidgetMapper 类提供在数据模型区间与 Widget 之间的映射。

PySide2.QtWidgets.QDirModel

The QDirModel class provides a data model for the local filesystem.

PySide2.QtWidgets.QHeaderView

QHeaderView 类为项视图提供 Header 头行 (或头列)。

PySide2.QtWidgets.QItemDelegate

The QItemDelegate class provides display and editing facilities for data items from a model.

PySide2.QtWidgets.QItemEditorFactory

QItemEditorFactory 类提供用于在视图和委托中编辑项数据的 Widget。

PySide2.QtWidgets.QItemEditorCreatorBase

QItemEditorCreatorBase 类提供必须被子类化的抽象基类,当实现新的项编辑器创建者时。

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

QListView 类为模型提供列表或图标视图。

PySide2.QtWidgets.QListWidgetItem

The QListWidgetItem class provides an item for use with the QListWidget item view class.

PySide2.QtWidgets.QListWidget

QListWidget 类提供基于项的列表 Widget。

PySide2.QtWidgets.QStyledItemDelegate

QStyledItemDelegate 类提供用于显示和编辑来自模型的数据项的设施。

PySide2.QtWidgets.QTableView

QTableView 类提供表格视图的默认模型/视图实现。

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

QTableWidget 类提供具有默认模型,基于项的表格视图。

PySide2.QtWidgets.QTreeView

QTreeView 类提供树视图的默认模型/视图实现。

PySide2.QtWidgets.QTreeWidgetItem

The QTreeWidgetItem class provides an item for use with the QTreeWidget convenience class.

PySide2.QtWidgets.QTreeWidget

QTreeWidget 类提供使用预定义树模型的树视图。

PySide2.QtWidgets.QTreeWidgetItemIterator

The QTreeWidgetItemIterator class provides a way to iterate over the items in a QTreeWidget instance.

布局类

PySide2.QtWidgets.QGraphicsAnchorLayout

QGraphicsAnchorLayout 类提供可以在图形视图中将 Widget 锚定在一起的布局。

PySide2.QtWidgets.QGraphicsAnchor

The QGraphicsAnchor class represents an anchor between two items in a QGraphicsAnchorLayout.

PySide2.QtWidgets.QBoxLayout

QBoxLayout 类水平或垂直排列子级 Widget。

PySide2.QtWidgets.QHBoxLayout

QHBoxLayout 类水平排列 Widget。

PySide2.QtWidgets.QVBoxLayout

QVBoxLayout 类垂直排列 Widget。

PySide2.QtWidgets.QFormLayout

QFormLayout 类管理输入 Widget 表单及其关联标签。

PySide2.QtWidgets.QGridLayout

QGridLayout 类在栅格中布局 Widget。

PySide2.QtWidgets.QLayout

QLayout 类是几何管理器的基类。

PySide2.QtWidgets.QLayoutItem

The QLayoutItem class provides an abstract item that a QLayout manipulates.

PySide2.QtWidgets.QSpacerItem

QSpacerItem 类在布局中提供空白空间。

PySide2.QtWidgets.QWidgetItem

QWidgetItem 类是表示 Widget 的布局项。

PySide2.QtWidgets.QSizePolicy

QSizePolicy 类是描述水平 垂直尺寸重置策略的布局属性。

PySide2.QtWidgets.QStackedLayout

QStackedLayout 类提供每次仅一 Widget 可见的 Widget 堆栈。

PySide2.QtWidgets.QButtonGroup

QButtonGroup 类提供用于组织按钮 Widget 组的容器。

PySide2.QtWidgets.QGroupBox

The QGroupBox widget provides a group box frame with a title.

PySide2.QtWidgets.QStackedWidget

QStackedWidget 类提供每次仅一 Widget 可见的 Widget 堆栈。