Qt 提供一批代码样本和教程,以帮助新用户入门 Qt 开发。这些文档涵盖一系列话题、从 Widget 的基本用法到分步教程,以展示如何把应用程序拼凑在一起。
Calqlatr
|
A Qt Quick app designed for landscape and portrait devices that uses custom components, responsive layouts, and JavaScript for the application logic.
|
汽车配置器
|
A car model example that demonstrates using Qt Quick 3D cameras, extended scene environment and Qt Quick 3D.
|
咖啡机
|
具有基于状态的自定义用户界面的 Qt Quick 应用程序。
|
Dice
|
A dice throwing application using Qt Quick 3D Physics and other Qt Modules.
|
文档查看器
|
用于显示和打印 JSON、文本及 PDF 文件的 Widget 应用程序。
|
FX & 材质展厅
|
Demonstrates material and effects capabilities of Qt Quick 3D. This example demonstrates how you can use particle effects and materials in Qt Quick 3D.
|
文件系统资源管理器
|
A desktop QML app utilizing customized Qt Quick Controls to display text files from a filesystem
|
采用 Qt Quick 快速入门编程
|
基于警报应用程序的 Qt Quick 教程。
|
Lightning Viewer
|
An application with a responsive UI showing lightning strikes on a map in real-time by combining Qt Quick, Qt Location, Qt Positioning and Qt Websockets.
|
媒体播放器
|
使用 Qt Quick 播放音频和视频。
|
照片表面
|
A QML app for touch devices that uses a Repeater with a FolderListModel to access content in a folder, and a PinchHandler to handle pinch gestures on the fetched content.
|
Qt Quick 演示 - RESTful API 客户端
|
如何创建 RESTful API QML 客户端的范例。
|
机器臂
|
Demonstrates how to add a C++ backend to a 3D project from Qt Design Studio. This example demonstrates adding a C++ backend to a 3D project created in Qt Design Studio. The example itself consists of an interactive industrial robot arm in a Qt Quick 3D scene. The 2D UI to control the robot arm is implement using Qt Quick Controls.
|
相同游戏
|
Kuniaki Moribe 流行益智游戏的 QML 实现。
|
卫星信息
|
Satellite Info example shows the available satellites using Sky View, Table View, or RSSI View and the user's current position. It is implemented with Qt Positioning and Qt Quick
|
Thermostat
|
A user interface for a home thermostat, implemented in Qt Quick. It demonstrates how to create responsive applications that scale from large desktop displays to mobile and small embedded displays.
|
待办列表
|
A QML implementation of to do list application that demonstrates how to create application thats looks native on any platform.
|
WebEngine Quick 纳米浏览器
|
A web browser implemented using the WebEngineView QML type
|
COM App 范例 (ActiveQt)
|
COM App example shows how to use ActiveQt to develop a Qt application that can be automated via COM. Different QObject based classes are exposed as COM objects that communicate with the GUI of the running Qt application. The APIs of those COM objects has been designed to resemble the APIs of standard COM applications; i.e. those from Microsoft Office
|
计算器构建器
|
Creating a user interface from a Qt Designer form at run-time
|
计算器表单
|
在应用程序中使用采用 Qt Designer 创建的表单
|
计算器表单/多继承
|
在应用程序中使用采用 Qt Designer 创建的表单
|
容器扩展范例
|
Creating a custom multi-page plugin for Qt Designer
|
自定义 Widget 插件
|
Creating a custom widget plugin for Qt Designer
|
媒体播放器
|
使用 Qt Quick 播放音频和视频。
|
Outlook 范例 (ActiveQt)
|
Qutlook example demonstrates the use of ActiveQt to automate Outlook. The example makes use of the dumpcpp tool to generate a C++ namespace for the type library describing the Outlook Object Model
|
远程控制范例
|
使用和控制 Qt Assistant 作为帮助查看器
|
简单范例 (ActiveQt)
|
Simple example demonstrates the use of QAxBindable and QAxFactory
|
简单文本查看器范例
|
使用 Qt Assistant 作为应用程序的自定义帮助查看器
|
系统托盘图标范例
|
System Tray Icon example shows how to add an icon with a menu and popup messages to a desktop environment's system tray
|
随手屏幕截图
|
屏幕截图范例展示如何对桌面随手屏幕截图
|
任务菜单扩展
|
Creating a custom widget plugin for Qt Designer and providing custom task menu entries that are associated with the plugin
|
文本查找器
|
Dynamically loading .ui files using QUiLoader
|
包裹器范例 (ActiveQt)
|
Wrapper example demonstrates how to export existing QWidget classes as ActiveX controls, and the use of QAxFactory together with the QAXFACTORY_EXPORT() macro. ActiveX controls in this example are the standard button classes QPushButton, QCheckBox and QRadioButton as provided by Qt
|
包裹器范例 (ActiveQt)
|
Wrapper example demonstrates how to export existing QWidget classes as ActiveX controls, and the use of QAxFactory together with the QAXFACTORY_EXPORT() macro. ActiveX controls in this example are the standard button classes QPushButton, QCheckBox and QRadioButton as provided by Qt
|
咖啡机
|
具有基于状态的自定义用户界面的 Qt Quick 应用程序。
|
Custom Extension
|
Custom Extension shows how to implement a custom Wayland extension
|
自定义 Shell
|
Custom Shell shows how to implement a custom shell extension
|
Fancy Compositor
|
Fancy Compositor is an example that demonstrates how to write a fancy Wayland compositor in pure QML
|
IVI Compositor
|
IVI Compositor is an example that demonstrates how to use the IviApplication extension
|
Minimal CPP
|
Minimal CPP is an example that demonstrates how to write a Wayland compositor in C++
|
Minimal QML
|
Minimal QML is a simple example that demonstrates how to write a Wayland compositor in QML
|
Multi Output
|
Multi Output is an example that demonstrates a compositor with multiple outputs
|
Multi Screen
|
Multi Screen is a desktop-style Wayland compositor for multiple screens
|
Overview Compositor
|
Overview Compositor shows how to switch between clients in a grid
|
Qt Quick Controls - 可穿戴演示
|
Demonstrates an application launcher designed for wearable devices
|
QtShell Compositor
|
QtShell Compositor shows how to use the QtShell shell extension
|
Server Side Decoration Compositor
|
Server Side Decoration Compositor is a simple example that demonstrates server side window decorations on xdg-shell
|
Spanning Screens
|
Spanning Screens is an example that demonstrates how to let Wayland clients span multiple screens
|
Thermostat
|
A user interface for a home thermostat, implemented in Qt Quick. It demonstrates how to create responsive applications that scale from large desktop displays to mobile and small embedded displays.
|
Qt Quick 虚拟键盘
|
This example shows how to use the virtual keyboard in a Qt Quick application
|
可绑定特性
|
Demonstrates how the usage of bindable properties can simplify your C++ code
|
Books
|
Shows how to use Qt SQL classes with a model/view framework
|
Cached SQL Table
|
Cached Table example shows how a table view can be used to access a database, caching any changes to the data until the user explicitly submits them using a push button
|
连续缓存范例
|
Contiguous Cache example shows how to use QContiguousCache to manage memory usage for very large models. In some environments memory is limited and, even when it isn't, users still dislike an application using excessive memory. Using QContiguousCache to manage a list, rather than loading the entire list into memory, allows the application to limit the amount of memory it uses, regardless of the size of the data set it accesses
|
DOM Bookmarks Application
|
提供用于 XML 书签交换语言文件的读取器
|
Drill Down Example
|
Drill Down example shows how to read data from a database as well as submit changes, using the QSqlRelationalTableModel and QDataWidgetMapper classes
|
Hello 说话范例
|
Hello Speak example reads out user-provided text
|
IPC: Shared Memory
|
Demonstrates how to share image data between different processes using the Shared Memory IPC mechanism
|
MIME Type Browser
|
Shows the hierarchy of MIME types and can be used to determine the MIME type of a file
|
Mandelbrot
|
Mandelbrot example demonstrates multi-thread programming using Qt. It shows how to use a worker thread to perform heavy computations without blocking the main thread's event loop
|
Master Detail Example
|
Master Detail Example shows how to present data from different data sources in the same application. The album titles, and the corresponding artists and release dates, are kept in a database, while each album's tracks are stored in an XML file
|
Move Blocks
|
Move Blocks example shows how to animate items in a QGraphicsScene using a QStateMachine with a custom transition
|
Parsing and displaying CBOR data
|
A demonstration of how to parse files in CBOR format
|
Ping Pong States
|
Ping Pong States example shows how to use parallel states together with custom events and transitions in Qt State Machine Framework
|
Prime Counter
|
Demonstrates how to monitor the progress of concurrent operations
|
使用信号量的生产者和消费者
|
Producer and Consumer using Semaphores example shows how to use QSemaphore to control access to a circular buffer shared by a producer thread and a consumer thread
|
使用等待条件的生产者和消费者
|
Producer and Consumer using Wait Conditions example shows how to use QWaitCondition and QMutex to control access to a circular buffer shared by a producer thread and a consumer thread
|
QXmlStream 书签范例
|
Demonstrates how to read and write XBEL files
|
Qt OPC UA Viewer
|
使用模型/视图方式在树视图中显示 OPC UA 服务器的所有节点
|
Qt OPC UA X509 Support
|
展示如何生成密钥和证书签名请求
|
Qt Quick 范例 - 本地存储
|
A collection of QML local storage examples
|
Qt Quick Water Pump
|
Interacting with an OPC UA server to build a QML-based HMI for a simple water pump machine
|
Query Model Example
|
Query Model example shows how to make customized versions of data obtained from a SQL query, using a model that encapsulates the query and table views to display the results
|
队列自定义类型
|
Queued Custom Type example shows how to send custom types between threads with queued signals and slots
|
Quick Speech Example
|
Quick Speech example reads out user-provided text
|
关系表模型范例
|
Relational Table Model example shows how to use table views with a relational model to visualize the relations between items in a database
|
Rogue
|
Rogue example shows how to use the Qt state machine for event handling
|
SCXML Calculator
|
An application that implements the Calculator example presented in the SCXML Specification
|
SCXML Invoke
|
Invokes a compiled nested state machine
|
SCXML Media Player
|
Sends data to and receives it from a C++ data model
|
SCXML Sudoku
|
Demonstrates the use of separate javascript file with SCXML
|
SCXML Traffic Light (Dynamic, QML)
|
A Qt Quick application that uses a dynamically loaded state machine to implement a traffic light
|
SCXML Traffic Light (Dynamic, Widgets)
|
A widget-based application that uses a dynamically loaded state machine to implement a traffic light
|
SCXML Traffic Light (Simple, QML)
|
A Qt Quick application that uses a compiled state machine to implement a simplified traffic light
|
SCXML Traffic Light (Static, QML)
|
A Qt Quick application that uses a compiled state machine to implement a traffic light
|
SCXML Traffic Light (Static, Widgets)
|
A widget-based application that uses a compiled state machine to implement a traffic light
|
SQL Browser
|
SQL Browser example shows how a data browser can be used to visualize the results of SQL statements on a live database
|
SQL Widget Mapper Example
|
SQL Widget Mapper example shows how to use a map information from a database to widgets on a form
|
保存和加载游戏
|
How to save and load a game using Qt's JSON or CBOR classes
|
序列化转换器
|
How to convert between different serialization formats
|
表格模型范例
|
Table Model example shows how to use a specialized SQL table model with table views to edit information in a database
|
Traffic Light
|
Traffic Light example shows how to use Qt State Machine Overview to implement the control flow of a traffic light
|
撤消框架范例
|
This example shows how to implement undo/redo functionality with the Qt undo framework
|
Water Pump
|
Interacting with an OPC UA server to build a QML-based HMI for a simple water pump machine
|
Water Pump Simulation Server
|
An OPC UA server that implements a simple water pump machine simulation
|
Word Count
|
演示如何使用 map-reduce (映射缩减) 算法
|
最小 RSS 列表应用程序
|
演示如何抓取并显示网络资源
|
阻塞 Fortune 客户端
|
演示如何为网络服务创建客户端
|
广播接收器
|
演示如何通过本地网络接收广播信息
|
广播发送器
|
Demonstrates how to broadcast information to multiple clients on a local network
|
聊天
|
在用户应用程序中使用 Qt GRPC 客户端 API
|
DNS 查找
|
Demonstrates how to lookup a host name using QDnsLookup
|
DTLS 客户端
|
This example demonstrates how to implement client-side DTLS connections
|
DTLS 服务器
|
This examples demonstrates how to implement a simple DTLS server
|
Fortune 客户端
|
演示如何为网络服务创建客户端
|
Fortune 服务器
|
演示如何为网络服务创建服务器
|
HTTP 客户端
|
演示简单 HTTP 客户端
|
Image Scaling
|
演示如何异步下载和比例缩放图像
|
Lightning Viewer
|
An application with a responsive UI showing lightning strikes on a map in real-time by combining Qt Quick, Qt Location, Qt Positioning and Qt Websockets.
|
Magic 8 Ball
|
Creating a HTTP2 connection between a Qt GRPC client and a C++ gRPC server
|
多流客户端
|
演示如何在客户端侧使用 SCTP (流控制传输协议)
|
多流服务器
|
演示如何在服务器侧使用 SCTP (流控制传输协议)
|
多点播送接收器
|
演示如何接收发送给多点播送组的信息
|
多点播送发送器
|
演示如何把消息发送给多点播送组
|
网络聊天
|
演示有状态点对点聊天客户端
|
QML WebSocket 客户端
|
Explains how to write a QML WebSocket client example
|
QML WebSocket 服务器
|
A simple example that shows how to use a QML WebSocketServer
|
Qt Quick 演示 - RESTful API 客户端
|
如何创建 RESTful API QML 客户端的范例。
|
Reddit 范例
|
演示采用 OAuth 2 进行身份验证以访问 Reddit
|
SCXML FTP 客户端
|
使用状态机实现简单 FTP 客户端
|
安全套接字客户端
|
演示如何通过加密 SSL (安全套接字层) 连接通信
|
安全 WebSocket 回显客户端
|
A simple client application using secure WebSockets (wss)
|
安全 WebSocket 回显服务器
|
A simple server to respond to clients over secure WebSockets (wss)
|
传感器
|
Sensors example shows how two applications can communicate by sending protobuf messages using UDP sockets
|
简单 WebSocket 聊天
|
A minimal chat application using the WebSocket protocol
|
线程化 Fortune 服务器
|
Threaded Fortune Server example shows how to create a server for a simple network service that uses threads to handle requests from different clients. It is intended to be run alongside the Fortune Client example
|
Torrent 范例
|
演示复杂 TCP/IP 操作
|
WebSocket 回显客户端
|
Show how to write a simple WebSocket client application
|
WebSocket 回显服务器
|
展示如何编写简单 WebSocket 服务器应用程序
|
GeoJson Viewer (QML)
|
GeoJson viewer example demonstrates how to manipulate MapItems, handle user input and I/O to and from a GeoJson file
|
Lightning Viewer
|
An application with a responsive UI showing lightning strikes on a map in real-time by combining Qt Quick, Qt Location, Qt Positioning and Qt Websockets.
|
Log File Position Source (C++)
|
Logfile Position Source shows how to create and work with a custom position source. It can be useful for simulating GPS data, or when the data is received in some custom format
|
地图查看器 (QML)
|
Map Viewer example shows how to display and interact with a map, search for an address, and find driving directions
|
MapItemView Transitions (QML)
|
How to use transitions together with MapItemView
|
Minimal Map (QML)
|
Minimum code to display a map using Qt Quick
|
Places (QML)
|
Places example demonstrates how to search for Places and access related content
|
Places List (QML)
|
Places List example demonstrates how to search for and display a list of places using a ListView
|
地点地图 (QML)
|
Places Map example demonstrates how to search for and display a list of places on a map using a MapItemView
|
Plane Spotter (QML)
|
Plane Spotter example demonstrates the tight integration of location and positioning data types into QML
|
卫星信息
|
Satellite Info example shows the available satellites using Sky View, Table View, or RSSI View and the user's current position. It is implemented with Qt Positioning and Qt Quick
|
Weather Info
|
Weather Info example shows how to use the user's current position to retrieve local content from a web service in a C++ plugin for Qt Quick, using Qt Positioning
|
地址簿
|
Address book example shows how to use proxy models to display different views onto data from a single model
|
Arrow Pad 范例
|
理解 Qt Linguist 上下文概念和使用 2 种或多种语言
|
基本布局范例
|
Shows how to use the standard layout managers
|
基本排序/过滤模型范例
|
Basic Sort/Filter Model example illustrates how to use QSortFilterProxyModel to perform basic sorting and filtering
|
计算器范例
|
Example shows how to use signals and slots to implement the functionality of a calculator widget, and how to use QGridLayout to place child widgets in a grid
|
日历 Widget 范例
|
Calendar Widget example shows use of QCalendarWidget
|
组合框 Widget 映射器范例
|
Combo Widget Mapper example shows how to use a custom delegate to map information from a model to specific widgets on a form
|
补全器范例
|
Completer example shows how to provide string-completion facilities for an input widget based on data provided by a model
|
上下文大小写帮助范例
|
Using the QHelpEngineCore class to implement context-sensitive help for applications
|
自定义排序/过滤模型范例
|
Custom Sort/Filter Model example illustrates how to subclass QSortFilterProxyModel to perform advanced sorting and filtering
|
可拖拽图标范例
|
Draggable Icons example shows how to drag and drop image data between widgets in the same application, and between different applications
|
可拖拽文本范例
|
Illustrates how to drag and drop text between widgets
|
掉落站点范例
|
Example shows how to distinguish the various MIME formats available in a drag and drop operation
|
可编辑树模型范例
|
This example shows how to implement a simple item-based tree model that can be used with other classes in the model/view framework
|
抓取更多范例
|
Fetch More example shows how to add items to an item view model on demand
|
流式布局范例
|
Shows how to arrange widgets for different window sizes
|
冻结列范例
|
This example demonstrates how to freeze a column within a QTableView
|
采用 Qt Widgets 快速入门编程
|
A tutorial for Qt Widgets based notepad application
|
Hello tr() 范例
|
将小 Hello World 程序翻译成拉丁语
|
I18N 范例
|
演示 Qt 对翻译文本的支持
|
图像手势范例
|
Demonstrates the use of simple gestures in a widget
|
许可向导范例
|
License Wizard example shows how to implement complex wizards in Qt
|
行编辑范例
|
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
|
菜单范例
|
Menus example demonstrates how menus can be used in a main window application
|
Models and Views: AbstractItemModel Example
|
Shows how to use a QAbstractItemModel subclass as a model in QML
|
Models and Views: Object ListModel Example
|
Shows how to use a QList
as a model in QML
|
Models and Views: String ListModel Example
|
Shows how to use a QStringList as a model in QML
|
订购表单范例
|
Order Form example shows how to generate rich text documents by combining a simple template with data input by the user in a dialog
|
PDF 多页查看器范例
|
A Qt Quick PDF viewer that allows scrolling through the pages
|
PDF Single Page Viewer Example
|
A Qt Quick PDF viewer that views one page at a time
|
PDF 查看器 Widget 范例
|
A widget-based PDF viewer that allows scrolling through the pages
|
QML Dynamic View Ordering Tutorial 1 - A Simple ListView and Delegate
|
|
QQuickWidget - QQuickView Comparison Example
|
Demonstrates the benefits of QQuickWidget over a QQuickView embedded as a native window
|
QRegularExpression 范例
|
QRegularExpression example shows how regular expressions in Qt are applied to text by providing an environment in which new regular expressions can be created and tested on custom text strings
|
Qt Quick Controls - Contact List
|
A QML app using Qt Quick Controls and a C++ class that implements a simple contact list
|
Qt Quick Controls - Event Calendar
|
A simple event calendar
|
Qt Quick Controls - 图库
|
A gallery of controls
|
Qt Quick Examples - Pointer Handlers
|
Shows how to use Qt Quick Input Handlers in interactive components
|
Qt Quick 范例 - 定位器
|
This is a collection of QML Positioner examples
|
Qt Quick I18N
|
为 Qt Quick 应用程序生成翻译文件 (TS 和 QM)
|
Qt Quick Layouts - 基本范例
|
演示如何使用布局类型来排列 UI
|
Qt Quick Layouts - Responsive Layout Example
|
Demonstrates how to use LayoutItemProxy to make a responsive UI
|
Qt Quick Widgets 范例
|
Demonstrates how to mix QML with a Qt Widgets application using the QQuickWidget class
|
涂鸦范例
|
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 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
|
简单树模型范例
|
Simple Tree Model example shows how to use a hierarchical model with Qt's standard view classes
|
滑块范例
|
Sliders example shows how to use the different types of sliders available in Qt: QSlider, QScrollBar and QDial
|
自旋框范例
|
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
|
电子表格
|
Spreadsheet example shows how to create a simple spreadsheet application
|
标准对话框范例
|
Standard Dialogs example shows the standard dialogs that are provided by Qt
|
星号委托范例
|
Star Delegate example shows how to create a delegate that can paint itself and that supports editing
|
句法高亮范例
|
Syntax Highlighter example shows how to perform simple syntax highlighting
|
选项卡对话框范例
|
Tab Dialog example shows how to construct a tab dialog using the QTabWidget class
|
数位板范例
|
This example shows how to use a Wacom tablet in Qt applications
|
触摸旋钮范例
|
Shows how to create custom controls that accept touch input
|
半透明背景
|
Example shows how to make a round window with a translucent background
|
树模型补全器范例
|
Tree Model Completer example shows how to provide completion facilities for a hierarchical model, using a period as the separator to access Child, GrandChild and GrandGrandChild level objects
|
通俗向导范例
|
Trivial Wizard example illustrates how to create a linear three-page registration wizard using three instances of QWizardPage and one instance of QWizard
|
Troll Print 范例
|
更新用于稍后发行的翻译
|
UI 组件:表盘控件范例
|
Dial Control Example shows how to create a speedometer-type dial
|
UI 组件:可翻转范例
|
Flipable Example shows an item that flips whenever clicked, rotating around the y-axis
|
Widget 图库范例
|
Widgets Gallery example shows widgets relevant for designing UIs
|
Widget 教程 - 子级 Widget
|
|
Widget 教程 - 创建窗口
|
|
Widget 教程 - 嵌套布局
|
|
Widget 教程 - 使用布局
|
|
窗口标志范例
|
窗口标志范例展示如何使用可用于 Qt 的窗口标志
|