Qt Reference Documentation

- Qt 4.8
- ALL VERSIONS

- A
- A
- A
- Print

# What's New in Qt 4.8

Qt 4.8 provides many improvements and enhancements over the previous releases in the Qt 4 series. This document covers the most important features in this release, separated by category.

A list of other Qt 4 features can be found on the What's New in Qt 4 page.

## Qt Quick 1.1

Qt Quick 1.1 introduces new changes such as new properties and better performance.

- Right-To-Left text support
- Improved image caching
- Text input improvements - Support for split-screen virtual keyboard
- PinchArea Element - enables simple pinch gesture handling
- New properties for QML Elements.

## Qt Platform Abstraction -- Lighthouse

QPA allows porting Qt to different windowing systems and devices easier. It provides a clean abstraction layer for porting QtGui to new window systems.

## Qt WebKit 2.2

The new Qt WebKit release introduces bug fixes, performance improvements, and greater compiler compatibility.

## Threaded OpenGL

Many Qt OpenGL functions are now thread-safe. Threads that cater to different situations are now available.

- Buffer swapping thread
- Texture uploading thread
- QPainter thread

## Deprecated Items in Qt 4.8

As part of Open Governance, modules in Qt 4.8 will receive maintainers and receive different support levels.

Currently, a module has an activity classification, the Module Maturity Level. As well, a list of modules and their maturity level is in the Qt Developer Network.

- Qt Modules' Maturity Level - Description - description of the different maturity levels
- Qt Modules' Maturity Levels - Modules List - list of the Qt modules and their maturity level

## Additions to the Qt API

Qt 4.8 introduces changes to the Qt API.

- C++11 support: Qt supports some of the features of the C++11 standard. QList, QVector and QStringList can be initialized with initializer lists. Most of the tool classes have a move operator. It is possible to use lambda functions in some of the QtConcurrent functions.
- Localization API

  Changes to the Localization APIs include improvements to QLocale and more support for different language code formats.

  - QLocale::quoteString() - for localized quotes
  - QLocale::createSeparatedList() - for localized list separation (e.g. "1, 2 and 3")
  - QLocale::bcp47Name() - for locale names in the canonical form according to RFC 5646 - BCP47
  - QLocale::matchingLocales() - to get a list of locales that match a criteria - e.g. a list of locales that use French language.
  - QLocale::firstDayOfWeek()
  - QLocale::weekdays()
  - QLocale::currencySymbol()
  - QLocale::toCurrencyString() - number formatting for currencies
  - QLocale::uiLanguages()
  - QLocale::nativeLanguageName()
  - QLocale::nativeCountryName()
- IP Multicast API
- Multithreaded HTTP
- QThreadLocalStorage can now store simple objects in addition to pointers

## New Classes, Functions, Macros, etc.

- New Classes
- New Member Functions
- New Global Functions
- New Macros

### New Classes

C
  CurrencyToStringArgument (QSystemLocale)

D
  QDBusUnixFileDescriptor

G
  QGenericPlugin
  QGenericPluginFactory
  QGLFunctions
  QGlyphRun

H
  QHttpMultiPart
  QHttpPart

I
  QIdentityProxyModel

P
  QPlatformCursor
  QPlatformCursorImage
  QPlatformFontDatabase
  QPlatformWindowFormat

R
  QRawFont

S
  QScopedValueRollback
  QSupportedWritingSystems

### New Member Functions

Class QContiguousCache:

void | swap ( QContiguousCache<T> & other )

Class QSslSocket:

QString | peerVerifyName () const
void | setPeerVerifyName ( const QString & hostName )

Class QPrinterInfo:

QPrinterInfo & | operator= ( const QPrinterInfo & other )

Class QElapsedTimer:

qint64 | nsecsElapsed () const

Class QGraphicsWebView:

QPainter::RenderHints | renderHints () const
void | setRenderHint ( QPainter::RenderHint hint, bool enabled = true )
void | setRenderHints ( QPainter::RenderHints hints )

Class QUndoCommand:

QString | actionText () const

Class QStringRef:

bool | contains ( const QString & str, Qt::CaseSensitivity cs = Qt::CaseSensitive ) const
bool | contains ( QChar ch, Qt::CaseSensitivity cs = Qt::CaseSensitive ) const
bool | contains ( const QStringRef & str, Qt::CaseSensitivity cs = Qt::CaseSensitive ) const
int | count ( const QString & str, Qt::CaseSensitivity cs = Qt::CaseSensitive ) const
int | count ( QChar ch, Qt::CaseSensitivity cs = Qt::CaseSensitive ) const
int | count ( const QStringRef & str, Qt::CaseSensitivity cs = Qt::CaseSensitive ) const
bool | endsWith ( const QString & str, Qt::CaseSensitivity cs = Qt::CaseSensitive ) const
bool | endsWith ( QLatin1String str, Qt::CaseSensitivity cs = Qt::CaseSensitive ) const
bool | endsWith ( QChar ch, Qt::CaseSensitivity cs = Qt::CaseSensitive ) const
bool | endsWith ( const QStringRef & str, Qt::CaseSensitivity cs = Qt::CaseSensitive ) const
int | indexOf ( const QString & str, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive ) const
int | indexOf ( QChar ch, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive ) const
int | indexOf ( QLatin1String str, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive ) const
int | indexOf ( const QStringRef & str, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive ) const
int | lastIndexOf ( const QString & str, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive ) const
int | lastIndexOf ( QChar ch, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive ) const
int | lastIndexOf ( QLatin1String str, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive ) const
int | lastIndexOf ( const QStringRef & str, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive ) const
bool | startsWith ( const QString & str, Qt::CaseSensitivity cs = Qt::CaseSensitive ) const
bool | startsWith ( QLatin1String str, Qt::CaseSensitivity cs = Qt::CaseSensitive ) const
bool | startsWith ( QChar ch, Qt::CaseSensitivity cs = Qt::CaseSensitive ) const
bool | startsWith ( const QStringRef & str, Qt::CaseSensitivity cs = Qt::CaseSensitive ) const
QByteArray | toAscii () const
QByteArray | toLatin1 () const
QByteArray | toLocal8Bit () const
QVector<uint> | toUcs4 () const
QByteArray | toUtf8 () const

Class QHelpSearchQueryWidget:

void | collapseExtendedSearch ()
void | expandExtendedSearch ()
void | setQuery ( const QList<QHelpSearchQuery> & queryList )

Class QNetworkReply:

void | setFinished ( bool finished )

Class QAbstractProxyModel:

virtual QModelIndex | buddy ( const QModelIndex & index ) const
virtual bool | canFetchMore ( const QModelIndex & parent ) const
virtual void | fetchMore ( const QModelIndex & parent )
virtual bool | hasChildren ( const QModelIndex & parent = QModelIndex() ) const
virtual QMimeData * | mimeData ( const QModelIndexList & indexes ) const
virtual QStringList | mimeTypes () const
virtual void | sort ( int column, Qt::SortOrder order = Qt::AscendingOrder )
virtual QSize | span ( const QModelIndex & index ) const
virtual Qt::DropActions | supportedDropActions () const

Class QGraphicsGridLayout:

void | removeItem ( QGraphicsLayoutItem * item )

Class QThreadPool:

bool | waitForDone ( int msecs )

Class QNetworkConfigurationManager:

void | configurationRemoved ( const QNetworkConfiguration & config )

Class QSharedMemory:

QString | nativeKey () const
void | setNativeKey ( const QString & key )

Class QGraphicsLayout:

bool | instantInvalidatePropagation ()
void | setInstantInvalidatePropagation ( bool enable )

Class QProcessEnvironment:

void | insert ( const QProcessEnvironment & e )
QStringList | keys () const

Class QGLFramebufferObjectFormat:

bool | mipmap () const
void | setMipmap ( bool enabled )

Class QSslConfiguration:

bool | testSslOption ( QSsl::SslOption option ) const

Class QWebPage:

void | viewportChangeRequested ()

Class QDBusConnection:

QDBusConnection | connectToPeer ( const QString & address, const QString & name )
ConnectionCapabilities | connectionCapabilities () const
void | disconnectFromPeer ( const QString & name )
QByteArray | localMachineId ()

Class QNetworkProxyQuery:

void | setNetworkConfiguration ( const QNetworkConfiguration & networkConfiguration )

Class QNetworkAccessManager:

QNetworkReply * | post ( const QNetworkRequest & request, QHttpMultiPart * multiPart )
QNetworkReply * | put ( const QNetworkRequest & request, QHttpMultiPart * multiPart )

Class QXmlStreamWriter:

bool | hasError () const

Class QDBusAbstractInterface:

void | setTimeout ( int timeout )
int | timeout () const

### New Global Functions

bool | operator!= ( const QVarLengthArray<T, Prealloc1> & left, const QVarLengthArray<T, Prealloc2> & right )
bool | operator!= ( const QPlatformWindowFormat & a, const QPlatformWindowFormat & b )
const QPoint | operator* ( int factor, const QPoint & point )
const QPoint | operator* ( double factor, const QPoint & point )
const QPoint | operator* ( float factor, const QPoint & point )
const QPoint | operator* ( const QPoint & point, int factor )
const QPoint | operator* ( const QPoint & point, double factor )
const QPoint | operator* ( const QPoint & point, float factor )
bool | operator== ( const QVarLengthArray<T, Prealloc1> & left, const QVarLengthArray<T, Prealloc2> & right )
bool | operator== ( const QPlatformWindowFormat & a, const QPlatformWindowFormat & b )

### New Macros

| Q_LIKELY ( expr )
| Q_UNLIKELY ( expr )