Qt Core 示例

要了解如何使用Qt Core 模块的功能,请参阅示例:

Bindable Properties

演示如何使用绑定属性简化 C++ 代码。

Calendar Backend Plugin Example

QCalendar 示例说明用户提供的自定义日历。

Contiguous Cache Example

连续缓存示例展示了如何使用 QContiguousCache 管理超大模型的内存使用。在某些环境中,内存是有限的,即使不是这样,用户仍然不喜欢应用程序使用过多的内存。使用 QContiguousCache 来管理列表,而不是将整个列表加载到内存中,这样无论访问的数据集有多大,应用程序都能限制内存的使用量。

IPC: Shared Memory

演示如何使用共享内存 IPC 机制在不同进程间共享图像数据。

Local Fortune Client

演示如何使用 QLocalSocket 创建简单的本地服务客户端。

Local Fortune Server

演示如何使用 QLocalServer 和 QLocalSocket 为简单的本地服务提供服务。

MIME Type Browser

展示 MIME 类型的层次结构,并可用于确定文件的 MIME 类型。

Mandelbrot

Mandelbrot 示例演示了如何使用 Qt 进行多线程编程。它展示了如何使用工作线程执行繁重的计算,而不会阻塞主线程的事件循环。

Parsing and displaying CBOR data

演示如何解析 CBOR 格式的文件。

Producer and Consumer using Semaphores

使用 Semaphores 的生产者和消费者示例展示了如何使用 QSemaphore 来控制对生产者线程和消费者线程共享的循环缓冲区的访问。

Producer and Consumer using Wait Conditions

使用等待条件的生产者和消费者示例展示了如何使用 QWaitCondition 和 QMutex 来控制对生产者线程和消费者线程共享的循环缓冲区的访问。

QXmlStream Bookmarks Example

演示如何读写 XBEL 文件。

Qt for Android Notifier

演示如何在 Android 应用程序中从 Qt 调用 Java 代码。

Queued Custom Type

队列自定义类型示例展示了如何使用队列信号和插槽在线程间发送自定义类型。

Saving and Loading a Game

如何使用 Qt 的 JSON 或 CBOR 类保存和加载游戏。

Serialization Converter

如何在不同序列化格式之间进行转换。

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.