Qt 5.15 的新功能

Qt 5.15 中的新特徵

Qt 3D 模塊

  • 改進剖分析和故障診斷支持。
  • QSortPolicy:引入統一模式以控製是否需要統一縮小率。
  • QMouseDevice: 引入 updateAxesContinuously 特性。
  • 孤立 OpenGL 渲染器作為插件。

Qt Core 模塊

  • 引入 QFile::moveToTrash () 以提供跨平颱 API,用於把文件移至 Windows、macOS 及 Linux 桌麵的 trash/recycling (垃圾桶/迴收站) bin。這實現 freedesktop.org specification .
  • 引入 QFileInfo::isJunction () 去檢測文件係統條目是否為 Windows NTFS 結。
  • QRunnable instances can now be created from std::function without having to subclass QRunnable .
  • QThreadPool::start () 和 tryStart () can now take std::function and thereby also anonymous lambda functions as arguments.
  • Added static template QDebug::toString() function, which streams the given object into a QDebug instance that operates on a string, and then returns that string. This is useful for cases where you need the textual representation of an object for debugging, but cannot use operator<< , such as when passing a failure message to QVERIFY2 ().

Qt GUI 模塊

Qt Multimedia 模塊

Qt Network 模塊

  • OpenSSL 後端:添加對 TLS 1.3 協議引入的新會話票證機製的支持。
  • 實現超時為下載和上傳采用 QNetworkRequest and QNetworkAccessManager .
  • 把 OpenSSL 版本最小支持增加到 1.1。

Qt QML 模塊

  • 引入內聯組件;可以在同一文件中聲明多個 QML 組件。
  • 引入所需特性。
  • 添加嚮 QML 注冊類型的聲明方式。
  • qmllint now has a better understanding of the code and warns about deprecated QML features.
  • 添加 qmlformat tool to automatically format any QML file according to the QML 編碼約定 .
  • 添加支持 Nullish Coalescing Operator .
  • 添加 colorspace property on image nodes, making it possible to read color spaces and transform images into a specific color space.

Qt Quick 模塊

  • 添加 PathText type which can be used together with Qt Quick Shapes to render text as geometry, without relying on distance fields or pre-rendered textures. This is useful for rendering large font sizes which would otherwise consume a lot of texture memory.
  • 添加 Image.sourceClipRect property to request the image plugin to render a portion of an image source.
  • 添加 cursorShape property to pointer handlers. Most pointer handlers (for example DragHandler ) will change the cursor when in active state. HoverHandler will change the cursor when the mouse is hovering over the Item that contains the handler.
  • Added support for Metal on iOS for the opt-in preview of the Graphics API Independent Rendering Architecture .

Qt Quick Controls 模塊

Qt WebEngine 模塊

  • 更新至 Chromium 80。
  • 切換到使用沙盒網絡服務。
  • 引入新 API,為讀取頁麵 (或視圖) 的子進程 ID。
  • 引入 WebEngineHistory.clear () 方法。

工具

  • QDoc can now generate DocBook.
  • QDoc now generates output for C++ class and function template parameters.
  • QDoc now generates correct output for scoped enums (enum classes).

平颱的變化

Android

  • 引入默認使用 Android 本機文件對話框用於打開 (文件、多個文件、目錄) 和保存操作。

Wayland

  • 在客戶端側引入實驗性 Vulkan 支持。

Embedded Linux (eglfs)

  • eglfs_viv backend: Added support for Vulkan, via VK_KHR_display, on NXP i.MX8 based devices.

新模塊

Qt Quick 3D

  • 引入後期處理效果。
  • 引入自定義幾何圖形 API (C++ 網格)。
  • 引入用於節點鏇轉的四元數 API。
  • 切換到使用右手坐標係統 (以前是右或左)。
  • 改進在 3D 場景中對 Qt Quick 2D 的支持。
  • 添加支持聚光燈。
  • 性能改進。

Qt Lottie

  • 引入 Bodymovin JSON 渲染器為 Adobe After Effects 動畫。
  • 改進性能和穩定性。

Qt PDF

  • Based on a version of Pdfium that is shared with Qt WebEngine .
  • Available on the same platforms as Qt WebEngine , and also on iOS.

棄用模塊

To help preparing for the transition to Qt 6, numerous classes and member functions that will be removed from Qt 6.0 have been marked as deprecated in the Qt 5.15 release. Unless you define QT_NO_DEPRECATED_WARNINGS in your project, you will get compiler warnings for code that uses any deprecated APIs. Those warnings will explain which API to use instead. To disable any deprecated APIs completely, use the QT_DISABLE_DEPRECATED_BEFORE 宏。

下列模塊是 Qt 5.15 發行的一部分,但被棄用且在後續 Qt 發行中考慮移除:

  • Qt Script
  • Qt Quick Controls 1
  • Qt XML Patterns

API 變化列錶

以下頁麵包含 Qt 5.15 中的 API 變化列錶:

其它 Qt 5 發行的補充