Qt 提供一批代码样本和教程,以帮助新用户入门 Qt 开发。这些文档涵盖一系列话题、从 Widget 的基本用法到分步教程,以展示如何把应用程序拼凑在一起。
范例是 Qt 包的一部分。请拜访 下载 页面,了解更多信息。
打开和运行范例在 Qt Creator
欢迎
模式。大多数范例可在各平台上运行且可搜索特定平台范例,在搜索字段中键入平台名称 (或任何关键字)。例如,键入
Android
在搜索字段中列表完全兼容 Android 的范例。
有关在 Qt Creator 中运行范例的更多信息,拜访 构建和运行范例 页面。
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 应用程序。 | |
A dice throwing application using Qt Quick 3D Physics and other Qt Modules. | |
用于显示和打印 JSON、文本及 PDF 文件的 Widget 应用程序。 | |
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 教程。 | |
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. | |
如何创建 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 | |
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. | |
A web browser implemented using the WebEngineView QML type |
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 | |
Creating a custom widget plugin for Qt Designer | |
使用 Qt Quick 播放音频和视频。 | |
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 作为帮助查看器 | |
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 | |
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 | |
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 |
A Qt Quick app designed for landscape and portrait devices that uses custom components, responsive layouts, and JavaScript for the application logic. | |
Demonstrates how to use the different chart types by using qml | |
具有基于状态的自定义用户界面的 Qt Quick 应用程序。 | |
A dice throwing application using Qt Quick 3D Physics and other Qt Modules. | |
Demonstrates OpenGL ES 3.0 functions via QOpenGLExtraFunctions | |
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. | |
Map Viewer example shows how to display and interact with a map, search for an address, and find driving directions | |
使用 Qt Quick 播放音频和视频。 | |
This Qt Quick based application shows how to use the API to capture a still image or video | |
A QML app using Qt Quick Controls and a C++ class that implements a simple contact list | |
A gallery of controls | |
Demonstrates an application launcher designed for wearable devices | |
Shows how to render OpenGL under a Qt Quick scene | |
Sensors Showcase example demonstrates sensor usage with visual examples |
具有基于状态的自定义用户界面的 Qt Quick 应用程序。 | |
Custom Extension shows how to implement a custom Wayland extension | |
Custom Shell shows how to implement a custom shell extension | |
Fancy Compositor is an example that demonstrates how to write a fancy Wayland compositor in pure QML | |
IVI Compositor is an example that demonstrates how to use the IviApplication extension | |
Minimal CPP is an example that demonstrates how to write a Wayland compositor in C++ | |
Minimal QML is a simple example that demonstrates how to write a Wayland compositor in QML | |
Multi Output is an example that demonstrates a compositor with multiple outputs | |
Multi Screen is a desktop-style Wayland compositor for multiple screens | |
Overview Compositor shows how to switch between clients in a grid | |
Demonstrates an application launcher designed for wearable devices | |
QtShell Compositor shows how to use the QtShell shell extension | |
Server Side Decoration Compositor is a simple example that demonstrates server side window decorations on xdg-shell | |
Spanning Screens is an example that demonstrates how to let Wayland clients span multiple screens | |
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. | |
This example shows how to use the virtual keyboard in a Qt Quick application |
2D Painting example shows how QPainter and QOpenGLWidget can be used together to display accelerated 2D graphics on supported hardware | |
可视化具有 40000 个芯片项的巨大图形视图场景 | |
Demonstrates how affine transformations in QPainter work | |
Analog Clock example shows how to draw the contents of a custom widget | |
Basic Drawing example shows how to display basic graphics primitives in a variety of styles using the QPainter class | |
演示如何创建基本图形布局 | |
如何采用 QQuickImageProvider 加载 QML 图像 | |
How to load images asynchronously in QML | |
Demonstrates how to animate items on a graphics view | |
Demonstrates how Composition Modes work in QPainter | |
Shows how to render a textured cube and integrate with QPainter and widgets, using QRhi Qt's 3D API and shading language abstraction layer | |
演示如何使用图形视图框架 | |
Demonstrates how to drag and drop items in a graphics view | |
Demonstrates how to interact with graphical items in a scene | |
Shows how gradients can be used with QPainter | |
Demonstrates OpenGL ES 3.0 functions via QOpenGLExtraFunctions | |
Shows the basics of using QVulkanWindow | |
Shows the basics of rendering with QVulkanWindow and the Vulkan API | |
Shows the usage of QVulkanWindow in QWidget applications | |
展示 QPainter 中的合成模式如何工作 | |
This example shows how to create a minimal QWindow based application for the purpose of using OpenGL | |
Painter Paths example shows how to use painter paths to build complex shapes for rendering | |
Path Stroking example shows various types of pens that can be used with QPainter | |
This example shows how to create a minimal QOpenGLWidget based application with stereoscopic rendering support | |
Shows how to render a Qt Quick scene into a texture that is then used by a non-Quick based Direct3D 11 renderer | |
Shows how to render a Qt Quick scene into a texture that is then used by a non-Quick based OpenGL renderer | |
Shows how to render a Qt Quick scene into a QRhiTexture | |
Demonstrates use of QQuickAttachedPropertyPropagator | |
A QML app using Qt Quick Controls and a QML plugin with customized controls | |
An automotive user interface using custom Imagine style assets | |
A rich-text editor app using Qt Quick Controls | |
演示使用 ListView 类型去显示由 ListModel 生成的数据,及使用 SpringAnimation 类型去动画图像的 QML 时钟应用程序。 | |
This example demonstrates the implementation of accessible buttons | |
This is a collection of QML Animation examples | |
This is a collection of QML Canvas examples | |
This is a collection of QML drag and drop examples | |
Demonstrates embedding a QQuickWindow into a QWidget UI via QWidget::createWindowContainer() | |
This is a collection of QML examples relating to image types | |
A Qt Quick example shows how to setup variable refresh rate for specific parts of the UI | |
This is a collection of QML keyboard interaction examples | |
This is an example of the MouseArea type in QML | |
Demonstrates MultiEffect usage | |
Demonstrates MultiEffect usage | |
A Qt Quick example demonstrating the use of shader effects | |
A Qt Quick example demonstrating the use of shape items | |
This is a collection of QML examples relating to text | |
这是 QML 模型/视图范例的集合 | |
This example demonstrates the Window and Screen types in QML | |
这是使用 QML 粒子系统 Affector 范例的集合 | |
This is a collection of examples using Emitters in the QML particle system | |
这是使用 QML 粒子系统 Affector 范例的集合 | |
这是使用 QML 粒子系统 Affector 范例的集合 | |
Conway’s Game of Life example shows how the QML TableView type can be used to display a C++ model that the user can pan around | |
Pixelator example shows how a QML TableView and a delegate can be used for custom table models | |
A widget example with menus, toolbars and a status bar. | |
This example shows how to create a minimal QWindow-based application using QRhi | |
This example shows how to create a minimal QWindow based application using QPainter for rendering | |
Shows how to implement a custom geometry in the Qt Quick Scene Graph | |
Shows how to implement a custom material in the Qt Quick Scene Graph | |
Shows how to use QSGRenderNode to implement custom rendering in the Qt Quick scenegraph | |
Shows how to render directly with Direct3D 11 under a Qt Quick scene | |
Demonstrates how one can combine custom materials and geometries under a single QQuickItem | |
Shows how to use a texture created directly with Metal | |
Shows how to render directly with Metal under a Qt Quick scene | |
Shows how to render OpenGL under a Qt Quick scene | |
Shows how to implement QPainter-based custom scenegraph items | |
Shows how to implement a custom QQuickItem that displays a QRhi-rendered texture | |
Shows how to render directly with QRhi under a Qt Quick scene | |
Shows benefits of custom items animating independently of the main thread while using the threaded render loop of Qt Quick | |
Shows how to combine two textures from two texture providers in a custom scene graph node | |
Shows how to use a texture created directly with Vulkan | |
Shows how to render directly with Vulkan under a Qt Quick scene | |
演示图形视图场景中的锚点布局 | |
Shows how to render a triangle using QRhi, Qt's 3D API and shading language abstraction layer | |
Transformations example shows how transformations influence the way that QPainter renders graphics primitives | |
Demonstrates how to manipulate the elements of a QPainterPath | |
A Qt Quick Shapes example demonstrating different ways to uses shapes in an application | |
Demonstrates how to use an effect created with the Qt Quick Effect Maker (QQEM) |
Testing the available audio devices and their configuration | |
Enabling audio playback using the QAudioSink class | |
Discovering the available devices and supported codecs | |
Recording audio using the QAudioSource class | |
Shows how to capture a still image or record video | |
Easing Curves example shows how to use easing curves to control the speed of an animation | |
播放音频和视频 | |
This Qt Quick based application shows how to use the API to capture a still image or video | |
Transforming video and camera viewfinder content | |
Recording audio and video using Qt Quick | |
Capturing a screen or window | |
Shows some of the capabilities of the spatial audio engine in Qt | |
Analyzing a raw audio stream using the FFTReal library | |
Streaming video on a graphics scene | |
实现视频播放器 Widget |
Shows how to manually rotate a textured 3D cube with user input | |
Demonstrates material and effects capabilities of Qt Quick 3D. This example demonstrates how you can use particle effects and materials in Qt Quick 3D. | |
Hello GL2 example demonstrates the basic use of the OpenGL-related classes provided with Qt | |
Demonstrates simple instanced drawing | |
A 3D building viewer of OSM (OpenStreetMap) buildings map data. | |
展示由 Qt 3D 提供的 4 个基本形状,并为每个形状设置网格 | |
QML 范例演示从多个视口渲染场景图形 | |
QML 应用程序演示使用 PBR 材质 | |
演示如何在 Qt 3D 渲染场景的 C++ 应用程序 | |
演示在 Qt 3D 中创建自定义材质 | |
QML 应用程序演示如何在 Qt 3D 中渲染场景 | |
Qt 3D QML 应用程序实现单通线框渲染方法 | |
Demonstrates the antialiasing modes in Qt Quick 3D | |
Demonstrates the use of baked lightmaps in a 3D scene | |
Demonstrates writing custom post-processing effects | |
Demonstrates providing custom vertex data from C++ and QML | |
Demonstrates instancing with custom materials and a C++ instance table | |
Demonstrates writing shaded custom materials | |
Demonstrates writing C++ custom geometry with a morph target | |
Demonstrates the use of custom vertex and fragment shaders | |
Demonstrates dynamic model creation | |
Demonstrates how to render 2D and 3D objects together in Qt Quick 3D | |
Demonstrates how to do instanced rendering in Qt Quick 3D | |
Demonstrates how to render a scene in Qt Quick 3D | |
Demonstrates the use of level of detail helper | |
Demonstrates the use of different light types | |
Demonstrates how to control morphing animations in Qt Quick 3D | |
Demonstrates the use of the experimental build-time material processing support | |
Demonstrates how to use the Qt Quick 3D Particles3D module | |
Demonstrates picking of models | |
Demonstrates the use of Principled Material | |
Demonstrates how to provide custom texture data from C++ or QML | |
Demonstrates how to create a simple game using Quick3D | |
Demonstrates the use of Qt Quick Items in Quick 3D scene | |
Demonstrates the use of reflection probes in Qt Quick 3D | |
Demonstrates how assets can be loaded at runtime | |
Demonstrates the use of ExtendedSceneEnvironment | |
Demonstrates reflections in Qt Quick 3D | |
Demonstrates how to enable fog in the 3D scene | |
Demonstrates how to render a simple skinning animation in Qt Quick 3D | |
Demonstrates how the QtQuick3D Render Extension can be used to implement stencil outlining | |
Demonstrates how assign materials to sub-meshes | |
Demonstrates the use of View3D to show a scene from multiple cameras | |
Qt Quick application that presents a 3D model of a virtual assistant with dynamic animations created using QML and timelines | |
Demonstrates how to do volumetric rendering in Qt Quick 3D | |
Demonstrates how to spawn physical objects | |
Demonstrates the CharacterController type | |
Demonstrates using complex collision shapes | |
Demonstrates using different shapes | |
Demonstrates using trigger bodies and collision info | |
Demonstrates different ways of setting mass and inertia of a body | |
Demonstrates using physical materials | |
Demonstrates setting up a simple physics scene |
This example shows the drawing of microphone samples vs audio level | |
Implementing axis dragging with a custom input handler in QML, and creating a custom axis formatter | |
Demonstrates how to use the different chart types by using qml | |
An application that demonstrates the Qt Charts Widgets API | |
Gallery of Bar, Scatter, and Surface graphs | |
Using Graphs for 2D in a Qt Quick application | |
Example shows how to enable OpenGL acceleration for QLineSeries and QScatterSeries | |
Example shows how to implement application with strict performance requirements using the Qt Charts QML API | |
This is a basic demonstration showing how to use the different chart types by using qml | |
Using Bars3D in a QML application | |
Using Scatter3D in a QML application | |
A configurable stock chart for 100 stocks. | |
Gallery with three different ways to use a Surface3D graph | |
Rendering volumetric objects | |
Example shows how to create your own custom zooming effect |
Demonstrates how the usage of bindable properties can simplify your C++ code | |
Shows how to use Qt SQL classes with a model/view framework | |
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 | |
提供用于 XML 书签交换语言文件的读取器 | |
Drill Down example shows how to read data from a database as well as submit changes, using the QSqlRelationalTableModel and QDataWidgetMapper classes | |
Hello Speak example reads out user-provided text | |
Demonstrates how to share image data between different processes using the Shared Memory IPC mechanism | |
Shows the hierarchy of MIME types and can be used to determine the MIME type of a file | |
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 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 example shows how to animate items in a QGraphicsScene using a QStateMachine with a custom transition | |
A demonstration of how to parse files in CBOR format | |
Ping Pong States example shows how to use parallel states together with custom events and transitions in Qt State Machine Framework | |
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 | |
Demonstrates how to read and write XBEL files | |
使用模型/视图方式在树视图中显示 OPC UA 服务器的所有节点 | |
展示如何生成密钥和证书签名请求 | |
A collection of QML local storage examples | |
Interacting with an OPC UA server to build a QML-based HMI for a simple water pump machine | |
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 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 example shows how to use the Qt state machine for event handling | |
An application that implements the Calculator example presented in the SCXML Specification | |
Invokes a compiled nested state machine | |
Sends data to and receives it from a C++ data model | |
Demonstrates the use of separate javascript file with SCXML | |
A Qt Quick application that uses a dynamically loaded state machine to implement a traffic light | |
A widget-based application that uses a dynamically loaded state machine to implement a traffic light | |
A Qt Quick application that uses a compiled state machine to implement a simplified traffic light | |
A Qt Quick application that uses a compiled state machine to implement a traffic light | |
A widget-based application that uses a compiled state machine to implement a traffic light | |
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 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 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 | |
Interacting with an OPC UA server to build a QML-based HMI for a simple water pump machine | |
An OPC UA server that implements a simple water pump machine simulation | |
演示如何使用 map-reduce (映射缩减) 算法 |
Reads formatted NFC Data Exchange Format (NDEF) messages | |
Shows how to use the synchronous API of QSerialPort in a non-GUI thread | |
Shows how to use the synchronous API of QSerialPort in a worker thread | |
Shows communication through Bluetooth using RFCOMM protocol | |
A game demonstrating the interaction with a Bluetooth Low Energy Heart Rate device/service | |
An example demonstrating how to set up and advertise a GATT service. The example demonstrates the use of the Qt Bluetooth Low Energy classes related to peripheral (slave) functionality | |
An application designed to browse the content of Bluetooth Low Energy peripheral devices. The example demonstrates the use of all Qt Bluetooth Low Energy classes | |
Example sends and receives CAN bus frames | |
演示应用程序实例之间的通信 | |
Demonstrates usage of the Qt D-Bus typesystem | |
Demonstrates a simple message system using D-Bus | |
Shows how to use Qt D-Bus to control a car from another application | |
Demonstrates using QLocalSocket for a simple local service client | |
Demonstrates using QLocalServer and QLocalSocket for serving a simple local service | |
Creating a application that communicates with an MQTT broker | |
Example implements a Modbus client application | |
Example shows how to handle custom Modbus function codes | |
Example implements a Modbus server application | |
Developing a very simple client program which displays the content and changes made on a server | |
Developing a simple server program that displays and makes changes to a QTreeView which is made available on a Remote Objects network | |
Reads and writes NFC Data Exchange Format (NDEF) messages to NFC Forum Tags | |
Use Qt Quick Controls to create an application that can publish on MQTT topics | |
Use Qt Quick Controls to create an application that can subscribe to MQTT topics | |
Using a non-QIODevice-based transport (QWebSocket) with QtRemoteObjects | |
使用 CoAP 客户端采用 Qt Quick 用户界面进行多点播送资源探索 | |
Securing the CoAP client and using it with a Qt Quick user interface | |
Setting up a secure Remote Object network using QSslSockets | |
Shows how to use various features of QSerialPort | |
Creating an application that communicates with a CoAP server | |
Creating a minimalistic telemetry application | |
A minimalist Remote Object server and client | |
A client who holds a replica of a time object from a server and displays the time in a clock | |
A server which shares a time object with connected clients | |
Combining an MQTT client with a web socket connection |
演示如何抓取并显示网络资源 | |
演示如何为网络服务创建客户端 | |
演示如何通过本地网络接收广播信息 | |
Demonstrates how to broadcast information to multiple clients on a local network | |
在用户应用程序中使用 Qt GRPC 客户端 API | |
Demonstrates how to lookup a host name using QDnsLookup | |
This example demonstrates how to implement client-side DTLS connections | |
This examples demonstrates how to implement a simple DTLS server | |
演示如何为网络服务创建客户端 | |
演示如何为网络服务创建服务器 | |
演示简单 HTTP 客户端 | |
演示如何异步下载和比例缩放图像 | |
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. | |
Creating a HTTP2 connection between a Qt GRPC client and a C++ gRPC server | |
演示如何在客户端侧使用 SCTP (流控制传输协议) | |
演示如何在服务器侧使用 SCTP (流控制传输协议) | |
演示如何接收发送给多点播送组的信息 | |
演示如何把消息发送给多点播送组 | |
演示有状态点对点聊天客户端 | |
Explains how to write a QML WebSocket client example | |
A simple example that shows how to use a QML WebSocketServer | |
如何创建 RESTful API QML 客户端的范例。 | |
演示采用 OAuth 2 进行身份验证以访问 Reddit | |
使用状态机实现简单 FTP 客户端 | |
演示如何通过加密 SSL (安全套接字层) 连接通信 | |
A simple client application using secure WebSockets (wss) | |
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 | |
A minimal chat application using the WebSocket protocol | |
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 | |
演示复杂 TCP/IP 操作 | |
Show how to write a simple WebSocket client application | |
展示如何编写简单 WebSocket 服务器应用程序 |
GeoJson viewer example demonstrates how to manipulate MapItems, handle user input and I/O to and from a GeoJson file | |
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. | |
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 | |
Map Viewer example shows how to display and interact with a map, search for an address, and find driving directions | |
How to use transitions together with MapItemView | |
Minimum code to display a map using Qt Quick | |
Places example demonstrates how to search for Places and access related content | |
Places List example demonstrates how to search for and display a list of places using a ListView | |
Places Map example demonstrates how to search for and display a list of places on a map using a MapItemView | |
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 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 | |
理解 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 | |
Calendar Widget example shows use of QCalendarWidget | |
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 | |
A tutorial for Qt Widgets based notepad application | |
将小 Hello World 程序翻译成拉丁语 | |
演示 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 | |
Shows how to use a QAbstractItemModel subclass as a model in QML | |
Shows how to use a QList
|
|
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 | |
A Qt Quick PDF viewer that allows scrolling through the pages | |
A Qt Quick PDF viewer that views one page at a time | |
A widget-based PDF viewer that allows scrolling through the pages | |
QML Dynamic View Ordering Tutorial 1 - A Simple ListView and Delegate |
|
Demonstrates the benefits of QQuickWidget over a QQuickView embedded as a native window | |
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 | |
A QML app using Qt Quick Controls and a C++ class that implements a simple contact list | |
A simple event calendar | |
A gallery of controls | |
Shows how to use Qt Quick Input Handlers in interactive components | |
This is a collection of QML Positioner examples | |
为 Qt Quick 应用程序生成翻译文件 (TS 和 QM) | |
演示如何使用布局类型来排列 UI | |
Demonstrates how to use LayoutItemProxy to make a responsive UI | |
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 | |
更新用于稍后发行的翻译 | |
Dial Control Example shows how to create a speedometer-type dial | |
Flipable Example shows an item that flips whenever clicked, rotating around the y-axis | |
Widgets Gallery example shows widgets relevant for designing UIs | |
窗口标志范例展示如何使用可用于 Qt 的窗口标志 |
演示简单 HTTP 客户端 | |
A QML RSS news reader that uses XmlListModel and XmlListModelRole custom QML types to download XML data, ListModel and ListElement to create a category list, and ListView to display the data. | |
A HTML/JavaScript client that communicates over a WebSocket with a QWebChannel server | |
A QML client that communicates over a WebSocket with a QWebChannel server | |
A simple chat server implemented using the QWebChannel C++ API | |
A simple chat between a server and a remote client running in a browser | |
Minibrowser example demonstrates how to use the Qt WebView module with Qt Quick | |
Example of how to create a RESTful API server using the QHttpServer | |
Injecting custom stylsheets into web pages and providing a rich text preview tool for a custom markup language | |
Simple example of how to set up an HTTP server | |
Demonstrates how to load and manipulate web content | |
A cookie browser based on Qt WebEngine Widgets | |
Freezes and discards background tabs to reduce CPU and memory usage | |
Demonstrates how to pass HTML5 web notifications to users | |
Demonstrates how to subscribe to and unsubscribe from push notifications | |
A web browser implemented using the WebEngineView QML type | |
A simple client certificate authentication scenario using Qt WebEngine and QSslServer | |
Converts web pages to PDF documents using Qt WebEngine | |
Demonstrates how to handle geolocation requests | |
Demonstrates how to print web pages using Qt WebEngine Widgets | |
A simple browser based on Qt WebEngine Widgets | |
Integrates a spellchecker into a simple HTML form | |
Displays full screen video using QWebEngineView |
要查看和运行由 Qt 工程提供的范例,拜访 社区范例 页面。
所有 Qt 范例 列出了按其所属 Qt 模块分类的所有范例。