Qt 5.0 的新功能

Qt Core 变化

QStandardPaths

QStandardPaths is a more powerful version of QDesktopServices that was present in Qt 4. Modeled after KStandardDirs from KDE 4, it contains additional features such as searching for all occurrences of a given file in the storage locations.

编译时校验信号槽连接

QObject now supports an additional syntax for connecting signals to slots, which forces the compiler to check whether the signal and the receiver exist and their arguments are compatible.

This syntax allows connecting a signal to any kind of C++ receiver, including C++11 lambdas, member functions, or static functions. The receivers no longer need to be declared as slots, but such declarations are still recommended for readability.

基于字符串的连接和基于函子的连接之间的差异 了解更多细节。

Perl 兼容的正则表达式

QRegularExpression is introduced to provide better support for regular expressions compatible with Perl. This class is more powerful and faster than QRegExp , and supports more features such as lazy and possessive quantifiers, lookbehinds, named capturing groups, and iteration of matches.

Qt GUI 变化

用于窗口和渲染的新类

A new set of enabler classes have been added, most importantly QWindow , QScreen , QSurfaceFormat ,和 QOpenGLContext . These are now used as backends for the Qt Widgets module and by Qt Quick 2.

OpenGL 类

Most of the useful Qt OpenGL classes have been polished and moved into Qt GUI . A few important ones are, QOpenGLFramebufferObject , QOpenGLShaderProgram , QOpenGLFunctions , and so on. For the complete list, refer to Qt GUI C++ 类 .

This change introduces QOpenGLContext as a replacement for QGLContext. This replacement class is more generic and decoupled from QWindow , making it to support more use cases such as using the same context for multiple surfaces.

QOpenGLPaintDevice

Instead of having QWindow and QOpenGLFramebufferObject be subclasses of QPaintDevice , you can now use QOpenGLPaintDevice . This new alternative can be created on the stack, makes it easier and flexible to render into the currently bound context using QPainter .

Qt Network 变化

QDnsLookup

It is now possible to lookup DNS records using the new QDnsLookup API. This does not replace QHostInfo , which is still the API to be used for resolving a host name to an IP address. QDnsLookup is mainly used for other types of DNS record, such as SRV, TXT and MX.

注意: This new class replaces the Q3Dns API, which is removed in Qt 5.

更好地支持 IPv6 和双模网络

Most applications using host names and network layer transparent protocols, will now gain IPv6 support transparently. This means, QTcpServer and QUdpSocket bound to QHostAddress::Any can now receive both IPv4 and IPv6 connections, although, QHostAddress::AnyIPv4 and QHostAddress::AnyIPv6 can be used to bind to only one protocol.

Outgoing http connections using QNetworkAccessManager will now attempt both IPv4 and IPv6 connections in parallel, and use the one that succeeds first.

绑定 TCP 套接字

QTcpSocket can be bound to an IP address before connecting, which is useful for limiting connection to a specific interface in a multi-homed environment.

SSL 证书

SSL certificate extensions can now be accessed to enable further development of SSL support in Qt.

Developers can also verify an SSL certificate chain programatically now.

用于有缺陷 SSL 服务器的解决方案

The QSsl::SslOption enum now allows a QSslSocket -based code to access legacy systems by enabling bug workarounds.

注意: This change is also back-ported to Qt 4.8.

支持不透明私钥

This allows applications to read private keys from devices such as PKCS#11 dongles, as illustrated by the qsslkey example

Qt QML 变化

This is a new module in Qt 5 that provides the QML engine and the backend infrastructure.

QML 引擎

  • v8 JavaScript 引擎
  • Various parser and compiler optimizations have been implemented along with the new bindings optimizer.
  • Loading/compilation can now be performed in a separate thread. This can be enabled by loading a loader object asynchronously through its source property, or by passing the Component.Asynchronous parameter to Qt.createComponent() .
  • New QQmlEngine::trimComponentCache () function safely discards unused data in the engine’s component cache to free memory.

