New Features in Qt 6.0: Difference between revisions
(→Within QtCore: QLocale's improvements) |
(Porting guide section added) |
||
Line 1: | Line 1: | ||
[[Category:Release]] | [[Category:Release]] | ||
[[Category:Developing Qt::Qt6]] | [[Category:Developing Qt::Qt6]] | ||
== New Features (within existing modules) == | |||
== Porting guide == | |||
When creating Qt 6 our aim has been to keep as much compatibility with Qt 5 as possible, but some changes were inevitable in an effort to make Qt a better framework. To make it easier to port to Qt 6.0 we have created a [https://doc-snapshots.qt.io/qt6-dev/portingguide.html Porting guide] where we try to summarize those changes and provide guidance to handle them. In the [https://doc-snapshots.qt.io/qt6-dev/portingguide.html g guide] you can find links to articles about changes that may affect your application, and which can help you transitioning from Qt 5 to Qt 6. | |||
==New Features (within existing modules)== | |||
There's been lots of clean-up all round and many deprecated methods have been removed. | There's been lots of clean-up all round and many deprecated methods have been removed. | ||
Line 9: | Line 13: | ||
and [https://doc-snapshots.qt.io/qt6-dev/whatsnew60.html#new-classes-and-functions New Classes and Functions]. | and [https://doc-snapshots.qt.io/qt6-dev/whatsnew60.html#new-classes-and-functions New Classes and Functions]. | ||
=== Within QtCore === | ===Within QtCore=== | ||
* [https://doc-snapshots.qt.io/qt6-dev/qbytearrayview.html QByteArrayView] now provides a light-weight way to view the content of a QByteArray or other char-equivalent array data | |||
* [https://doc-snapshots.qt.io/qt6-dev/qpromise.html QPromise] allows setting values, progress and exceptions to QFuture | *[https://doc-snapshots.qt.io/qt6-dev/qbytearrayview.html QByteArrayView] now provides a light-weight way to view the content of a QByteArray or other char-equivalent array data | ||
* [https://doc-snapshots.qt.io/qt6-dev/qfuture.html QFuture] supports attaching continuations | *[https://doc-snapshots.qt.io/qt6-dev/qpromise.html QPromise] allows setting values, progress and exceptions to QFuture | ||
* Signals can now be converted to QFuture objects | *[https://doc-snapshots.qt.io/qt6-dev/qfuture.html QFuture] supports attaching continuations | ||
* QVector and QList are [https://doc-snapshots.qt.io/qt6-dev/qlist.html#details unified]. QList is updated and should be used by default when array-like behaviour is needed | *Signals can now be converted to QFuture objects | ||
* QList, QString and QByteArray now have optimized complexity of insertion at the beginning (a.k.a. prepend) | *QVector and QList are [https://doc-snapshots.qt.io/qt6-dev/qlist.html#details unified]. QList is updated and should be used by default when array-like behaviour is needed | ||
* [https://doc.qt.io/qt-5/qtglobal.html#Q_DECLARE_TYPEINFO Q_DECLARE_TYPEINFO()] mechanism simplified: | *QList, QString and QByteArray now have optimized complexity of insertion at the beginning (a.k.a. prepend) | ||
** Trivially copyable and trivially destructible types are automatically treated as relocatable (Q_RELOCATABLE_TYPE) | *[https://doc.qt.io/qt-5/qtglobal.html#Q_DECLARE_TYPEINFO Q_DECLARE_TYPEINFO()] mechanism simplified: | ||
** Q_MOVABLE_TYPE and Q_RELOCATABLE_TYPE mean the same thing | **Trivially copyable and trivially destructible types are automatically treated as relocatable (Q_RELOCATABLE_TYPE) | ||
**Q_MOVABLE_TYPE and Q_RELOCATABLE_TYPE mean the same thing | |||
*[https://doc-snapshots.qt.io/qt6-dev/containers.html Container classes] now use qsizetype as an underlying type for size and indexing. Additionally, several related classes got updated in a similar fashion (e.g. [https://doc-snapshots.qt.io/qt6-dev/qtextboundaryfinder.html QTextBoundaryFinder] and [https://doc-snapshots.qt.io/qt6-dev/qregularexpression.html QRegularExpression]). This change allows containers to hold more than 2^31 items on 64 bit platforms | *[https://doc-snapshots.qt.io/qt6-dev/containers.html Container classes] now use qsizetype as an underlying type for size and indexing. Additionally, several related classes got updated in a similar fashion (e.g. [https://doc-snapshots.qt.io/qt6-dev/qtextboundaryfinder.html QTextBoundaryFinder] and [https://doc-snapshots.qt.io/qt6-dev/qregularexpression.html QRegularExpression]). This change allows containers to hold more than 2^31 items on 64 bit platforms | ||
* QLocale improvements, principally around number formatting (plus lots of clean-up). | *QLocale improvements, principally around number formatting (plus lots of clean-up). | ||
** A few QChar-returning methods now return QString to cope with locales where the relevant "single character" is represented by a code-point outside Unicode's BMP (Basic Multilingual Plane); that is, they use surrogate pairs in UTF-16, hence two code-units in the encoding Qt uses, rather than only one. | **A few QChar-returning methods now return QString to cope with locales where the relevant "single character" is represented by a code-point outside Unicode's BMP (Basic Multilingual Plane); that is, they use surrogate pairs in UTF-16, hence two code-units in the encoding Qt uses, rather than only one. | ||
** That enables support for number formatting and parsing in locales whose numerals are not in the BMP, making it possible now to include such locales, where CLDR has data for them. | **That enables support for number formatting and parsing in locales whose numerals are not in the BMP, making it possible now to include such locales, where CLDR has data for them. | ||
** Corrections to grouping of digits (a.k.a. placement of "thousands separators", except that …) so that locales which group other than in threes are properly covered, and a leading separator is omitted if there are too few digits before it, as required by some locales (e.g. Spanish). | **Corrections to grouping of digits (a.k.a. placement of "thousands separators", except that …) so that locales which group other than in threes are properly covered, and a leading separator is omitted if there are too few digits before it, as required by some locales (e.g. Spanish). | ||
** Use of accountancy formats for currency quantities, where available, in particular improving support for locale-specific representation of negative currency quantities. | **Use of accountancy formats for currency quantities, where available, in particular improving support for locale-specific representation of negative currency quantities. | ||
== New Modules == | ==New Modules== | ||
;Qt5Compat:Compatibility library providing access to legacy APIs removed in Qt 6. | |||
=== | ==Platform Changes== | ||
=== | ===All=== | ||
*Qt is now built with CMake. | |||
*Qt High DPI scaling is now activated by default; the default rounding policy is PassThrough | |||
=== | ===Linux=== | ||
== Removed Modules == | ===macOS=== | ||
===Windows=== | |||
==Removed Modules== | |||
The following modules are removed and not planned to be developed further. Other modules that are not part of Qt 6.0 are considered for candidates to support with later Qt 6.x releases or as additional libraries on top of the baseline Qt release. | The following modules are removed and not planned to be developed further. Other modules that are not part of Qt 6.0 are considered for candidates to support with later Qt 6.x releases or as additional libraries on top of the baseline Qt release. | ||
* Qt Multimedia Widgets | *Qt Multimedia Widgets | ||
* Qt Graphical Effects | *Qt Graphical Effects | ||
* Qt Purchasing | *Qt Purchasing | ||
* Qt Quick Extras | *Qt Quick Extras | ||
* Qt Quick WebGL | *Qt Quick WebGL | ||
* Qt Script | *Qt Script | ||
* Qt XML Patterns | *Qt XML Patterns | ||
See [[Checklist for Qt 6.0 inclusion]] for the selection process. | See [[Checklist for Qt 6.0 inclusion]] for the selection process. | ||
Line 56: | Line 64: | ||
find new homes in more relevant modules over time, and | find new homes in more relevant modules over time, and | ||
any remaining APIs considered for inclusion in later 6.x releases: | any remaining APIs considered for inclusion in later 6.x releases: | ||
== Additional Modules Available via Package Manager | *Qt Android Extras | ||
*Qt Mac Extras | |||
*Qt X11 Extras | |||
==Additional Modules Available via Package Manager== | |||
The following additional modules are are available via package manager functionality of the Qt online installer: | The following additional modules are are available via package manager functionality of the Qt online installer: | ||
* Qt Image Formats | |||
* Qt 3D | *Qt Image Formats | ||
* Qt Network Authorization | *Qt 3D | ||
*Qt Network Authorization | |||
The package manager provides these additional modules as source packages, which need to be built locally by the user. | The package manager provides these additional modules as source packages, which need to be built locally by the user. |
Revision as of 09:21, 3 November 2020
Porting guide
When creating Qt 6 our aim has been to keep as much compatibility with Qt 5 as possible, but some changes were inevitable in an effort to make Qt a better framework. To make it easier to port to Qt 6.0 we have created a Porting guide where we try to summarize those changes and provide guidance to handle them. In the g guide you can find links to articles about changes that may affect your application, and which can help you transitioning from Qt 5 to Qt 6.
New Features (within existing modules)
There's been lots of clean-up all round and many deprecated methods have been removed. The Qt 6 documentation snapshot pages, automatically generated by QDoc based on the code, include lists of Obsolete Classes and New Classes and Functions.
Within QtCore
- QByteArrayView now provides a light-weight way to view the content of a QByteArray or other char-equivalent array data
- QPromise allows setting values, progress and exceptions to QFuture
- QFuture supports attaching continuations
- Signals can now be converted to QFuture objects
- QVector and QList are unified. QList is updated and should be used by default when array-like behaviour is needed
- QList, QString and QByteArray now have optimized complexity of insertion at the beginning (a.k.a. prepend)
- Q_DECLARE_TYPEINFO() mechanism simplified:
- Trivially copyable and trivially destructible types are automatically treated as relocatable (Q_RELOCATABLE_TYPE)
- Q_MOVABLE_TYPE and Q_RELOCATABLE_TYPE mean the same thing
- Container classes now use qsizetype as an underlying type for size and indexing. Additionally, several related classes got updated in a similar fashion (e.g. QTextBoundaryFinder and QRegularExpression). This change allows containers to hold more than 2^31 items on 64 bit platforms
- QLocale improvements, principally around number formatting (plus lots of clean-up).
- A few QChar-returning methods now return QString to cope with locales where the relevant "single character" is represented by a code-point outside Unicode's BMP (Basic Multilingual Plane); that is, they use surrogate pairs in UTF-16, hence two code-units in the encoding Qt uses, rather than only one.
- That enables support for number formatting and parsing in locales whose numerals are not in the BMP, making it possible now to include such locales, where CLDR has data for them.
- Corrections to grouping of digits (a.k.a. placement of "thousands separators", except that …) so that locales which group other than in threes are properly covered, and a leading separator is omitted if there are too few digits before it, as required by some locales (e.g. Spanish).
- Use of accountancy formats for currency quantities, where available, in particular improving support for locale-specific representation of negative currency quantities.
New Modules
- Qt5Compat
- Compatibility library providing access to legacy APIs removed in Qt 6.
Platform Changes
All
- Qt is now built with CMake.
- Qt High DPI scaling is now activated by default; the default rounding policy is PassThrough
Linux
macOS
Windows
Removed Modules
The following modules are removed and not planned to be developed further. Other modules that are not part of Qt 6.0 are considered for candidates to support with later Qt 6.x releases or as additional libraries on top of the baseline Qt release.
- Qt Multimedia Widgets
- Qt Graphical Effects
- Qt Purchasing
- Qt Quick Extras
- Qt Quick WebGL
- Qt Script
- Qt XML Patterns
See Checklist for Qt 6.0 inclusion for the selection process.
Code from these Qt <platform> Extras modules will find new homes in more relevant modules over time, and any remaining APIs considered for inclusion in later 6.x releases:
- Qt Android Extras
- Qt Mac Extras
- Qt X11 Extras
Additional Modules Available via Package Manager
The following additional modules are are available via package manager functionality of the Qt online installer:
- Qt Image Formats
- Qt 3D
- Qt Network Authorization
The package manager provides these additional modules as source packages, which need to be built locally by the user.