New Classes and Functions in Qt 5.10

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

New Classes

New Member Functions

Class QTextCodec:

bool canEncode(QStringView s) const
QByteArray fromUnicode(QStringView str) const

Class QTextEncoder:

QByteArray fromUnicode(QStringView str)

Class QAbstractFileEngine:

virtual bool cloneTo(QAbstractFileEngine *target)
virtual bool setFileTime(const QDateTime &newDate, FileTime time)

Class QDebug:

QDebug &operator<<(QStringView s)

Class QFileDevice:

QDateTime fileTime(QFileDevice::FileTime time) const
bool setFileTime(const QDateTime &newDate, QFileDevice::FileTime fileTime)

Class QFileInfo:

QDateTime birthTime() const
QDateTime fileTime(QFile::FileTime time) const
QDateTime metadataChangeTime() const

Class QIODevice:

qint64 skip(qint64 maxSize)

Class QProcess:

bool startDetached(qint64 *pid = nullptr)

Class QSettings:

bool isAtomicSyncRequired() const
void setAtomicSyncRequired(bool enable)

Class QJsonObject:

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

Class QJsonDocument:

QJsonDocument &operator=(QJsonDocument &&other)
const QJsonValue operator[](const QString &key) const
const QJsonValue operator[](QLatin1String key) const
const QJsonValue operator[](int i) const
void swap(QJsonDocument &other)

Class QJsonArray:

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

Class QJsonValue:

QJsonValue &operator=(QJsonValue &&other)
const QJsonValue operator[](const QString &key) const
const QJsonValue operator[](QLatin1String key) const
const QJsonValue operator[](int i) const
void swap(QJsonValue &other)

Class QMetaObject:

bool invokeMethod(QObject *receiver, PointerToMemberFunction function, Qt::ConnectionType type = Qt::AutoConnection, MemberFunctionReturnType *ret = nullptr)
bool invokeMethod(QObject *receiver, PointerToMemberFunction function, MemberFunctionReturnType *ret)
bool invokeMethod(QObject *context, Functor function, Qt::ConnectionType type = Qt::AutoConnection, FunctorReturnType *ret = nullptr)
bool invokeMethod(QObject *context, Functor function, FunctorReturnType *ret)

Class QUuid:

QUuid fromString(QStringView text)
QUuid fromString(QLatin1String text)

Class QByteArray:

char back() const
QByteRef back()
QByteArray chopped(int len) const
char front() const
QByteRef front()
void shrink_to_fit()

Class QHash:

const_key_value_iterator constKeyValueBegin() const
const_key_value_iterator constKeyValueEnd() const
key_value_iterator keyValueBegin()
const_key_value_iterator keyValueBegin() const
key_value_iterator keyValueEnd()
const_key_value_iterator keyValueEnd() const

Class QLocale:

QString formattedDataSize(qint64 bytes, int precision = 2, DataSizeFormats format = DataSizeIecFormat)
double toDouble(QStringView s, bool *ok = nullptr) const
float toFloat(QStringView s, bool *ok = nullptr) const
int toInt(QStringView s, bool *ok = nullptr) const
qlonglong toLongLong(QStringView s, bool *ok = nullptr) const
short toShort(QStringView s, bool *ok = nullptr) const
QString toString(const QDate &date, QStringView format) const
QString toString(const QTime &time, QStringView format) const
QString toString(const QDateTime &dateTime, QStringView format) const
uint toUInt(QStringView s, bool *ok = nullptr) const
qulonglong toULongLong(QStringView s, bool *ok = nullptr) const
ushort toUShort(QStringView s, bool *ok = nullptr) const

Class QMap:

const_key_value_iterator constKeyValueBegin() const
const_key_value_iterator constKeyValueEnd() const
key_value_iterator keyValueBegin()
const_key_value_iterator keyValueBegin() const
key_value_iterator keyValueEnd()
const_key_value_iterator keyValueEnd() const

Class QRegularExpressionMatch:

QString captured(QStringView name) const
int capturedEnd(QStringView name) const
int capturedLength(QStringView name) const
QStringRef capturedRef(QStringView name) const
int capturedStart(QStringView name) const
QStringView capturedView(int nth = 0) const
QStringView capturedView(QStringView name) const

