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

曼德尔布罗特示例演示了使用 Qt 进行多线程编程。它展示了如何使用工作线程执行繁重的计算,同时不阻塞主线程的事件循环。

Parsing and displaying CBOR data

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

Producer and Consumer using 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.