类型系统

  • New var property type can hold JavaScript references.
  • QML properties of type var and variant can now hold pixmaps.
  • Value type improvements:
    • QColor is now a value type. The red, green, blue and alpha channels of a “color” property can now be accessed using “r”, “g”, “b” and “a” properties.
    • Improved support for QVector4D , now constructible in QML using Qt.vector4d() .
  • Support for certain sequence types ( QList <int>, QList <qreal>, QList <bool>, QList < QUrl >, QList < QString > 和 QStringList ) has been improved. QObjects can define Q_PROPERTYs of these types which can be accessed from JavaScript.

其它

  • JavaScript (.js) files can now import QML modules and other JavaScript files using the “import” statement.
  • QQmlExpression can now be constructed directly (and more efficiently) from a QQmlScriptString .
  • The component returned by Qt.createComponent() is no longer the owned by the engine. Be sure to hold a reference,or provide a parent.

Qt Quick 变化

This is a new module in Qt 5 which provides the visual canvas and scenegraph backend as well as the QtQuick QML module for QML-based application development.

The module replaces the QDeclarative* equivalents in QtQuick 1 with the following:

Qt Quick C++ 类 for the complete list.

The QtQuick 2.0 QML module is a major update, and the following sections outline the features that come with it:

新图形体系结构

视觉和图形类型

动画

文本

  • Text :
    • AutoText format now switches to StyledText 而不是 RichText .
    • lineLaidOut signal is emitted for every line during the layout process to give the option of positioning and/or resizing text as they are laid out.
    • doLayout() method can now trigger the text layout from JavaScript.
    • ElideRight to support text that spans multiple lines.
    • fontSizeMode property now supports wrapping the text to the item size.
    • minimumPixelSize and minimumPointSize properties can be used to specify a lower bound when auto-fitting.
  • TextEdit.textFormat 特性现在默认为 PlainText 而不是 AutoText .
  • TextInput 现在拥有 wrapMode and verticalAlignment properties.
  • TextInput.positionAt() now takes y 值。

用户输入

  • New MultiPointTouchArea type can process multi-point touches and provide information about the touch points including position, pressure and velocity.
  • MouseArea type now:
    • Propagates wheel events.
    • Propagates clicked , doubleClicked and pressAndHold events differently to pressed . These events are propagated to the handler of the topmost MouseArea in the stack-order.
    • Can ignore the propagated events using the propagateComposedEvents . Such ignored events are propagated to the next MouseArea handler in the stack-order.

专用容器

  • Flickable type now has:
    • a new rebound property that enables you to specify the transition type for the bounce back animation.
    • New topMargin , bottomMargin , leftMargin ,和 rightMargin properties allow extra margin space to be specified. This is useful to implement the pull-to-refresh functionality for a list.
    • New xOrigin and yOrigin properties provide the top left position of the content item.
    • New dragging , draggingHorizontally ,和 draggingVertically properties that provide information when the flickable area is dragged.

定位器

The following features are related to Row, Column, Grid, and Flow types:

  • The “add” and “move” transitions can now access the ViewTransition attached property, and also animate arbitrary item properties (instead of being restricted to animating an item’s position).
  • New Positioner.index , Positioner.isFirstItem and Positioner.isLastItem attached properties for items within a positioner.
  • The Grid type has new rowSpacing and columnSpacing 特性。
  • All spacing properties on positioners now use real numbers instead of integers.

模型和视图

  • ListView and GridView :
    • Transitions can be specified to animate the adding, removing and moving of items in a view. For details, see ViewTransition , ListView.add , ListView.addDisplaced , GridView.add ,和 GridView.addDisplaced .
    • New verticalLayoutDirection property enables items to be laid out from bottom-to-top using the BottomToTop 枚举值。
    • The cacheBuffer property now has a non-zero default and delegates in the cacheBuffer are created asynchronously.
    • New headerItem and footerItem properties provide access to the instantiated header and footer items.
    • RightToLeft layout now also reverses the preferredHighlightBegin and preferredHighlightEnd .
  • ListView 's new section.labelPositioning property can fix the current section label to the start of the view, and the next section label to the end of the view, so that labels do not scroll while section items are still in view.
  • PathView has two new properties, curretnItem and maximumFlickVelocity .

粒子系统支持

新的 QtQuick .Particles 2.0 module provides support for the composition of a variety of 2D particle systems. See 使用 Qt Quick 粒子系统 了解更多细节。

