Qt Widgets 范例

Qt 带有现代应用程序用户,所期望的大量标准 Widget。

还可以开发自己的自定义 Widget 和控件,并使用它们与标准 Widget 一起。

甚至可以为 Widget 提供自定义样式和主题,用于改变标准 Widget 和适当编写的自定义 Widget 的外观。

指针式时钟

指针式时钟范例展示如何绘制自定义 Widget 的内容。

计算器范例

范例展示如何使用信号/槽来实现计算器 Widget 功能,及如何使用 QGridLayout 将子级小部件放在栅格中。

日历 Widget 范例

日历 Widget 范例展示使用 QCalendarWidget。

文档查看器

用于显示和打印 JSON、文本及 PDF 文件的 Widget 应用程序

组框范例

组框范例展示如何在 Qt 中使用不同种类的组框。

行编辑范例

The Line Edits example demonstrates the many ways that QLineEdit can be used, and shows the effects of various properties and validators on the input and output supplied by the user.

涂鸦范例

The Scribble example shows how to reimplement some of QWidget's event handlers to receive the events generated for the application's widgets.

Shortcut Editor Example

The Shortcut Editor example shows how to create a basic, read-write hierarchical model to use with Qt's standard view and QKeySequenceEdit classes. For a description of Model/View Programming, see the Model/View Programming overview.

滑块范例

The Sliders example shows how to use the different types of sliders available in Qt: QSlider, QScrollBar and QDial.

自旋框范例

The Spin Boxes example shows how to use the many different types of spin boxes available in Qt, from a simple QSpinBox widget to more complex editors like the QDateTimeEdit widget.

系统托盘图标范例

The System Tray Icon example shows how to add an icon with a menu and popup messages to a desktop environment's system tray.

数位板范例

此范例展示如何在 Qt 应用程序中使用 Wacom 数位板。

半透明背景

范例展示如何制作具有半透明背景的圆形窗口。

Widget 画廊范例

Widget 画廊范例展示用于设计 UI 的相关小部件。

窗口标志范例

窗口标志范例展示如何使用可用于 Qt 的窗口标志。