Class QLatin1String:

QLatin1Char back() const
const_iterator begin() const
const_iterator cbegin() const
const_iterator cend() const
void chop(int length)
QLatin1String chopped(int length) const
const_reverse_iterator crbegin() const
const_reverse_iterator crend() const
const_iterator end() const
bool endsWith(QStringView str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
bool endsWith(QLatin1String l1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
bool endsWith(QChar ch) const
bool endsWith(QChar ch, Qt::CaseSensitivity cs) const
QLatin1Char front() const
bool isEmpty() const
bool isNull() const
const_reverse_iterator rbegin() const
const_reverse_iterator rend() const
bool startsWith(QStringView str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
bool startsWith(QLatin1String l1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
bool startsWith(QChar ch) const
bool startsWith(QChar ch, Qt::CaseSensitivity cs) const
QLatin1String trimmed() const
void truncate(int length)

Class QStringList:

bool contains(QLatin1String str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const

Class QString:

QString arg(QStringView a, int fieldWidth = 0, QChar fillChar = QLatin1Char( ' ' )) const
QString arg(QLatin1String a, int fieldWidth = 0, QChar fillChar = QLatin1Char( ' ' )) const
QChar back() const
QCharRef back()
QString chopped(int len) const
bool endsWith(QStringView str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
QChar front() const
QCharRef front()
void shrink_to_fit()
bool startsWith(QStringView str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const

Class QStringRef:

QChar back() const
QStringRef chopped(int len) const
bool endsWith(QStringView str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
QChar front() const
bool startsWith(QStringView str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const

Class QVarLengthArray:

void shrink_to_fit()

Class QVector:

void shrink_to_fit()

Class QVersionNumber:

QVersionNumber fromString(QLatin1String string, int *suffixIndex = nullptr)
QVersionNumber fromString(QStringView string, int *suffixIndex = nullptr)

Class QImage:

qsizetype sizeInBytes() const

Class QGuiApplication:

QScreen *screenAt(const QPoint &point)

Class QNativeGestureEvent:

const QTouchDevice *device() const

Class QPlatformCursor:

virtual void clearOverrideCursor()
virtual void setOverrideCursor(const QCursor &)

Class QPlatformIntegration:

virtual QPlatformVulkanInstance *createPlatformVulkanInstance(QVulkanInstance *instance) const

Class QPlatformSystemTrayIcon:

void contextMenuRequested(QPoint globalPos, const QPlatformScreen *screen)

Class QSurfaceFormat:

ColorSpace colorSpace() const
void setColorSpace(ColorSpace colorSpace)

Class QWindow:

void setWindowStates(Qt::WindowStates state)
Qt::WindowStates windowStates() const

Class QColor:

bool isValidColor(QStringView name)
void setNamedColor(QStringView name)

Class QPdfWriter:

PdfVersion pdfVersion() const
void setPdfVersion(PdfVersion version)

Class QPolygon:

bool intersects(const QPolygon &p) const

Class QPolygonF:

bool intersects(const QPolygonF &p) const

Class QTextOption:

void setTabStopDistance(qreal tabStopDistance)
qreal tabStopDistance() const

Class QNetworkAccessManager:

void enableStrictTransportSecurityStore(bool enabled, const QString &storeDir = QString())
bool isStrictTransportSecurityStoreEnabled() const

Class QHostInfo:

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

Class QLocalServer:

qintptr socketDescriptor() const

Class QPrinter:

PdfVersion pdfVersion() const
void setPdfVersion(PdfVersion version)

Class QSqlError:

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

Class QSqlQueryModel:

virtual QHash<int, QByteArray> roleNames() const override

Class QAbstractItemView:

bool isPersistentEditorOpen(const QModelIndex &index) const

Class QListWidget:

bool isPersistentEditorOpen(QListWidgetItem *item) const

Class QTableWidget:

bool isPersistentEditorOpen(QTableWidgetItem *item) const

Class QTreeWidget:

bool isPersistentEditorOpen(QTreeWidgetItem *item, int column = 0) const

Class QOpenGLWidget:

void setTextureFormat(GLenum texFormat)
GLenum textureFormat() const

Class QLineEdit:

int selectionEnd() const
int selectionLength() const

Class QQmlEngine:

void retranslate()

Class QQuickItem:

bool acceptTouchEvents() const
void setAcceptTouchEvents(bool enabled)
void setSize(const QSizeF &size)
QSizeF size() const

Class QQuickWindow:

void setTextRenderType(TextRenderType renderType)
TextRenderType textRenderType()

Class QGeoPath:

int size() const

Class QGeoPolygon:

int size() const

Class QCanBusFrame:

bool hasLocalEcho() const
void setLocalEcho(bool echo)

Class QWebEngineDownloadItem:

void isPausedChanged(bool isPaused)
void pause()
void resume()

Class QWebEnginePage:

void download(const QUrl &url, const QString &filename = QString())

Class QX11Info:

qint32 generatePeekerId()
bool peekEventQueue(PeekerCallback peeker, void *peekerData = nullptr, PeekOptions option = PeekDefault, qint32 peekerId = -1)
bool removePeekerId(qint32 peekerId)

New Functions in Namespaces

bool bindService(const QAndroidIntent &serviceIntent, const QAndroidServiceConnection &serviceConnection, BindFlags flags = BindFlag::None)
PermissionResult checkPermission(const QString &permission)
void hideSplashScreen(int duration)
void keySequence(QWidget *widget, const QKeySequence &keySequence)
void keySequence(QWindow *window, const QKeySequence &keySequence)
bool qWaitFor(Functor predicate, int timeout = 5000)
void requestPermissions(const QStringList &permissions, const PermissionResultCallback &callbackFunc)
PermissionResultMap requestPermissionsSync(const QStringList &permissions, int timeoutMs = INT_MAX)
bool shouldShowRequestPermissionRationale(const QString &permission)

New Global Functions

bool operator!=(const QVulkanExtension &lhs, const QVulkanExtension &rhs)
bool operator!=(const QVulkanLayer &lhs, const QVulkanLayer &rhs)
bool operator!=(const QCursor &lhs, const QCursor &rhs)
bool operator==(const QVulkanExtension &lhs, const QVulkanExtension &rhs)
bool operator==(const QVulkanLayer &lhs, const QVulkanLayer &rhs)
bool operator==(const QCursor &lhs, const QCursor &rhs)
QString qEnvironmentVariable(const char *varName, const QString &defaultValue = QString())
uint qHash(const QVulkanExtension &key, uint seed = 0)
uint qHash(const QVulkanLayer &key, uint seed = 0)
uint qHash(QStringView key, uint seed = 0)

New Enum Types

enum FileTime { FileAccessTime, FileBirthTime, FileMetadataChangeTime, FileModificationTime }
enum DataSizeFormat { DataSizeIecFormat, DataSizeTraditionalFormat, DataSizeSIFormat }
enum PdfVersion { PdfVersion_1_4, PdfVersion_A1b }
enum Capability { OverrideCursor }
enum TextRenderType { QtTextRendering, NativeTextRendering }
enum Flag { NoDebugOutputRedirect }
enum PeekOption { PeekDefault, PeekFromCachedIndex }
enum BindFlag { None, AutoCreate, DebugUnbind, NotForeground, ..., ExternalService }
enum PermissionResult { Granted, Denied }

New Typedefs

typedef key_value_iterator
typedef key_value_iterator
typedef PeekerCallback
typedef qint16_be
typedef qint16_le
typedef qint32_be
typedef qint32_le
typedef qint64_be
typedef qint64_le
typedef quint16_be
typedef quint16_le
typedef quint32_be
typedef quint32_le
typedef quint64_be
typedef quint64_le

New Properties

New QML Types

New QML Properties

New QML Methods

void addMapItemView(MapItemView itemView)
void alignCoordinateToPoint(coordinate coordinate, QPointF point)
void removeMapItemView(MapItemView itemView)
void setBearing(real bearing, coordinate coordinate)
int setPath(geopath path)
geopolygon polygon(list<coordinate> coordinates) const
geopolygon polygon() const
geopath shapeToPolygon(geoshape shape) const
keySequence(keySequence)

Additions to Other Qt 5 Releases

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