New Classes and Functions in Qt 6.2

This page contains a comprehensive list of all new classes and functions introduced in Qt 6.2. Links to new APIs in previous Qt 6 releases are found at the bottom of this page.

New Namespaces

(preliminary) namespace QtAndroidPrivate

New Classes

New Member Functions

Class QBluetoothDeviceDiscoveryAgent:

void errorOccurred(QBluetoothDeviceDiscoveryAgent::Error error)

Class QBluetoothDeviceInfo:

void setName(const QString &name)

Class QBluetoothLocalDevice:

void errorOccurred(QBluetoothLocalDevice::Error error)

Class QBluetoothServer:

void errorOccurred(QBluetoothServer::Error error)

Class QBluetoothServiceDiscoveryAgent:

void errorOccurred(QBluetoothServiceDiscoveryAgent::Error error)

Class QBluetoothSocket:

void errorOccurred(QBluetoothSocket::SocketError error)

Class QLowEnergyCharacteristic:

QLowEnergyDescriptor clientCharacteristicConfiguration() const

Class QLowEnergyService:

void errorOccurred(QLowEnergyService::ServiceError newError)

Class QLowEnergyController:

QLowEnergyController *createPeripheral(const QBluetoothAddress &localDevice, QObject *parent)
void errorOccurred(QLowEnergyController::Error newError)
int mtu() const

Class QAbstractAxis:

void labelsTruncatedChanged(bool labelsTruncated)
void truncateLabelsChanged(bool truncateLabels)

Class QBarSet:

void deselectAllBars()
void deselectBar(int index)
void deselectBars(const QList<int> &indexes)
bool isBarSelected(int index) const
void selectAllBars()
void selectBar(int index)
void selectBars(const QList<int> &indexes)
QList<int> selectedBars() const
QColor selectedColor() const
void setBarSelected(int index, bool selected)
void setSelectedColor(const QColor &color)
void toggleSelection(const QList<int> &indexes)

Class QLegend:

void attachedToChartChanged(bool attached)
bool isInteractive() const
void setInteractive(bool interactive)

Class QXYSeries:

QPair<qreal, qreal> bestFitLineEquation(bool &ok) const
void clearPointConfiguration(const int index)
void clearPointConfiguration(const int index, const QXYSeries::PointConfiguration key)
void clearPointsConfiguration()
void clearPointsConfiguration(const QXYSeries::PointConfiguration key)
void colorBy(const QList<qreal> &sourceData, const QLinearGradient &gradient)
void deselectAllPoints()
void deselectPoint(int index)
void deselectPoints(const QList<int> &indexes)
bool isPointSelected(int index)
const QImage &lightMarker() const
void lightMarkerChanged(const QImage &lightMarker)
qreal markerSize() const
QHash<QXYSeries::PointConfiguration, QVariant> pointConfiguration(const int index) const
QHash<int, QHash<QXYSeries::PointConfiguration, QVariant>> pointsConfiguration() const
void selectAllPoints()
void selectPoint(int index)
void selectPoints(const QList<int> &indexes)
const QImage &selectedLightMarker() const
QList<int> selectedPoints() const
void setLightMarker(const QImage &lightMarker)
void setMarkerSize(qreal size)
void setPointConfiguration(const int index, const QHash<QXYSeries::PointConfiguration, QVariant> &configuration)
void setPointConfiguration(const int index, const QXYSeries::PointConfiguration key, const QVariant &value)
void setPointSelected(int index, bool selected)
void setPointsConfiguration(const QHash<int, QHash<QXYSeries::PointConfiguration, QVariant>> &pointsConfiguration)
void setSelectedLightMarker(const QImage &selectedLightMarker)
void sizeBy(const QList<qreal> &sourceData, const qreal minSize, const qreal maxSize)
void toggleSelection(const QList<int> &indexes)

Class QAbstractProxyModel:

QModelIndex createSourceIndex(int row, int col, void *internalPtr) const