实用类型

  • New PathArc , PathCurve and PathSvg types:
    • PathArc and PathCurve support the construction of arcs and catmull-rom curves, respectively. PathSvg supports the construction of a path from an SVG string.
  • Loader:
    • New asynchronous property allows components to be instantiated with a lower chance of blocking. With the asynchronous 特性被设为 true , the component is compiled in a background thread.
    • New active property delays instantiation of a Loader object’s item.
    • New setSource(JSObject) method to specify initial property values for the loaded item, similar to Component.createObject() .
    • sourceChanged signal is now only emitted when the source changes and the sourceComponentChanged signal is now emitted when the sourceComponent is changed. Ealier, these signals were emitted by the Loader only when one of the two properties had changed.
    • Loader type can now be used as a value source, and it can restore any previously set binding if its "when" clause becomes false .

Qt Multimedia 变化

Qt Multimedia is an essential module replacing the QtMultimedia library and Qt MultimediaKit mobility API in Qt 4.8. It features full support for Audio and Video playback, and recording. Support for web cameras is integrated.

Qt Multimedia uses the system’s native multimedia engine as a backend, and does not come with its own audio or video codecs. Thus the supported list of codecs is equivalent to the ones supported by the underlying OS.

It uses DirectShow and WMF on Windows, AVFoundation on Mac and gstreamer on Linux.

新的类和函数

The section provides a comprehensive list of all new classes and functions introduced in Qt 5.

新类

A
QAbstractNativeEventFilter
B
QBackingStore
C
QCameraFeedbackControl
const_iterator ( QJsonObject )
D
QDnsLookup
E
QEnterEvent
QEventLoopLocker
QException
QExposeEvent
F
QFileDevice
G
QGuiApplication
I
QInputMethodQueryEvent
iterator ( QJsonObject )
J
QJSEngine
QJSValue
QJsonArray
QJsonDocument
QJsonObject
QJsonParseError
QJsonValue
M
QMessageLogContext
QMessageLogger
QMimeDatabase
QMimeType
O
QOpenGLBuffer
QOpenGLContext
QOpenGLContextGroup
QOpenGLFramebufferObject
QOpenGLFramebufferObjectFormat
QOpenGLFunctions
QOpenGLPaintDevice
QOpenGLShader
QOpenGLShaderProgram
Q
QQmlComponent
QQmlEngine
QQmlError
QQmlExpression
QQmlExtensionPlugin
QQmlListProperty
QQmlListReference
QQmlNetworkAccessManagerFactory
QQmlParserStatus
QQmlProperty
QQuickImageProvider
QQuickTextureFactory
QQuickView
QQuickWindow
R
QRegularExpression
QRegularExpressionMatch
QRegularExpressionMatchIterator
S
QScreen
QScroller
QSslCertificateExtension
QStandardPaths
QStyleHints
QSurface
QSurfaceFormat
T
QTouchDevice
U
QUnhandledException
QUrlQuery
W
QWinEventNotifier
QWindow

新成员函数

QDBusPendingCall :

void swap (QDBusPendingCall & other )

QLibraryInfo :

bool isDebugBuild ()

QDebug :

bool autoInsertSpaces () const
void setAutoInsertSpaces (bool b )
void swap (QDebug & other )

QDir :

bool removeRecursively ()
void swap (QDir & other )

QFileInfo :

bool isNativePath () const
void swap (QFileInfo & other )

QProcessEnvironment :

void swap (QProcessEnvironment & other )

QProcess :

QStringList arguments () const
QString program () const

QUrl :

void setQuery (const QUrlQuery & query )
QString toDisplayString (FormattingOptions options = FormattingOptions( PrettyDecoded )) const

QPersistentModelIndex :

void swap (QPersistentModelIndex & other )

QAbstractItemModel :

void layoutAboutToBeChanged (const QList<QPersistentModelIndex> & parents = QList<QPersistentModelIndex> (), QAbstractItemModel::LayoutChangeHint hint = QAbstractItemModel::NoLayoutChangeHint)
void layoutChanged (const QList<QPersistentModelIndex> & parents = QList<QPersistentModelIndex> (), QAbstractItemModel::LayoutChangeHint hint = QAbstractItemModel::NoLayoutChangeHint)

QAbstractEventDispatcher :

