New Classes and Functions in Qt 5.2 | Qt 5.12

- Qt 5.12
- New Classes and Functions in Qt 5.2
- Qt 5.12.11 Reference Documentation

# New Classes and Functions in Qt 5.2

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

- New Namespaces
- New Classes
- New Member Functions
- New Functions in Namespaces
- New Global Functions
- New Macros
- New Enum Types
- New Properties
- New QML Types
- New QML Properties
- New QML Signals
- New QML Methods

### New Namespaces

namespace | QBluetooth
namespace | QtMac

### New Classes

A
  QAndroidJniEnvironment
  QAndroidJniObject
  QAssociativeIterable
  Alternative (QBluetoothServiceInfo)

B
  QBluetoothAddress
  QBluetoothDeviceDiscoveryAgent
  QBluetoothDeviceInfo
  QBluetoothHostInfo
  QBluetoothLocalDevice
  QBluetoothServer
  QBluetoothServiceDiscoveryAgent
  QBluetoothServiceInfo
  QBluetoothSocket
  QBluetoothTransferManager
  QBluetoothTransferReply
  QBluetoothTransferRequest
  QBluetoothUuid

C
  const_iterator (QAssociativeIterable)
  QCollator
  QCollatorSortKey
  QCommandLineOption
  QCommandLineParser
  const_iterator (QSequentialIterable)

F
  QFileSelector

G
  QGeoAddress
  QGeoAreaMonitorInfo
  QGeoAreaMonitorSource
  QGeoCircle
  QGeoCoordinate
  QGeoLocation
  QGeoPositionInfo
  QGeoPositionInfoSource
  QGeoPositionInfoSourceFactory
  QGeoRectangle
  QGeoSatelliteInfo
  QGeoSatelliteInfoSource
  QGeoShape

K
  QKeySequenceEdit

L
  QLoggingCategory

M
  QMacPasteboardMime

N
  QNativeGestureEvent
  QNdefFilter
  QNdefNfcTextRecord
  QNdefNfcUriRecord
  QNdefRecord
  QNearFieldManager
  QNearFieldTarget
  QNmeaPositionInfoSource

O
  QOpenGLTexture

Q
  QQmlFileSelector
  QQmlNdefRecord
  QQuickFramebufferObject

R
  Renderer (QQuickFramebufferObject)

S
  Sequence (QBluetoothServiceInfo)
  QSequentialIterable
  QStaticPlugin

T
  QTimeZone

W
  QWinJumpList
  QWinJumpListCategory
  QWinJumpListItem
  QWinTaskbarButton
  QWinTaskbarProgress
  QWinThumbnailToolBar
  QWinThumbnailToolButton

### New Member Functions

Class QDir:

| operator=(QDir &&other)

Class QFileInfo:

| exists(const QString &file)
| operator=(QFileInfo &&other)

Class QProcess:

| inputChannelMode() const
| nullDevice()
| setInputChannelMode(QProcess::InputChannelMode mode)

Class QPersistentModelIndex:

| operator=(QPersistentModelIndex &&other)

Class QUrl:

| adjusted(QUrl::FormattingOptions options) const
| fileName(QUrl::ComponentFormattingOptions options) const
| fromCFURL(CFURLRef url)
| fromNSURL(const NSURL *url)
| matches(const QUrl &url, QUrl::FormattingOptions options) const
| operator=(QUrl &&other)
| toCFURL() const
| toNSURL() const

Class QUrlQuery:

| operator=(QUrlQuery &&other)

Class QBitArray:

| operator=(QBitArray &&other)

Class QByteArray:

| fromBase64(const QByteArray &base64, QByteArray::Base64Options options)
| operator=(QByteArray &&other)
| toBase64(QByteArray::Base64Options options) const

Class QCommandLineOption:

| operator=(QCommandLineOption &&other)

Class QContiguousCache:

| operator=(QContiguousCache<T> &&other)

Class QDateTime:

| fromMSecsSinceEpoch(qint64 msecs, Qt::TimeSpec spec, int offsetSeconds)
| fromMSecsSinceEpoch(qint64 msecs, const QTimeZone &timeZone)
| isDaylightTime() const
| offsetFromUtc() const
| setOffsetFromUtc(int offsetSeconds)
| setTimeZone(const QTimeZone &toZone)
| timeZone() const
| timeZoneAbbreviation() const
| toOffsetFromUtc(int offsetSeconds) const
| toTimeZone(const QTimeZone &timeZone) const

Class QEasingCurve:

| operator=(QEasingCurve &&other)

Class QExplicitlySharedDataPointer:

| operator=(QExplicitlySharedDataPointer<T> &&other)

Class QHash:

| operator=(QHash<K, V> &&other)

Class QJsonValue:

| toInt(int defaultValue) const

Class QLinkedList:

| operator=(QLinkedList<T> &&other)

Class QList:

| operator=(QList<T> &&other)

Class QMap:

| first()
| first() const
| firstKey() const
| last()
| last() const
| lastKey() const
| operator=(QMap<Key, T> &&other)

Class QMetaType:

| compare(const void *lhs, const void *rhs, int typeId, int *result)
| convert(const void *from, int fromTypeId, void *to, int toTypeId)
| debugStream(QDebug &dbg, const void *rhs, int typeId)
| hasRegisteredComparators()
| hasRegisteredComparators(int typeId)
| hasRegisteredConverterFunction()
| hasRegisteredConverterFunction(int fromTypeId, int toTypeId)
| hasRegisteredDebugStreamOperator()
| hasRegisteredDebugStreamOperator(int typeId)
| registerComparators()
| registerConverter()
| registerConverter(MemberFunction function)
| registerConverter(MemberFunctionOk function)
| registerConverter(UnaryFunction function)

Class QMimeType:

| operator=(QMimeType &&other)

Class QObject:

| connect(const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)

Class QPair:

| operator=(QPair<TT1, TT2> &&p)
| operator=(const QPair<TT1, TT2> &p)

Class QRegExp:

| operator=(QRegExp &&other)

Class QSharedDataPointer:

| operator=(QSharedDataPointer<T> &&other)

Class QString:

| fromCFString(CFStringRef string)
| fromNSString(const NSString *string)
| operator=(QString &&other)
| toCFString() const
| toNSString() const

Class QStringRef:

| left(int n) const
| mid(int position, int n) const
| right(int n) const

Class QThread:

| isInterruptionRequested() const
| requestInterruption()

Class QThreadPool:

| clear()

Class QVariant:

| operator=(QVariant &&other)

Class QVector:

| length() const
| operator=(QVector<T> &&other)
| removeAt(int i)
| takeAt(int i)

Class QCursor:

| operator=(QCursor &&other)

Class QGuiApplication:

| applicationState()
| applicationStateChanged(Qt::ApplicationState state)
| sync()

Class QIcon:

| operator=(QIcon &&other)

Class QImage:

| operator=(QImage &&other)

Class QKeySequence:

| operator=(QKeySequence &&other)

Class QNativeGestureEvent:

| gestureType() const
| globalPos() const
| localPos() const
| pos() const
| screenPos() const
| value() const
| windowPos() const

Class QPalette:

| operator=(QPalette &&other)

Class QPicture:

| operator=(QPicture &&other)

Class QPixmap:

| operator=(QPixmap &&other)

Class QTouchDevice:

| maximumTouchPoints() const

Class QWheelEvent:

| phase() const

Class QVector3D:

| operator[](int i)
| operator[](int i) const

Class QVector2D:

| operator[](int i)
| operator[](int i) const

Class QVector4D:

| operator[](int i)
| operator[](int i) const

Class QBrush:

| operator=(QBrush &&other)

Class QColor:

| name(QColor::NameFormat format) const

Class QPainterPath:

| operator=(QPainterPath &&other)

Class QPen:

| operator=(QPen &&other)

Class QRegion:

| operator=(QRegion &&other)

Class QAbstractTextDocumentLayout:

| unregisterHandler(int objectType, QObject *component)

Class QFont:

| operator=(QFont &&other)

Class QFontDatabase:

| systemFont(QFontDatabase::SystemFont type)

Class QFontMetrics:

| operator=(QFontMetrics &&other)

Class QPlatformFontDatabase:

| registerAliasToFontFamily(const QString &familyName, const QString &alias)

Class QPlatformIntegration:

virtual | createEventDispatcher() const = 0
virtual | createPlatformSessionManager(const QString &id, const QString &key) const
virtual | sync()

Class QPlatformTheme:

virtual | keyBindings(QKeySequence::StandardKey key) const

Class QNetworkAccessManager:

| connectToHost(const QString &hostName, quint16 port)
| connectToHostEncrypted(const QString &hostName, quint16 port, const QSslConfiguration &sslConfiguration)
| supportedSchemes() const
| supportedSchemesImplementation() const

Class QNetworkConfiguration:

| bearerTypeFamily() const

Class QSslConfiguration:

| sessionTicket() const
| sessionTicketLifeTimeHint() const
| setSessionTicket(const QByteArray &sessionTicket)

Class QQuickWindow:

| resetOpenGLState()

Class QPressureReading:

| setTemperature(qreal temperature)

Class QSerialPort:

| handle() const

Class QAbstractItemView:

virtual | viewportSizeHint() const override

Class QAbstractScrollArea:

virtual | viewportSizeHint() const

Class QButtonGroup:

| buttonToggled(QAbstractButton *button, bool checked)
| buttonToggled(int id, bool checked)

Class QFileDialog:

| currentUrlChanged(const QUrl &url)
| directoryUrl() const
| directoryUrlEntered(const QUrl &directory)
| getExistingDirectoryUrl(QWidget *parent, const QString &caption, const QUrl &dir, QFileDialog::Options options, const QStringList &supportedSchemes)
| getOpenFileUrl(QWidget *parent, const QString &caption, const QUrl &dir, const QString &filter, QString *selectedFilter, QFileDialog::Options options, const QStringList &supportedSchemes)
| getOpenFileUrls(QWidget *parent, const QString &caption, const QUrl &dir, const QString &filter, QString *selectedFilter, QFileDialog::Options options, const QStringList &supportedSchemes)
| getSaveFileUrl(QWidget *parent, const QString &caption, const QUrl &dir, const QString &filter, QString *selectedFilter, QFileDialog::Options options, const QStringList &supportedSchemes)
| mimeTypeFilters() const
| selectMimeTypeFilter(const QString &filter)
| selectUrl(const QUrl &url)
| selectedUrls() const
| setDirectoryUrl(const QUrl &directory)
| setMimeTypeFilters(const QStringList &filters)
| urlSelected(const QUrl &url)
| urlsSelected(const QList<QUrl> &urls)

Class QFileIconProvider:

| options() const
| setOptions(QFileIconProvider::Options options)

Class QHeaderView:

| resizeContentsPrecision() const
| setResizeContentsPrecision(int precision)

Class QInputDialog:

| getMultiLineText(QWidget *parent, const QString &title, const QString &label, const QString &text, bool *ok, Qt::WindowFlags flags, Qt::InputMethodHints inputMethodHints)

Class QLayout:

| replaceWidget(QWidget *from, QWidget *to, Qt::FindChildOptions options)

Class QLineEdit:

| addAction(const QIcon &icon, QLineEdit::ActionPosition position)
| addAction(QAction *action, QLineEdit::ActionPosition position)

Class QListView:

virtual | viewportSizeHint() const override

Class QMainWindow:

| takeCentralWidget()

Class QMenuBar:

| toNSMenu()

Class QMenu:

| setAsDockMenu()
| toNSMenu()

Class QMessageBox:

| checkBox() const
| setCheckBox(QCheckBox *cb)

Class QSizePolicy:

| retainSizeWhenHidden() const
| setRetainSizeWhenHidden(bool retainSize)

Class QSplashScreen:

| message() const

Class QTabBar:

| tabBarClicked(int index)
| tabBarDoubleClicked(int index)

Class QTabWidget:

| tabBarClicked(int index)
| tabBarDoubleClicked(int index)

Class QToolTip:

| showText(const QPoint &pos, const QString &text, QWidget *w, const QRect &rect, int msecDisplayTime)

Class QTreeView:

| setTreePosition(int index)
| treePosition() const

Class QWidget:

| windowIconChanged(const QIcon &icon)
| windowTitleChanged(const QString &title)

Class QX11Info:

| getTimestamp()
| isPlatformX11()

### New Functions in Namespaces

| colorizationColor(bool *opaqueBlend)
| createMask(const QBitmap &bitmap)
| disableBlurBehindWindow(QWindow *window)
| disableBlurBehindWindow(QWidget *window)
| enableBlurBehindWindow(QWindow *window, const QRegion &region)
| enableBlurBehindWindow(QWindow *window)
| enableBlurBehindWindow(QWidget *window, const QRegion &region)
| enableBlurBehindWindow(QWidget *window)
| errorStringFromHresult(int hresult)
| extendFrameIntoClientArea(QWindow *window, int left, int top, int right, int bottom)
| extendFrameIntoClientArea(QWindow *window, const QMargins &margins)
| extendFrameIntoClientArea(QWidget *window, int left, int top, int right, int bottom)
| extendFrameIntoClientArea(QWidget *window, const QMargins &margins)
| fromHBITMAP(HBITMAP bitmap, QtWin::HBitmapFormat format)
| fromHICON(HICON icon)
| fromHRGN(HRGN hrgn)
| imageFromHBITMAP(int hdc, HBITMAP bitmap, int width, int height)
| isCompositionEnabled()
| isCompositionOpaque()
| isWindowExcludedFromPeek(QWindow *window)
| isWindowExcludedFromPeek(QWidget *window)
| isWindowPeekDisallowed(QWindow *window)
| isWindowPeekDisallowed(QWidget *window)
| markFullscreenWindow(QWindow *window, bool fullscreen)
| markFullscreenWindow(QWidget *window, bool fullscreen)
| realColorizationColor()
| resetExtendedFrame(QWindow *window)
| resetExtendedFrame(QWidget *window)
| setCompositionEnabled(bool enabled)
| setCurrentProcessExplicitAppUserModelID(const QString &id)
| setWindowDisallowPeek(QWindow *window, bool disallow)
| setWindowDisallowPeek(QWidget *window, bool disallow)
| setWindowExcludedFromPeek(QWindow *window, bool exclude)
| setWindowExcludedFromPeek(QWidget *window, bool exclude)
| setWindowFlip3DPolicy(QWindow *window, QtWin::WindowFlip3DPolicy policy)
| setWindowFlip3DPolicy(QWidget *window, QtWin::WindowFlip3DPolicy policy)
| stringFromHresult(int hresult)
| taskbarActivateTab(QWindow *window)
| taskbarActivateTab(QWidget *window)
| taskbarActivateTabAlt(QWindow *window)
| taskbarActivateTabAlt(QWidget *window)
| taskbarAddTab(QWindow *window)
| taskbarAddTab(QWidget *window)
| taskbarDeleteTab(QWindow *window)
| taskbarDeleteTab(QWidget *window)
| toHBITMAP(const QPixmap &p, QtWin::HBitmapFormat format)
| toHICON(const QPixmap &p)
| toHRGN(const QRegion &region)
| windowFlip3DPolicy(QWindow *window)
| windowFlip3DPolicy(QWidget *window)

