Qt Core

The Qt Core module adds these features to C++:

  • 用于无缝对象通信,非常强大的机制称为信号/槽
  • 可查询且可设计的对象特性
  • hierarchical and queryable object trees that organize object ownership in a natural way with guarded pointers ( QPointer )
  • 动态铸就工作跨库边界

以下页面提供了关于 Qt 核心特征的更多信息:

使用模块

Using a Qt module's C++ API requires linking against the module library, either directly or through other dependencies. Several build tools have dedicated support for this, including CMake and qmake .

构建采用 CMake

使用 find_package() command to locate the needed module component in the Qt6 包:

find_package(Qt6 REQUIRED COMPONENTS Core)
target_link_libraries(mytarget PRIVATE Qt6::Core)
					

更多细节,见 构建采用 CMake 概述。

采用 qmake 构建

若使用 qmake to build your projects, Qt Core is linked by default.

线程和并发编程

Qt 提供线程支持独立于平台形式 线程类 ,跨线程张贴事件和信号/槽连接的 Thread-Safety (线程安全) 方式。多线程编程也是履行耗时操作且不冻结应用程序用户界面的有用范式。

The Qt 中的线程支持 页面包含在应用程序中实现线程的有关信息。额外并发类的提供由 Qt Concurrent 模块。

输入/输出、资源及容器

Qt 提供组织应用程序文件和资产的资源系统、一组容器及接收输入 打印输出的类。

此外,Qt Core 提供在应用程序的可执行文件中存储二进制文件且独立于平台的机制。

附加框架

Qt Core 还提供了一些 Qt 关键框架。

参考

Module Evolution

Qt Core 的变化 lists important changes in the module API and functionality that were made for the Qt 6 series of Qt.

许可和归属

Qt Core 在商业许可下是可用的来自 Qt 公司 . In addition, it is available under free software licenses: The GNU LGPL (次一般公共许可) 第 3 版 ,或 GNU GPL (一般公共许可) 第 2 版 。见 Qt 许可 进一步了解细节。

Windows 可执行文件潜在链接到 The QtEntryPoint Library 。此库可用于商业许可及 BSD 3 条款新 (或修订) 许可 .

Furthermore, Qt Core in Qt 6.5.1 may contain third party modules under the following permissive licenses:

BLAKE2 (reference implementation), version 54f4faa4c16ea34bcd59d16e8da46a64b259fc07 Creative Commons Zero v1.0 Universal or Apache License 2.0
Data Compression Library (zlib), version 1.2.13 zlib 许可
Robert Penner 缓和方程 BSD 3 条款新 (或修订) 许可
Efficient Binary-Decimal and Decimal-Binary Conversion Routines for IEEE Doubles, version 3.2.1 BSD 3 条款新 (或修订) 许可
KWin, version 5.13.4 BSD 3 条款
MD4 公共领域
MD5 公共领域
PCRE2 - Stack-less Just-In-Time Compiler, version 10.42 BSD 2 条款简化许可
PCRE2, version 10.42 具有 PCRE2 像二进制包例外的 BSD 3 条款 New (或 Revised) 许可
QEventDispatcher 在 macOS BSD 3 条款新 (或修订) 许可
安全哈希算法 SHA-1 公共领域
安全哈希算法 SHA-3 - Keccak,第 3.2 版 创意公共零,第 1.0 通用版
安全哈希算法 SHA-3 - brg_endian,版本 https://github.com/BrianGladman/sha/ 提交 4b9e13ead2c5b5e41ca27c65de4dd69ae0bac228 BSD 2 条款简化许可
安全哈希算法 SHA-384 和 SHA-512 BSD 3 条款新 (或修订) 许可
SipHash Algorithm 创意公共零,第 1.0 通用版
TinyCBOR, version 0.6.0 MIT 许可
Unicode Character Database (UCD), version 30 Unicode 许可协议 - 数据文件和软件 (2016)
Unicode Common Locale Data Repository (CLDR), version v42 Unicode 许可协议 - 数据文件和软件 (2016)
extra-cmake-modules, version 5.84.0 BSD 3 条款
forkfd MIT 许可