bool filterNativeEvent (const QByteArray & eventType , void * message , long * result )
void installNativeEventFilter (QAbstractNativeEventFilter * filterObj )
void removeNativeEventFilter (QAbstractNativeEventFilter * filter )

QCoreApplication :

void installNativeEventFilter (QAbstractNativeEventFilter * filterObj )
void removeNativeEventFilter (QAbstractNativeEventFilter * filterObject )

QMetaMethod :

QMetaMethod fromSignal (PointerToMemberFunction signal )
bool isValid () const
QByteArray methodSignature () const
QByteArray name () const
int parameterCount () const
int parameterType (int index ) const
int returnType () const

QMetaType :

void * construct (int type , void * where , const void * copy )
void * construct (void * where , const void * copy = Q_NULLPTR) const
void * create (const void * copy = Q_NULLPTR) const
void destroy (void * data ) const
void destruct (int type , void * where )
void destruct (void * data ) const
TypeFlags flags () const
bool isRegistered () const
bool isValid () const
const QMetaObject * metaObjectForType (int type )
int sizeOf (int type )
int sizeOf () const
TypeFlags typeFlags (int type )

QObject :

virtual void connectNotify (const QMetaMethod & signal )
virtual void disconnectNotify (const QMetaMethod & signal )
QList<T> findChildren (const QRegularExpression & re , Qt::FindChildOptions options = Qt::FindChildrenRecursively) const
bool isSignalConnected (const QMetaMethod & signal ) const

QMetaObject :

bool checkConnectArgs (const QMetaMethod & signal , const QMetaMethod & method )

QPointer :

void clear ()

QVariant :

QJsonArray toJsonArray () const
QJsonDocument toJsonDocument () const
QJsonObject toJsonObject () const
QJsonValue toJsonValue () const
QModelIndex toModelIndex () const
QRegularExpression toRegularExpression () const
QUuid toUuid () const

QUuid :

QUuid createUuidV3 (const QUuid & ns , const QByteArray & baseData )
QUuid createUuidV3 (const QUuid & ns , const QString & baseData )
QUuid createUuidV5 (const QUuid & ns , const QByteArray & baseData )
QUuid createUuidV5 (const QUuid & ns , const QString & baseData )

QSizeF :

QSizeF scaled (qreal width , qreal height , Qt::AspectRatioMode mode ) const
QSizeF scaled (const QSizeF & s , Qt::AspectRatioMode mode ) const
QSizeF transposed () const

QThread :

QAbstractEventDispatcher * eventDispatcher () const
void setEventDispatcher (QAbstractEventDispatcher * eventDispatcher )

QByteArray :

const_iterator cbegin () const
const_iterator cend () const

QChar :

bool hasMirrored (uint ucs4 )
bool isDigit (uint ucs4 )
bool isLetter (uint ucs4 )
bool isLetterOrNumber (uint ucs4 )
bool isLower (uint ucs4 )
bool isMark (uint ucs4 )
bool isNonCharacter () const
bool isNonCharacter (uint ucs4 )
bool isNumber (uint ucs4 )
bool isPrint (uint ucs4 )
bool isPunct (uint ucs4 )
bool isSpace (uint ucs4 )
bool isSurrogate () const
bool isSurrogate (uint ucs4 )
bool isSymbol (uint ucs4 )
bool isTitleCase (uint ucs4 )
bool isUpper (uint ucs4 )

QCryptographicHash :

bool addData (QIODevice * device )

QEasingCurve :

void swap (QEasingCurve & other )
QVector<QPointF> toCubicSpline () const

QDateTime :

void swap (QDateTime & other )

QHash :

const_iterator cbegin () const
const_iterator cend () const

QLinkedList :

const_iterator cbegin () const
const_iterator cend () const

QList :

const_iterator cbegin () const
const_iterator cend () const

QMap :

const_iterator cbegin () const
const_iterator cend () const

QSet :

const_iterator cbegin () const
const_iterator cend () const

QSharedPointer :

void reset ()
void reset (T * t )
void reset (T * t , Deleter deleter )

QSize :

QSize scaled (int width , int height , Qt::AspectRatioMode mode ) const
QSize scaled (const QSize & s , Qt::AspectRatioMode mode ) const
QSize transposed () const

QLatin1String :

