New Classes and Functions in Qt 5.1

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

New Classes

A
QAbstractOpenGLFunctions
QAccelerometer
QAccelerometerFilter
QAccelerometerReading
QAltimeter
QAltimeterFilter
QAltimeterReading
QAmbientLightFilter
QAmbientLightReading
QAmbientLightSensor
QAmbientTemperatureFilter
QAmbientTemperatureReading
QAmbientTemperatureSensor
B
Binder (QOpenGLVertexArrayObject)
C
QCompass
QCompassFilter
QCompassReading
D
QDBusVirtualObject
QDebugStateSaver
G
QGlobalStatic
QGyroscope
QGyroscopeFilter
QGyroscopeReading
H
QHolsterFilter
QHolsterReading
QHolsterSensor
I
QIRProximityFilter
QIRProximityReading
QIRProximitySensor
L
QLightFilter
QLightReading
QLightSensor
QLockFile
M
QMagnetometer
QMagnetometerFilter
QMagnetometerReading
QMessageAuthenticationCode
O
QOffscreenSurface
QOpenGLDebugLogger
QOpenGLDebugMessage
QOpenGLFunctions_1_0
QOpenGLFunctions_1_1
QOpenGLFunctions_1_2
QOpenGLFunctions_1_3
QOpenGLFunctions_1_4
QOpenGLFunctions_1_5
QOpenGLFunctions_2_0
QOpenGLFunctions_2_1
QOpenGLFunctions_3_0
QOpenGLFunctions_3_1
QOpenGLFunctions_3_2_Compatibility
QOpenGLFunctions_3_2_Core
QOpenGLFunctions_3_3_Compatibility
QOpenGLFunctions_3_3_Core
QOpenGLFunctions_4_0_Compatibility
QOpenGLFunctions_4_0_Core
QOpenGLFunctions_4_1_Compatibility
QOpenGLFunctions_4_1_Core
QOpenGLFunctions_4_2_Compatibility
QOpenGLFunctions_4_2_Core
QOpenGLFunctions_4_3_Compatibility
QOpenGLFunctions_4_3_Core
QOpenGLFunctions_ES2
QOpenGLTimeMonitor
QOpenGLTimerQuery
QOpenGLVersionProfile
QOpenGLVertexArrayObject
QOrientationFilter
QOrientationReading
QOrientationSensor
qoutputrange
P
QPressureFilter
QPressureReading
QPressureSensor
QProximityFilter
QProximityReading
QProximitySensor
Q
QQmlApplicationEngine
QQuickTextDocument
R
QRegularExpressionValidator
QRotationFilter
QRotationReading
QRotationSensor
S
QSaveFile
QSensor
QSensorBackend
QSensorChangesInterface
QSensorGesture
QSensorGestureManager
QSensorGesturePluginInterface
QSensorGestureRecognizer
QSensorPluginInterface
QSerialPort
QSerialPortInfo
T
QTapFilter
QTapReading
QTapSensor
QTiltFilter
QTiltReading
QTiltSensor
X
QX11Info

New Member Functions

Class QAbstractFileEngine:

virtual renameOverwrite(const QString &newName)
virtual syncToDisk()

Class QProcess:

setArguments(const QStringList &arguments)
setProgram(const QString &program)
start(QIODevice::OpenMode mode)

Class QMetaMethod:

revision() const

Class QMetaProperty:

revision() const

Class QUrl:

fromStringList(const QStringList &urls, QUrl::ParsingMode mode)
toStringList(const QList<QUrl> &urls, QUrl::FormattingOptions options)

Class QChar:

script(uint ucs4)
script() const

Class QJsonDocument:

toJson(QJsonDocument::JsonFormat format) const

Class QLocale:

toDouble(const QStringRef &s, bool *ok) const
toFloat(const QStringRef &s, bool *ok) const
toInt(const QStringRef &s, bool *ok) const
toLongLong(const QStringRef &s, bool *ok) const
toShort(const QStringRef &s, bool *ok) const
toUInt(const QStringRef &s, bool *ok) const
toULongLong(const QStringRef &s, bool *ok) const
toUShort(const QStringRef &s, bool *ok) const

Class QMap:

insert(QMap::const_iterator pos, const Key &key, const T &value)
insertMulti(QMap::const_iterator pos, const Key &key, const T &value)

Class QMargins:

operator*=(int factor)
operator*=(qreal factor)
operator+=(const QMargins &margins)
operator-=(const QMargins &margins)
operator/=(int divisor)
operator/=(qreal divisor)

Class QMultiMap:

insert(typename QMap<Key, T>::const_iterator pos, const Key &key, const T &value)

Class QPointF:

dotProduct(const QPointF &p1, const QPointF &p2)

Class QPoint:

dotProduct(const QPoint &p1, const QPoint &p2)

Class QRect:

marginsAdded(const QMargins &margins) const
marginsRemoved(const QMargins &margins) const
operator+=(const QMargins &margins)
operator-=(const QMargins &margins)

Class QRegularExpression:


Class QSharedPointer:

create()
create(...)

Class QString:

contains(const QRegularExpression &re, QRegularExpressionMatch *match) const

Class QStringRef:

toDouble(bool *ok) const
toFloat(bool *ok) const
toInt(bool *ok, int base) const
toLong(bool *ok, int base) const
toLongLong(bool *ok, int base) const
toShort(bool *ok, int base) const
toUInt(bool *ok, int base) const
toULong(bool *ok, int base) const
toULongLong(bool *ok, int base) const
toUShort(bool *ok, int base) const
trimmed() const

