Lots of examples of how to use different kinds of widgets.
![]()
Qt 带有现代应用程序用户,所期望的大量标准 Widget。
还可以开发自己的自定义 Widget 和控件,并使用它们与标准 Widget 一起。
甚至可以为 Widget 提供自定义样式和主题,用于改变标准 Widget 和适当编写的自定义 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.
指针式时钟范例展示如何绘制自定义 Widget 的内容。
范例展示如何使用信号/槽来实现计算器 Widget 功能,及如何使用 QGridLayout 将子级小部件放在栅格中。
日历 Widget 范例展示使用 QCalendarWidget。
字符映射范例展示如何创建既可以显示自身内容,又可以响应用户输入的自定义 Widget。
代码编辑器范例展示如何创建拥有行号和突显当前行的简单编辑器。
数字时钟范例展示如何使用 QLCDNumber 显示具有类似 LCD 数字的数。
Widgets-Gallery-Example
Widget 画廊范例展示用于设计 UI 的相关小部件。
组框范例展示如何在 Qt 中使用不同种类的组框。
The Icons example shows how QIcon can generate pixmaps reflecting an icon’s state, mode and size.
范例展示如何组合 QLabel 和 QScrollArea 以显示图像。
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 Movie example demonstrates how to use QMovie and QLabel to display animations.
The Scribble example shows how to reimplement some of QWidget’s event handlers to receive the events generated for the application’s widgets.
The Shaped Clock example shows how to apply a translucent background and a widget mask to a top-level widget to produce a shaped window.
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 Styles example illustrates how to create custom widget drawing styles using Qt, and demonstrates Qt’s predefined styles.
样式表范例展示如何使用样式表。
此范例展示如何在 Qt 应用程序中使用 Wacom 数位板。
俄罗斯方块范例是经典俄罗斯方块游戏的 Qt 版本。
The Tool Tips example shows how to provide static and dynamic tool tips for an application’s widgets.
The Wiggly example shows how to animate a widget using QBasicTimer and timerEvent(). In addition, the example demonstrates how to use QFontMetrics to determine the size of text on screen.
窗口标志范例展示如何使用可用于 Qt 的窗口标志。