bool operator!= (const QByteArray & other ) const
bool operator< (const QByteArray & other ) const
bool operator<= (const QByteArray & other ) const
bool operator== (const QByteArray & other ) const
bool operator> (const QByteArray & other ) const
bool operator>= (const QByteArray & other ) const

QStringList :

QStringList filter (const QRegularExpression & re ) const
int indexOf (const QRegularExpression & re , int from = 0) const
QString join (QChar separator ) const
int lastIndexOf (const QRegularExpression & re , int from = -1) const
QStringList & replaceInStrings (const QRegularExpression & re , const QString & after )

QString :

QString & append (const QChar * str , int len )
const_iterator cbegin () const
const_iterator cend () const
bool contains (const QRegularExpression & re ) const
int count (const QRegularExpression & re ) const
QString fromLatin1 (const QByteArray & str )
QString fromLocal8Bit (const QByteArray & str )
QString fromUtf8 (const QByteArray & str )
int indexOf (const QRegularExpression & re , int from = 0) const
int lastIndexOf (const QRegularExpression & re , int from = -1) const
QString & remove (const QRegularExpression & re )
QString & replace (const QRegularExpression & re , const QString & after )
QString section (const QRegularExpression & re , int start , int end = -1, SectionFlags flags = SectionDefault) const
QStringList split (const QRegularExpression & re , SplitBehavior behavior = KeepEmptyParts) const
QString toHtmlEscaped () const

QVarLengthArray :

T & back ()
const T & back () const
const_iterator cbegin () const
const_iterator cend () const
bool empty () const
T & front ()
const T & front () const
int length () const
void pop_back ()
void push_back (const T & t )

QVector :

const_iterator cbegin () const
const_iterator cend () const

QDBusUnixFileDescriptor :

void swap (QDBusUnixFileDescriptor & other )

QDrag :

QPixmap dragCursor (Qt::DropAction action ) const

QMouseEvent :

const QPointF & localPos () const
const QPointF & screenPos () const
const QPointF & windowPos () const

QGuiApplication :

bool isSavingSession () const

TouchPoint :

QVector<QPointF> rawScreenPositions () const

QPalette :

void swap (QPalette & other )

QRegion :

bool isNull () const

QFont :

void removeSubstitutions (const QString & familyName )
void swap (QFont & other )

QFontMetrics :

void swap (QFontMetrics & other )

QFontInfo :

void swap (QFontInfo & other )

QFontMetricsF :

void swap (QFontMetricsF & other )

QRawFont :

QRectF boundingRect (quint32 glyphIndex ) const
void swap (QRawFont & other )

QPlatformFontDatabase :

virtual QFont defaultFont () const
virtual bool fontsAlwaysScalable () const
virtual QString resolveFontFamilyAlias (const QString & family ) const
virtual QList<int> standardSizes () const

QGlyphRun :

QRectF boundingRect () const
GlyphRunFlags flags () const
bool isEmpty () const
bool isRightToLeft () const
void setBoundingRect (const QRectF & boundingRect )
void setFlag (GlyphRunFlag flag , bool enabled = true)
void setFlags (GlyphRunFlags flags )
void setRightToLeft (bool rightToLeft )
void swap (QGlyphRun & other )

QStaticText :

void swap (QStaticText & other )

QTextCursor :

void swap (QTextCursor & other )

QTextFormat :

void swap (QTextFormat & other )

QTextCharFormat :

QFont::SpacingType fontLetterSpacingType () const
int fontStretch () const
void setFontLetterSpacingType (QFont::SpacingType letterSpacingType )
void setFontStretch (int factor )

QTextLine :

QList<QGlyphRun> glyphRuns (int from = -1, int length = -1) const

QNetworkCacheMetaData :

void swap (QNetworkCacheMetaData & other )

QHttpPart :

void swap (QHttpPart & other )

QNetworkAccessManager :

void clearAccessCache ()

QNetworkCookie :

void normalize (const QUrl & url )
bool operator== (const QNetworkCookie & other ) const
void swap (QNetworkCookie & other )

QNetworkReply :

virtual void ignoreSslErrorsImplementation (const QList<QSslError> & errors )
virtual void setSslConfigurationImplementation (const QSslConfiguration & configuration )
virtual void sslConfigurationImplementation (QSslConfiguration & configuration ) const