Class QVarLengthArray:


Class QVector:


Class QIcon:

actualSize(QWindow *window, const QSize &size, QIcon::Mode mode, QIcon::State state) const
pixmap(QWindow *window, const QSize &size, QIcon::Mode mode, QIcon::State state) const

Class QInputMethod:

inputItemRectangle() const
setInputItemRectangle(const QRectF &rect)

Class QKeySequence:

listFromString(const QString &str, QKeySequence::SequenceFormat format)
listToString(const QList<QKeySequence> &list, QKeySequence::SequenceFormat format)

Class QWindow:

alert(int msec)

Class QVector2D:

distanceToLine(const QVector2D &point, const QVector2D &direction) const
distanceToPoint(const QVector2D &point) const

Class QVector3D:

distanceToPoint(const QVector3D &point) const

Class QRawFont:

advancesForGlyphIndexes(const QVector<quint32> &glyphIndexes, QRawFont::LayoutFlags layoutFlags) const
advancesForGlyphIndexes(const quint32 *glyphIndexes, QPointF *advances, int numGlyphs, QRawFont::LayoutFlags layoutFlags) const

Class QPlatformFontDatabase:

writingSystemsFromTrueTypeBits(quint32 [4] unicodeRange, quint32 [2] codePageRange)

Class QPlatformTheme:

virtual createIconEngine(const QString &iconName) const

Class QPlatformWindow:

virtual isAlertState() const
virtual setAlertState(bool enable)

Class QLocalSocket:

connectToServer(QIODevice::OpenMode openMode)
setServerName(const QString &name)

Class QNetworkAccessManager:

encrypted(QNetworkReply *reply)

Class QNetworkReply:


Class QSslConfiguration:

localCertificateChain() const
setLocalCertificateChain(const QList<QSslCertificate> &localChain)

Class QSslSocket:

localCertificateChain() const
setLocalCertificateChain(const QList<QSslCertificate> &localChain)

Class QQmlExtensionPlugin:

baseUrl() const

Class QQuickItem:

forceActiveFocus(Qt::FocusReason reason)

Class QQuickWindow:

closing(QQuickCloseEvent *close)
hasDefaultAlphaBuffer()
setDefaultAlphaBuffer(bool useAlpha)

Class QAccelerometer:

accelerationModeChanged(QAccelerometer::AccelerationMode accelerationMode)
setAccelerationMode(QAccelerometer::AccelerationMode accelerationMode)

Class QLightSensor:

setFieldOfView(qreal fieldOfView)

Class QRotationSensor:

setHasZ(bool hasZ)

Class QSensor:

setCurrentOrientation(int currentOrientation)
setEfficientBufferSize(int efficientBufferSize)
setMaxBufferSize(int maxBufferSize)
setSkipDuplicates(bool skipDuplicates)
skipDuplicatesChanged(bool skipDuplicates)

Class QSqlRecord:

keyValues(const QSqlRecord &keyFields) const

Class QSqlTableModel:

primaryValues(int row) const

Class QGraphicsView:

rubberBandChanged(QRect rubberBandRect, QPointF fromScenePoint, QPointF toScenePoint)
rubberBandRect() const

Class QMenu:

addSection(const QIcon &icon, const QString &text)
addSection(const QString &text)
insertSection(QAction *before, const QIcon &icon, const QString &text)
insertSection(QAction *before, const QString &text)

New Global Functions

operator*(qreal factor, const QMargins &margins)
operator*(int factor, const QMargins &margins)
operator*(const QMargins &margins, qreal factor)
operator*(const QMargins &margins, int factor)
operator+(const QRect &rectangle, const QMargins &margins)
operator+(const QMargins &margins, const QRect &rectangle)
operator+(const QMargins &m1, const QMargins &m2)
operator-(const QMargins &margins)
operator-(const QMargins &m1, const QMargins &m2)
operator/(const QMargins &margins, qreal divisor)
operator/(const QMargins &margins, int divisor)
qDegreesToRadians(float degrees)
qDegreesToRadians(double degrees)
qEnvironmentVariableIsEmpty(const char *varName)
qEnvironmentVariableIsSet(const char *varName)
qRadiansToDegrees(float radians)
qRadiansToDegrees(double radians)
qunsetenv(const char *varName)

New Macros

Q_COREAPP_STARTUP_FUNCTION(QtStartUpFunction ptr)
Q_GLOBAL_STATIC(Type, VariableName)
Q_GLOBAL_STATIC_WITH_ARGS(Type, VariableName, Arguments)

New Enum Types

enum AccelerationMode { Combined, Gravity, User }
enum Script { Script_Unknown, Script_Inherited, Script_Common, Script_Latin, ..., ScriptCount }
enum JsonFormat { Indented, Compact }
enum LayoutFlag { SeparateAdvances, KernedAdvances, UseDesignMetrics }
enum AxesOrientationMode { FixedOrientation, AutomaticOrientation, UserOrientation }
enum Visibility { Hidden, AutomaticVisibility, Windowed, Minimized, Maximized, FullScreen }
enum ApplicationState { ApplicationSuspended, ApplicationHidden, ApplicationInactive, ApplicationActive }
enum Edge { TopEdge, LeftEdge, RightEdge, BottomEdge }

New Typedefs

typedef qoutputrangelist
typedef qrange
typedef qrangelist

New Properties

New QML Types

New QML Properties

New QML Signals

New QML Methods

Additions to Other Qt 5 Releases

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