### New Global Functions

| qFloatDistance(double a, double b)
| qFloatDistance(float a, float b)
| qPopulationCount(quint8 v)
| qPopulationCount(quint64 v)
| qPopulationCount(quint32 v)
| qPopulationCount(quint16 v)

### New Macros

| Q_DECLARE_LOGGING_CATEGORY(name)
| Q_FORWARD_DECLARE_CF_TYPE(type)
| Q_FORWARD_DECLARE_MUTABLE_CF_TYPE(type)
| Q_FORWARD_DECLARE_OBJC_CLASS(classname)
| Q_LOGGING_CATEGORY(name, string)
| qCCritical(category)
| qCDebug(category)
| qCWarning(category)

### New Enum Types

enum | SizeAdjustPolicy { AdjustIgnored, AdjustToContentsOnFirstShow, AdjustToContents }
enum | Base64Option { Base64Encoding, Base64UrlEncoding, KeepTrailingEquals, OmitTrailingEquals }
enum | Option { DontUseCustomDirectoryIcons }
enum | SystemFont { GeneralFont, FixedFont, TitleFont, SmallestReadableFont }
enum | ActionPosition { LeadingPosition, TrailingPosition }
enum | InputChannelMode { ManagedInputChannel, ForwardedInputChannel }
enum | NativeGestureType { BeginNativeGesture, EndNativeGesture, PanNativeGesture, ZoomNativeGesture, ..., SwipeNativeGesture }
enum | ScrollPhase { NoScrollPhase, ScrollBegin, ScrollUpdate, ScrollEnd, ScrollMomentum }
enum | HBitmapFormat { HBitmapNoAlpha, HBitmapPremultipliedAlpha, HBitmapAlpha }
enum | WindowFlip3DPolicy { FlipDefault, FlipExcludeBelow, FlipExcludeAbove }

### New Properties

- sizeAdjustPolicy : const
- currentData : const
- filterMode : const
- maximumSectionSize : const
- clearButtonEnabled : const
- unifiedTitleAndToolBarOnMac : const

- temperature : const
- nativeOrientation : const
- displayIntegerBase : const
- placeholderText : const
- toolTipDuration : const

### New QML Types

A
  Address
  Animator

B
  BluetoothDiscoveryModel
  BluetoothService
  BluetoothSocket
  BusyIndicator
  BusyIndicatorStyle

F
  FontDialog

L
  Location

M
  MessageDialog

N
  NdefFilter
  NdefMimeRecord
  NdefTextRecord
  NdefUriRecord
  NearField

O
  OpacityAnimator

P
  Position
  PositionSource

Q
  QtPositioning

R
  RotationAnimator

S
  ScaleAnimator
  SpinBoxStyle
  StatusBarStyle
  Switch
  SwitchStyle

T
  TextAreaStyle
  ToolBarStyle

U
  UniformAnimator

X
  XAnimator

Y
  YAnimator

### New QML Properties

| colorData
| dragType
| formats
| hasColor
| hasHtml
| hasText
| hasUrls
| hoveredLink
| hoveredLink
| html
| mimeData
| pixelDensity
| proposedAction
| showFiles
| showHidden
| text
| urls

### New QML Signals

| linkHovered()
| linkHovered()
| editingFinished()

### New QML Methods

| acceptProposedAction()
| getDataAsString()
| matches()
| append()

## 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.1
- What's New in Qt 5.0