Widget类

The Widget Classes

下面章节介绍widget类. 示例参见 Qt Widget Gallery.

基础Widget类

这些基础widgets(控件)类, 如. 按钮, 下拉列表框和滚动条, 可以直接使用.

QWidget

所有UI对象的基类

QCheckBox

带有文本标签的复选框

QComboBox

下列列表框

QCommandLinkButton

Vista风格的命令链接按钮

QDateEdit

基于QDateTimeEdit的日期编辑widget

QDateTimeEdit

日期时间编辑widget

QTimeEdit

基于QDateTimeEdit的时间编辑widget

QDial

圆形范围控件 (类似速度仪或电位器)

QFocusFrame

位于正常绘制区域之外的焦点框

QFontComboBox

字体下拉列表框

QLabel

显示文本或图片

QLCDNumber

显示类似LCD数字界面

QLineEdit

单行文本编辑器

QMenu

菜单widget

QProgressBar

水平或垂直进度条

QPushButton

命令按钮

QRadioButton

带文本标签的单选按钮

QScrollArea

依附其他widget的滚动区域

QScrollBar

垂直或水平滚动条

QSizeGrip

顶级窗口的大小调节控件

QSlider

垂直或水平滑块

QDoubleSpinBox

浮点型数字调节框

QSpinBox

数字调节框

QTabBar

标签栏, 例如. 用于标签对话框

QTabWidget

标签页

QToolBox

列表式标签页

QToolButton

命令或选项类的快捷访问按钮, 通常用于工具条

高级Widget类

高级GUI widgets, 如. 标签页和进度条, 提供复杂的UI控制.

QColumnView

实现模型/视图框架中的列表视图

QDataWidgetMapper

部分数据模型到widgets的映射

QListView

基于模型的列表或图标视图

QTableView

实现模型/视图框架中的默认表格视图

QTreeView

实现模型/视图框架中的默认树形视图

QDesktopWidget

在multi-head系统中访问屏幕信息

QUndoView

显示QUndoStack的内容

QCalendarWidget

以月为单位的日历widget, 允许用户选择日期

QMacCocoaViewContainer

承载macOS的Cocoa视图的Widget (即., NSView 派生类), 使其纳入Qt管理体系

QMacNativeWidget

辅助Qt widgets加入macOS的Cocoa体系的widget

抽象 Widget 类

抽象widget是一组基类. 它们不能直接使用, 必须提供子类化实现.

QDialog

对话框的基类

QAbstractButton

按钮widgets的抽象基类, 提供按钮类的公共函数

QAbstractScrollArea

带滚动条的滚动区域

QAbstractSlider

整型范围

QAbstractSpinBox

单行编辑的数字调节框

QFrame

带边框的widgets基类

组织Widget类

这种类包含分隔器, 标签栏, 按钮组等, 用于管理和分组GUI基础widget, 组成更复杂的应用程序和对话框.

QButtonGroup

将按钮widgets分组的容器

QGroupBox

带有标题的分组框

QSplitter

实现分隔功能的widget

QSplitterHandle

分隔器的辅助类

QStackedWidget

每次仅显示一个widget的层叠widget

QTabWidget

标签页

图像视图类

QGraphicsEffect

The base class for all graphics effects

QGraphicsAnchor

Represents an anchor between two items in a QGraphicsAnchorLayout

QGraphicsAnchorLayout

Layout where one can anchor widgets together in Graphics View

QGraphicsGridLayout

Grid layout for managing widgets in Graphics View

QAbstractGraphicsShapeItem

Common base for all path items

QGraphicsEllipseItem

Ellipse item that you can add to a QGraphicsScene

QGraphicsItem

The base class for all graphical items in a QGraphicsScene

QGraphicsItemGroup

Container that treats a group of items as a single item

QGraphicsLineItem

Line item that you can add to a QGraphicsScene

QGraphicsObject

Base class for all graphics items that require signals, slots and properties

QGraphicsPathItem

Path item that you can add to a QGraphicsScene

QGraphicsPixmapItem

Pixmap item that you can add to a QGraphicsScene

QGraphicsPolygonItem

Polygon item that you can add to a QGraphicsScene

QGraphicsRectItem

Rectangle item that you can add to a QGraphicsScene

QGraphicsSimpleTextItem

Simple text path item that you can add to a QGraphicsScene

QGraphicsTextItem

Text item that you can add to a QGraphicsScene to display formatted text

QGraphicsLayout

The base class for all layouts in Graphics View

QGraphicsLayoutItem

Can be inherited to allow your custom items to be managed by layouts

QGraphicsLinearLayout

Horizontal or vertical layout for managing widgets in Graphics View

QGraphicsProxyWidget

Proxy layer for embedding a QWidget in a QGraphicsScene

QGraphicsScene

Surface for managing a large number of 2D graphical items

QGraphicsSceneContextMenuEvent

Context menu events in the graphics view framework

QGraphicsSceneDragDropEvent

Events for drag and drop in the graphics view framework

QGraphicsSceneEvent

Base class for all graphics view related events

QGraphicsSceneHelpEvent

Events when a tooltip is requested

QGraphicsSceneHoverEvent

Hover events in the graphics view framework

QGraphicsSceneMouseEvent

Mouse events in the graphics view framework

QGraphicsSceneMoveEvent

Events for widget moving in the graphics view framework

QGraphicsSceneResizeEvent

Events for widget resizing in the graphics view framework