QNetworkCookieJar :

virtual bool deleteCookie (const QNetworkCookie & cookie )
virtual bool insertCookie (const QNetworkCookie & cookie )
virtual bool updateCookie (const QNetworkCookie & cookie )
virtual bool validateCookie (const QNetworkCookie & cookie , const QUrl & url ) const

QNetworkRequest :

void swap (QNetworkRequest & other )

QNetworkSession :

void usagePoliciesChanged (QNetworkSession::UsagePolicies usagePolicies )

QNetworkConfiguration :

void swap (QNetworkConfiguration & other )

QHostAddress :

bool isLoopback () const

QNetworkAddressEntry :

void swap (QNetworkAddressEntry & other )

QNetworkProxyQuery :

void swap (QNetworkProxyQuery & other )

QNetworkInterface :

void swap (QNetworkInterface & other )

QAbstractSocket :

bool bind (const QHostAddress & address , quint16 port = 0, BindMode mode = DefaultForPlatform)
bool bind (quint16 port = 0, BindMode mode = DefaultForPlatform)
PauseModes pauseMode () const
virtual void resume ()
void setPauseMode (PauseModes pauseMode )

QNetworkProxy :

bool hasRawHeader (const QByteArray & headerName ) const
QVariant header (QNetworkRequest::KnownHeaders header ) const
QByteArray rawHeader (const QByteArray & headerName ) const
QList<QByteArray> rawHeaderList () const
void setHeader (QNetworkRequest::KnownHeaders header , const QVariant & value )
void setRawHeader (const QByteArray & headerName , const QByteArray & headerValue )
void swap (QNetworkProxy & other )

QLocalServer :

bool listen (qintptr socketDescriptor )
SocketOptions socketOptions () const

QTcpServer :

void acceptError (QAbstractSocket::SocketError socketError )
void pauseAccepting ()
void resumeAccepting ()

QSslCipher :

void swap (QSslCipher & other )

QSslCertificate :

QList<QSslCertificateExtension> extensions () const
QList<QByteArray> issuerInfoAttributes () const
QList<QByteArray> subjectInfoAttributes () const
void swap (QSslCertificate & other )
QString toText () const
QList<QSslError> verify (QList<QSslCertificate> certificateChain , const QString & hostName = QString())

QSslConfiguration :

void swap (QSslConfiguration & other )

QSslError :

void swap (QSslError & other )

QSslSocket :

virtual void resume ()
long sslLibraryVersionNumber ()
QString sslLibraryVersionString ()

QSslKey :

void swap (QSslKey & other )

QSignalSpy :

bool wait (int timeout = 5000)

QPrinterInfo :

QString description () const
QString location () const
QString makeAndModel () const
QPrinterInfo printerInfo (const QString & printerName )

QSqlDriver :

void notification (const QString & name , QSqlDriver::NotificationSource source , const QVariant & payload )

QSqlTableModel :

bool isDirty () const
QSqlRecord record (int row ) const
virtual bool selectRow (int row )

QColorDialog :

QColor standardColor (int index )

QTouchEventSequence :

QTouchEventSequence & move (int touchId , const QPoint & pt , QWindow * window = Q_NULLPTR)
QTouchEventSequence & press (int touchId , const QPoint & pt , QWindow * window = Q_NULLPTR)
QTouchEventSequence & release (int touchId , const QPoint & pt , QWindow * window = Q_NULLPTR)

QAbstractItemDelegate :

virtual void destroyEditor (QWidget * editor , const QModelIndex & index ) const

QHeaderView :

ResizeMode sectionResizeMode (int logicalIndex ) const
bool sectionsClickable () const
bool sectionsMovable () const
void setSectionResizeMode (ResizeMode mode )
void setSectionResizeMode (int logicalIndex , ResizeMode mode )
void setSectionsClickable (bool clickable )
void setSectionsMovable (bool movable )

QWidget :

QBackingStore * backingStore () const
QPixmap grab (const QRect & rectangle = QRect( QPoint( 0, 0 ), QSize( -1, -1 ) ))
virtual bool hasHeightForWidth () const
QWindow * windowHandle () const

QComboBox :

void currentTextChanged (const QString & text )

QTabBar :

virtual QSize minimumTabSizeHint (int index ) const

