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 許可