QGraphicsSceneWheelEvent

Wheel events in the graphics view framework

QGraphicsTransform

Abstract base class for building advanced transformations on QGraphicsItems

QGraphicsView

Widget for displaying the contents of a QGraphicsScene

QGraphicsWidget

The base class for all widget items in a QGraphicsScene

QStyleOptionGraphicsItem

Used to describe the parameters needed to draw a QGraphicsItem

QGraphicsSvgItem

QGraphicsItem that can be used to render the contents of SVG files

模型/视图类

QAbstractItemModel

The abstract interface for item model classes

QAbstractListModel

Abstract model that can be subclassed to create one-dimensional list models

QAbstractTableModel

Abstract model that can be subclassed to create table models

QModelIndex

Used to locate data in a data model

QPersistentModelIndex

Used to locate data in a data model

QAbstractProxyModel

Base class for proxy item models that can do sorting, filtering or other data processing tasks

QIdentityProxyModel

Proxies its source model unmodified

QItemSelection

Manages information about selected items in a model

QItemSelectionModel

Keeps track of a view's selected items

QItemSelectionRange

Manages information about a range of selected items in a model

QSortFilterProxyModel

Support for sorting and filtering data passed between another model and a view

QStringListModel

Model that supplies strings to views

QStandardItem

Item for use with the QStandardItemModel class

QStandardItemModel

Generic model for storing custom data

QFileSystemModel

Data model for the local filesystem

QAbstractItemDelegate

Used to display and edit data items from a model

QAbstractItemView

The basic functionality for item view classes

QColumnView

Model/view implementation of a column view

QDataWidgetMapper

Mapping between a section of a data model to widgets

QHeaderView

Header row or header column for item views

QItemDelegate

Display and editing facilities for data items from a model

QItemEditorCreator

Makes it possible to create item editor creator bases without subclassing QItemEditorCreatorBase

QItemEditorCreatorBase

Abstract base class that must be subclassed when implementing new item editor creators

QItemEditorFactory

Widgets for editing item data in views and delegates

QStandardItemEditorCreator

The possibility to register widgets without having to subclass QItemEditorCreatorBase

QListView

List or icon view onto a model

QListWidget

Item-based list widget

QListWidgetItem

Item for use with the QListWidget item view class

QStyledItemDelegate

Display and editing facilities for data items from a model

QTableView

Default model/view implementation of a table view

QTableWidget

Item-based table view with a default model

QTableWidgetItem

Item for use with the QTableWidget class

QTableWidgetSelectionRange

Way to interact with selection in a model without using model indexes and a selection model

QTreeView

Default model/view implementation of a tree view

QTreeWidget

Tree view that uses a predefined tree model

QTreeWidgetItem

Item for use with the QTreeWidget convenience class

QTreeWidgetItemIterator

Way to iterate over the items in a QTreeWidget instance

主窗口及相关类

QAction

Abstract user interface action that can be inserted into widgets

QActionGroup

Groups actions together

QWidgetAction

Extends QAction by an interface for inserting custom widgets into action based containers, such as toolbars

QDockWidget

Widget that can be docked inside a QMainWindow or floated as a top-level window on the desktop

QMainWindow

Main application window

QMdiArea

Area in which MDI windows are displayed

QMdiSubWindow

Subwindow class for QMdiArea

QMenu

Menu widget for use in menu bars, context menus, and other popup menus

QMenuBar

Horizontal menu bar

QSizeGrip

Resize handle for resizing top-level windows

QStatusBar

Horizontal bar suitable for presenting status information

QToolBar

Movable panel that contains a set of controls

Widget外观及相关类

Classes used for customizing UI appearance and style.

QCursor

Mouse cursor with an arbitrary shape

QPalette

Contains color groups for each widget state

QColor

Colors based on RGB, HSV or CMYK values

QFont

Specifies a font used for drawing text

QFontDatabase

Information about the fonts available in the underlying window system

QFontInfo

General information about fonts

QGraphicsAnchor

Represents an anchor between two items in a QGraphicsAnchorLayout

QGraphicsAnchorLayout

Layout where one can anchor widgets together in Graphics View

QCommonStyle

Encapsulates the common Look and Feel of a GUI

QStyle

Abstract base class that encapsulates the look and feel of a GUI

QStyleFactory

创建QStyle对象

QStyleHintReturn

Style hints that return more than basic data types

QStyleHintReturnMask

Style hints that return a QRegion

QStyleHintReturnVariant

Style hints that return a QVariant

QStyleOption

QStyle函数用于存储参数

QStylePainter

在widget中绘制QStyle元素的便捷类

布局类

QGraphicsAnchor

代表QGraphicsAnchorLayout中两个item间的一个anchor

QGraphicsAnchorLayout

图形视图框架中的anchor widgets布局

QBoxLayout

线性水平或垂直布局

QHBoxLayout

线性水平布局

QVBoxLayout

线性垂直布局

QFormLayout

输入widgets和关联标签的表格布局

QGridLayout

网格布局

QLayout

管理geometry的基类

QLayoutItem

一个QLayout操控的抽象item

QSpacerItem

布局中的空白空间

QWidgetItem

表示widget的布局item

QSizePolicy

描述水平或垂直大小调整策略的布局属性

QStackedLayout

每次仅显示一个widget的层叠布局

QButtonGroup

将按钮widgets分组的容器

QGroupBox

带有标题的分组框

QStackedWidget

每次仅显示一个widget的层叠widget