QCameraExposureControl :

virtual QVariant actualValue (ExposureParameter 参数 ) const = 0
void actualValueChanged (int 参数 )
virtual bool isParameterSupported (ExposureParameter 参数 ) const = 0
void parameterRangeChanged (int 参数 )
virtual QVariant requestedValue (ExposureParameter 参数 ) const = 0
void requestedValueChanged (int 参数 )
virtual bool setValue (ExposureParameter 参数 , const QVariant & value ) = 0
virtual QVariantList supportedParameterRange (ExposureParameter 参数 , bool * continuous ) const = 0

QCameraFeedbackControl :

virtual bool isEventFeedbackEnabled (EventType event ) const = 0
virtual bool isEventFeedbackLocked (EventType event ) const = 0
virtual void resetEventFeedback (EventType event ) = 0
virtual bool setEventFeedbackEnabled (EventType event , bool enabled ) = 0
virtual bool setEventFeedbackSound (EventType event , const QString & filePath ) = 0

QRotationReading :

void setFromEuler (qreal x , qreal y , qreal z )

QSensor :

bool isFeatureSupported (Feature feature ) const

QSensorBackend :

virtual bool isFeatureSupported (QSensor::Feature feature ) const

QDesignerFormWindowInterface :

void activateResourceFilePaths (const QStringList & paths , int * errorCount = Q_NULLPTR, QString * errorMessages = Q_NULLPTR)
QStringList activeResourceFilePaths () const
virtual QStringList checkContents () const = 0
virtual QWidget * formContainer () const = 0

QDesignerFormWindowManagerInterface :

virtual QAction * action (Action action ) const = 0
virtual QActionGroup * actionGroup (ActionGroup actionGroup ) const = 0
virtual void closeAllPreviews () = 0
virtual void showPluginDialog () = 0
virtual void showPreview () = 0

QDesignerContainerExtension :

virtual bool canAddWidget () const
virtual bool canRemove (int index ) const

QDesignerPropertySheetExtension :

virtual bool isEnabled (int index ) const

QAbstractFormBuilder :

QString errorString () const

QUiLoader :

QString errorString () const

名称空间中的新函数

void keyClick (QWindow * window , char key , Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay = -1)
void keyClick (QWindow * window , Qt::Key key , Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay = -1)
void keyEvent (KeyAction action , QWindow * window , Qt::Key key , Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay = -1)
void keyEvent (KeyAction action , QWindow * window , char ascii , Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay = -1)
void keyPress (QWindow * window , Qt::Key key , Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay = -1)
void keyPress (QWindow * window , char key , Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay = -1)
void keyRelease (QWindow * window , Qt::Key key , Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay = -1)
void keyRelease (QWindow * window , char key , Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay = -1)
void mouseClick (QWindow * window , Qt::MouseButton button , Qt::KeyboardModifiers stateKey = Qt::KeyboardModifiers(), QPoint pos = QPoint(), int delay = -1)
void mouseDClick (QWindow * window , Qt::MouseButton button , Qt::KeyboardModifiers stateKey = Qt::KeyboardModifiers(), QPoint pos = QPoint(), int delay = -1)
void mouseMove (QWindow * window , QPoint pos = QPoint(), int delay = -1)
void mousePress (QWindow * window , Qt::MouseButton button , Qt::KeyboardModifiers stateKey = Qt::KeyboardModifiers(), QPoint pos = QPoint(), int delay = -1)
void mouseRelease (QWindow * window , Qt::MouseButton button , Qt::KeyboardModifiers stateKey = Qt::KeyboardModifiers(), QPoint pos = QPoint(), int delay = -1)
bool qWaitForWindowActive (QWidget * widget , int timeout = 5000)
bool qWaitForWindowActive (QWindow * window , int timeout = 5000)
bool qWaitForWindowExposed (QWidget * widget , int timeout = 5000)
bool qWaitForWindowExposed (QWindow * window , int timeout = 5000)
QTouchEventSequence touchEvent (QWindow * window , QTouchDevice * device , bool autoCommit = true)

新全局函数