Class QByteArray:

qsizetype lastIndexOf(QByteArrayView bv) const

Class QByteArrayView:

int compare(QByteArrayView bv, Qt::CaseSensitivity cs) const
qsizetype lastIndexOf(QByteArrayView bv) const

Class QFileInfo:

std::filesystem::path filesystemJunctionTarget() const
QString junctionTarget() const

Class QFlags:

QFlags<T> fromInt(QFlags::Int i)
QFlags<T> operator&(QFlags<T> other) const
QFlags<T> &operator&=(QFlags<T> mask)
size_t qHash(QFlags<Enum> flags, size_t seed)
bool testAnyFlag(Enum flag) const
bool testAnyFlags(QFlags<T> flags) const
bool testFlags(QFlags<T> flags) const
QFlags::Int toInt() const

Class QJniEnvironment:

jfieldID findField(jclass clazz, const char *fieldName, const char *signature)
jmethodID findMethod(jclass clazz, const char *methodName, const char *signature)
jfieldID findStaticField(jclass clazz, const char *fieldName, const char *signature)
jmethodID findStaticMethod(jclass clazz, const char *methodName, const char *signature)
bool isValid() const

Class QJniObject:

QByteArray className() const
jclass objectClass() const

Class QLatin1String:

qsizetype lastIndexOf(QStringView str, Qt::CaseSensitivity cs) const
qsizetype lastIndexOf(QLatin1String l1, Qt::CaseSensitivity cs) const

Class QLockFile:

void setStaleLockTime(std::chrono::milliseconds value)
std::chrono::milliseconds staleLockTimeAsDuration() const
bool tryLock(std::chrono::milliseconds timeout)

Class QLocale:

QLocale::Territory codeToTerritory(QStringView territoryCode)
QString nativeTerritoryName() const
QLocale::Territory territory() const
QString territoryToCode(QLocale::Territory territory)
QString territoryToString(QLocale::Territory territory)

Class QMetaObject:

QMetaType metaType() const

Class QMetaMethod:

bool isConst() const

Class QAndroidApplication:

int context()
void hideSplashScreen(int duration)
bool isActivityContext()
QFuture<QVariant> runOnAndroidMainThread(const std::function<QVariant ()> &runnable, const QDeadlineTimer timeout)
int sdkVersion()

Class QString:

qsizetype lastIndexOf(QLatin1String str, Qt::CaseSensitivity cs) const
qsizetype lastIndexOf(const QString &str, Qt::CaseSensitivity cs) const
qsizetype lastIndexOf(QStringView str, Qt::CaseSensitivity cs) const
qsizetype lastIndexOf(const QRegularExpression &re, QRegularExpressionMatch *rmatch) const

Class QStringView:

qsizetype lastIndexOf(QStringView str, Qt::CaseSensitivity cs) const
qsizetype lastIndexOf(QLatin1String l1, Qt::CaseSensitivity cs) const
qsizetype lastIndexOf(const QRegularExpression &re, QRegularExpressionMatch *rmatch) const

Class QTimeZone:

QLocale::Territory territory() const

Class QUntypedBindable:

QMetaType metaType() const

Class QColorSpace:

QString description() const
void setDescription(const QString &description)

Class QImage:

QSizeF deviceIndependentSize() const
QImage fromData(QByteArrayView data, const char *format)
bool loadFromData(QByteArrayView data, const char *format)

Class QNativeGestureEvent:

QPointF delta() const
int fingerCount() const

Class QPixmap:

QSizeF deviceIndependentSize() const

Class QAbstractSocket:

bool bind(QHostAddress::SpecialAddress addr, quint16 port, QAbstractSocket::BindMode mode)

Class QNetworkAddressEntry:

QDebug operator<<(QDebug debug, const QNetworkAddressEntry &entry)

Class QNetworkRequest:


Class QNdefMessage:

QNdefMessage &operator=(const QNdefMessage &other)
QNdefMessage &operator=(QNdefMessage &&other)

Class QNdefFilter:

bool match(const QNdefMessage &message) const

Class QNdefRecord:

void clear()

Class QNearFieldManager:

bool isEnabled() const
void setUserInformation(const QString &message)
void targetDetectionStopped()

Class QGeoAddress:

QGeoAddress &operator=(QGeoAddress &other)
void setStreetNumber(const QString &streetNumber)
QString streetNumber() const

Class QGeoAreaMonitorInfo:

QGeoAreaMonitorInfo &operator=(QGeoAreaMonitorInfo &&other)

Class QGeoAreaMonitorSource:

virtual QVariant backendProperty(const QString &name) const
virtual bool setBackendProperty(const QString &name, const QVariant &value)

Class QGeoCoordinate:

QGeoCoordinate &operator=(QGeoCoordinate &&other)

Class QGeoLocation:

QGeoShape boundingShape() const
QGeoLocation &operator=(QGeoLocation &&other)
void setBoundingShape(const QGeoShape &boundingShape)

Class QGeoPositionInfo:

QGeoPositionInfo &operator=(QGeoPositionInfo &&other)

Class QGeoSatelliteInfo:

QGeoSatelliteInfo &operator=(QGeoSatelliteInfo &&other)

Class QGeoSatelliteInfoSource:

virtual QVariant backendProperty(const QString &name) const
virtual bool setBackendProperty(const QString &name, const QVariant &value)

Class QJSEngine:

QJSValue newSymbol(const QString &name)

Class QQmlContext:

QObject *objectForName(const QString &name) const

Class QQmlListReference:

qsizetype size() const

Class QQuickItemGrabResult:

bool saveToFile(const QUrl &filePath) const

Class QQuickRenderTarget:

QQuickRenderTarget fromOpenGLRenderBuffer(uint renderbufferId, const QSize &pixelSize, int sampleCount)

Class QCanBusDevice:

virtual QCanBusDeviceInfo deviceInfo() const

Class QCanBusDeviceInfo:

QString plugin() const

Class QModbusRtuSerialServer:

int interFrameDelay() const
void setInterFrameDelay(int microseconds)

Class QSqlQuery:

QSqlQuery &operator=(QSqlQuery &&other)
void swap(QSqlQuery &other)

Class QSqlQueryModel:

void setQuery(QSqlQuery &&query)

Class QWaylandBufferRef:

bool hasProtectedContent() const

Class QWebEnginePage:

void loadingChanged(const QWebEngineLoadingInfo &loadingInfo)
void navigationRequested(QWebEngineNavigationRequest &request)
void newWindowRequested(QWebEngineNewWindowRequest &request)

Class QWebEngineProfile:

void requestIconForIconURL(const QUrl &url, int desiredSizeInPixel, std::function<void (const QIcon &, const QUrl &)> iconAvailableCallback) const
void requestIconForPageURL(const QUrl &url, int desiredSizeInPixel, std::function<void (const QIcon &, const QUrl &, const QUrl &)> iconAvailableCallback) const

Class QWebEngineView:

QWebEngineView *forPage(const QWebEnginePage *page)
QWebEngineContextMenuRequest *lastContextMenuRequest() const
void pdfPrintingFinished(const QString &filePath, bool success)
void print(QPrinter *printer)
void printFinished(bool success)
void printRequested()
void printToPdf(const QString &filePath, const QPageLayout &layout, const QPageRanges &ranges)
void printToPdf(const std::function<void (const QByteArray &)> &resultCallback, const QPageLayout &layout, const QPageRanges &ranges)

Class QWebSocket:

void alertReceived(QSsl::AlertLevel level, QSsl::AlertType type, const QString &description)
void alertSent(QSsl::AlertLevel level, QSsl::AlertType type, const QString &description)
void continueInterruptedHandshake()
void handshakeInterruptedOnError(const QSslError &error)
void peerVerifyError(const QSslError &error)

