New Classes and Functions in Qt 5.1 | Qt 5.9

Qt 5.9 | New Classes and Functions in Qt 5.1

Qt 5.9.4 Reference Documentation

# 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
- New Member Functions
- New Global Functions
- New Macros
- New Enum Types
- New Properties

### New Classes

A
  QAbstractOpenGLFunctions

B
  Binder (QOpenGLVertexArrayObject)

D
  QDBusVirtualObject
  QDebugStateSaver

G
  QGlobalStatic

L
  QLockFile

M
  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

R
  QRegularExpressionValidator

S
  QSaveFile

### New Member Functions

Class QAbstractFileEngine:

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

Class QProcess:

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

Class QUrl:

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

Class QMetaMethod:

| revision() const

Class QMetaProperty:

| revision() const

Class QChar:

| script(uint ucs4)
| script() 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(const_iterator pos, const Key &key, const T &value)
| insertMulti(const_iterator pos, const Key &key, const T &value)

Class QMultiMap:

| insert(QMap<Key, T>::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 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:

| namedCaptureGroups() const

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:

| squeeze()

Class QVector:

| removeFirst()
| removeLast()
| takeFirst()
| takeLast()

Class QIcon:

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

Class QInputMethod:

| inputItemRectangle() const
| setInputItemRectangle(const QRectF &rect)

Class QKeySequence:

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

Class QPlatformTheme:

virtual | createIconEngine(const QString &iconName) const

Class QPlatformWindow:

virtual | isAlertState() const
virtual | setAlertState(bool enable)

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 QPlatformFontDatabase:

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

Class QRawFont:

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

Class QNetworkAccessManager:

| encrypted(QNetworkReply *reply)

Class QNetworkReply:

| encrypted()

Class QLocalSocket:

| connectToServer(OpenMode openMode)
| setServerName(const QString &name)

Class QSslConfiguration:

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

Class QSslSocket:

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

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 | Script { Script_Unknown, Script_Inherited, Script_Common, Script_Latin, ..., ScriptCount }
enum | LayoutFlag { SeparateAdvances, KernedAdvances, UseDesignMetrics }
enum | Visibility { Hidden, AutomaticVisibility, Windowed, Minimized, Maximized, FullScreen }
enum | ApplicationState { ApplicationSuspended, ApplicationHidden, ApplicationInactive, ApplicationActive }
enum | Edge { TopEdge, LeftEdge, RightEdge, BottomEdge }

### New Properties

toolTipsVisible : const textInteractionFlags : const active : const | opacity : const visibility : const

## Additions to Other Qt 5 Releases

- What's New in Qt 5.6
- What's New in Qt 5.5
- What's New in Qt 5.4
- What's New in Qt 5.3
- What's New in Qt 5.2
- What's New in Qt 5.0