bool operator!= (const QMetaMethod & m1 , const QMetaMethod & m2 )
const QPointF operator+ (const QPointF & point )
const QPoint operator+ (const QPoint & point )
bool operator== (const QMetaMethod & m1 , const QMetaMethod & m2 )
uint qHash (const QHostAddress & key , uint seed = 0)
uint qHash (const QPair<T1, T2> & key , uint seed = 0)
uint qHash (const T * key , uint seed = 0)
uint qHash (QLatin1String key , uint seed = 0)
uint qHash (const QBitArray & key , uint seed = 0)
uint qHash (const QStringRef & key , uint seed = 0)
uint qHash (const QString & key , uint seed = 0)
uint qHash (const QByteArray & key , uint seed = 0)
uint qHash (const QChar key , uint seed = 0)
uint qHash (qint64 key , uint seed = 0)
uint qHash (quint64 key , uint seed = 0)
uint qHash (long key , uint seed = 0)
uint qHash (ulong key , uint seed = 0)
uint qHash (int key , uint seed = 0)
uint qHash (uint key , uint seed = 0)
uint qHash (short key , uint seed = 0)
uint qHash (ushort key , uint seed = 0)
uint qHash (signed char key , uint seed = 0)
uint qHash (uchar key , uint seed = 0)
uint qHash (char key , uint seed = 0)
uint qHash (const QTime & key , uint seed = 0)
uint qHash (const QDate & key , uint seed = 0)
uint qHash (const QDateTime & key , uint seed = 0)
uint qHash (const QUuid & uuid , uint seed = 0)
uint qHash (const QPersistentModelIndex & index , uint seed = 0)
uint qHash (const QUrl & url , uint seed = 0)
QtMessageHandler qInstallMessageHandler (QtMessageHandler handler )
void qRegisterStaticPluginFunction (QStaticPlugin plugin )
void qSetMessagePattern (const QString & pattern )

新宏

QFINDTESTDATA ( filename )
QTEST_GUILESS_MAIN ( TestClass )
QTRY_COMPARE ( actual , expected )
QTRY_COMPARE_WITH_TIMEOUT ( actual , expected , timeout )
QTRY_VERIFY ( 条件 )
QTRY_VERIFY_WITH_TIMEOUT ( 条件 , timeout )
void Q_ASSUME (bool expr )
Q_DECLARE_OPAQUE_POINTER ( PointerType )
Q_DECL_FINAL
Q_DECL_NOEXCEPT
Q_DECL_NOEXCEPT_EXPR ( x )
Q_DECL_NOTHROW
Q_DECL_OVERRIDE
Q_PLUGIN_METADATA ( ... )
Q_SET_OBJECT_NAME ( Object )
void Q_UNREACHABLE ()

新枚举类型

enum BindFlag { ShareAddress, DontShareAddress, ReuseAddressHint, DefaultForPlatform }
enum PauseMode { PauseNever, PauseOnSslErrors }
enum ResourceFileSaveMode { SaveAllResourceFiles, SaveOnlyUsedResourceFiles, DontSaveResourceFiles }
enum 动作 { CutAction, CopyAction, PasteAction, DeleteAction, ..., FormWindowSettingsDialogAction }
enum ActionGroup { StyledPreviewActionGroup }
enum GlyphRunFlag { Overline, Underline, StrikeOut, RightToLeft, SplitLigature }
enum SocketOption { NoOptions, UserAccessOption, GroupAccessOption, OtherAccessOption, WorldAccessOption }
enum UsagePolicy { NoPolicy, NoBackgroundTrafficPolicy }
enum Feature { Buffering, AlwaysOn, SkipDuplicates, GeoValues, ..., AxesOrientation }
enum ComponentFormattingOption { PrettyDecoded, EncodeSpaces, EncodeUnicode, EncodeDelimiters, ..., FullyDecoded }

新的 Typedef

typedef Int
typedef QImageCleanupFunction
typedef QtMessageHandler

新特性

新 QML 类型

A
AttenuationModelInverse
AttenuationModelLinear
AudioCategory
AudioEngine
AudioListener
AudioSample
C
Canvas
CanvasGradient
Context2D
G
GridMesh
P
ParentAnimation
PathAnimation
PlayVariation
S
ShaderEffectSource
Sound
SoundInstance

新 QML 特性

columnSpacing
inputMethod
rowSpacing

新 QML 方法

binding ( function )

其它 Qt 5 发行的补充