Class QWebSocketServer:

void alertReceived(QSsl::AlertLevel level, QSsl::AlertType type, const QString &description)
void alertSent(QSsl::AlertLevel level, QSsl::AlertType type, const QString &description)
void handshakeInterruptedOnError(const QSslError &error)

Class QGraphicsSceneEvent:

quint64 timestamp() const

Class QGraphicsSceneWheelEvent:

bool isInverted() const
Qt::ScrollPhase phase() const
QPoint pixelDelta() const

New Functions in Namespaces

void beginPropertyUpdateGroup()
bool bindService(const QAndroidIntent &serviceIntent, const QAndroidServiceConnection &serviceConnection, QtAndroidPrivate::BindFlags flags)
(preliminary) QFuture<QtAndroidPrivate::PermissionResult> checkPermission(const QString &permission)
(preliminary) QFuture<QtAndroidPrivate::PermissionResult> checkPermission(QtAndroidPrivate::PermissionType permission)
void endPropertyUpdateGroup()
QByteArray operator""_qba(const char *str, size_t size)
QString operator""_qs(const char16_t *str, size_t size)
(preliminary) QFuture<QtAndroidPrivate::PermissionResult> requestPermission(const QString &permission)
(preliminary) QFuture<QtAndroidPrivate::PermissionResult> requestPermission(QtAndroidPrivate::PermissionType permission)
void startActivity(const QJniObject &intent, int receiverRequestCode, std::function<void (int, int, const QJniObject &)> callbackFunc)
void startActivity(const QAndroidIntent &intent, int receiverRequestCode, QAndroidActivityResultReceiver *resultReceiver)
void startActivity(const QJniObject &intent, int receiverRequestCode, QAndroidActivityResultReceiver *resultReceiver)
void startIntentSender(const QJniObject &intentSender, int receiverRequestCode, QAndroidActivityResultReceiver *resultReceiver)

New Global Functions

std::underlying_type_t<Enum> qToUnderlying(Enum e)
const char *qWebEngineChromiumVersion()
const char *qWebEngineVersion()

New Macros

New Enum Types

enum RubberBand { NoRubberBand, VerticalRubberBand, HorizontalRubberBand, RectangleRubberBand, ClickThroughRubberBand }
enum SocketOption { NoOptions, AbstractNamespaceOption }
enum DiscoveryMode { FullDiscovery, SkipValueDiscovery }
enum EditFlag { CanUndo, CanRedo, CanCut, CanCopy, CanPaste, …, CanEditRichly }
enum MediaFlag { MediaInError, MediaPaused, MediaMuted, MediaLoop, MediaCanSave, …, MediaCanRotate }
enum MediaType { MediaTypeNone, MediaTypeImage, MediaTypeVideo, MediaTypeAudio, MediaTypeCanvas, …, MediaTypePlugin }
enum class BindFlag { None, AutoCreate, DebugUnbind, NotForeground, AboveClient, …, ExternalService }

New Properties

New Variables

New QML Types

New QML Properties

QML Type ColorGroup:

placeholderText : color

QML Type Image:


QML Type SystemPalette:

placeholderText : color

QML Type TableView:

selectionModel : ItemSelectionModel

QML Type Texture:


New QML Methods

QML Type Locale:

string formattedDataSize(int bytes, int precision, DataSizeFormat format)

QML Type TableView:

real columnWidth(int column)
real implicitColumnWidth(int column)
real implicitRowHeight(int row)
bool isColumnLoaded(int column)
bool isRowLoaded(int row)
real rowHeight(int row)

QML Type View3D:

List<PickResult> pickAll(float x, float y)
PickResult rayPick(vector3d origin, vector3d direction)
List<PickResult> rayPickAll(vector3d origin, vector3d direction)

Additions to Other Qt 6 Releases

© 2024 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.