Qt 5.6 中的新类和函数

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

新类

A
QAudioRoleControl
QAbstractPhysicalDevice ( Qt3DInput )
QAbstractLight ( Qt3DRender )
G
QGeoCodeReply
QGeoCodingManager
QGeoCodingManagerEngine
QGeoManeuver
QGeoRoute
QGeoRouteReply
QGeoRouteRequest
QGeoRouteSegment
QGeoRoutingManager
QGeoRoutingManagerEngine
QGeoServiceProvider
QGeoServiceProviderFactory
K
key_iterator ( QHash )
key_iterator ( QMap )
L
QLogicalDevice ( Qt3DInput )
M
QModbusRtuSerialMaster
O
QOpenGLExtraFunctions
QObjectPicker ( Qt3DRender )
P
QPlace
QPlaceAttribute
QPlaceCategory
QPlaceContent
QPlaceContentReply
QPlaceContentRequest
QPlaceDetailsReply
QPlaceEditorial
QPlaceIcon
QPlaceIdReply
QPlaceImage
QPlaceManager
QPlaceManagerEngine
QPlaceMatchReply
QPlaceMatchRequest
QPlaceRatings
QPlaceReply
QPlaceResult
QPlaceReview
QPlaceSearchReply
QPlaceSearchRequest
QPlaceSearchResult
QPlaceSearchSuggestionReply
QPlaceSupplier
QPlaceUser
Q
QQuickAsyncImageProvider
QQuickImageResponse
QQuickWebEngineProfile
R
QRgba64
T
QTransform ( Qt3DCore )
V
QVersionNumber
W
QWebEngineCookieStore
QWebEngineFullScreenRequest
QWebEngineUrlRequestInfo
QWebEngineUrlRequestInterceptor
QWebEngineUrlRequestJob
QWebEngineUrlSchemeHandler

新成员函数

QDBusMessage :

QDBusMessage createTargetedSignal (const QString & service , const QString & path , const QString & interface , const QString & name )

QSysInfo :

QString machineHostName ()

QDebug :

void setVerbosity (int verbosityLevel )
int verbosity () const

QDir :

QChar listSeparator ()

QProcess :

void errorOccurred (QProcess::ProcessError error )

QStorageInfo :

int blockSize () const

QTextStream :

QTextStream & operator<< (const QStringRef & string )

QTemporaryDir :

QString errorString () const

QItemSelectionRange :

void swap (QItemSelectionRange & other )

QPointer :

void swap (QPointer & other )

QHistoryState :

QAbstractTransition * defaultTransition () const
void defaultTransitionChanged ()
void setDefaultTransition (QAbstractTransition * transition )

QByteArray :

const_reverse_iterator crbegin () const
const_reverse_iterator crend () const
reverse_iterator rbegin ()
const_reverse_iterator rbegin () const
reverse_iterator rend ()
const_reverse_iterator rend () const

QCommandLineParser :

void setOptionsAfterPositionalArgumentsMode (OptionsAfterPositionalArgumentsMode parsingMode )

QHash :

key_iterator keyBegin () const
key_iterator keyEnd () const

QLinkedList :

const_reverse_iterator crbegin () const
const_reverse_iterator crend () const
reverse_iterator rbegin ()
const_reverse_iterator rbegin () const
reverse_iterator rend ()
const_reverse_iterator rend () const

QLocale :

void swap (QLocale & other )

QList :

const T & constFirst () const
const T & constLast () const
const_reverse_iterator crbegin () const
const_reverse_iterator crend () const
reverse_iterator rbegin ()
const_reverse_iterator rbegin () const
reverse_iterator rend ()
const_reverse_iterator rend () const

QMap :

QPair<const_iterator, const_iterator> equal_range (const Key & key ) const
key_iterator keyBegin () const
key_iterator keyEnd () const

QSet :

const_reverse_iterator crbegin () const
const_reverse_iterator crend () const
bool intersects (const QSet<T> & other ) const
reverse_iterator rbegin ()
const_reverse_iterator rbegin () const
reverse_iterator rend ()
const_reverse_iterator rend () const

QString :

const_reverse_iterator crbegin () const
const_reverse_iterator crend () const
reverse_iterator rbegin ()
const_reverse_iterator rbegin () const
reverse_iterator rend ()
const_reverse_iterator rend () const

QStringRef :

void truncate (int position )

QVarLengthArray :

const_reverse_iterator crbegin () const
const_reverse_iterator crend () const
reverse_iterator rbegin ()
const_reverse_iterator rbegin () const
reverse_iterator rend ()
const_reverse_iterator rend () const

QVector :

void append (T && value )
const T & constFirst () const
const T & constLast () const
const_reverse_iterator crbegin () const
const_reverse_iterator crend () const
void move (int from , int to )
void push_back (T && value )
reverse_iterator rbegin ()
const_reverse_iterator rbegin () const
reverse_iterator rend ()
const_reverse_iterator rend () const

QXmlStreamStringRef :

void swap (QXmlStreamStringRef & other )

QIcon :

bool isMask () const
void setIsMask (bool isMask )

QImage :

QColor pixelColor (int x , int y ) const
QColor pixelColor (const QPoint & position ) const
void setPixelColor (int x , int y , const QColor & color )
void setPixelColor (const QPoint & position , const QColor & color )

QImageReader :

float gamma () const
void setGamma (float gamma )

QStandardItem :

bool isAutoTristate () const
bool isUserTristate () const
void setAutoTristate (bool tristate )
void setUserTristate (bool tristate )

QGuiApplication :

bool isFallbackSessionManagementEnabled ()
void setFallbackSessionManagementEnabled (bool enabled )

QOpenGLFramebufferObject :

void addColorAttachment (const QSize & size , GLenum internalFormat = 0)
void addColorAttachment (int width , int height , GLenum internalFormat = 0)
QVector<QSize> sizes () const
GLuint takeTexture (int colorAttachmentIndex )
QVector<GLuint> textures () const
QImage toImage (bool flipped , int colorAttachmentIndex ) const

QColor :

QColor fromRgba64 (ushort r , ushort g , ushort b , ushort a = USHRT_MAX)
QColor fromRgba64 (QRgba64 rgba64 )
QRgba64 rgba64 () const
void setRgba64 (QRgba64 rgba )

QPaintDevice :

qreal devicePixelRatioF () const

QTextLayout :

void clearFormats ()
QVector<FormatRange> formats () const
void setFormats (const QVector<FormatRange> & 格式 )

QWindowsWindowFunctions :

void setHasBorderInFullScreen (QWindow * window , bool border )
const QByteArray setHasBorderInFullScreenIdentifier ()

QNetworkReply :

void redirected (const QUrl & url )

QNetworkRequest :

int maximumRedirectsAllowed () const
void setMaximumRedirectsAllowed (int maxRedirectsAllowed )

QHostAddress :

bool isMulticast () const
void swap (QHostAddress & other )

QDesktopWidget :

void primaryScreenChanged ()

QMainWindow :

void resizeDocks (const QList<QDockWidget *> & docks , const QList<int> & sizes , Qt::Orientation orientation )

QMenu :

QAction * addAction (const QString & text , const QObject * receiver , PointerToMemberFunction method , const QKeySequence & shortcut = 0)
QAction * addAction (const QString & text , Functor functor , const QKeySequence & shortcut = 0)
QAction * addAction (const QString & text , const QObject * context , Functor functor , const QKeySequence & shortcut = 0)
QAction * addAction (const QIcon & icon , const QString & text , const QObject * receiver , PointerToMemberFunction method , const QKeySequence & shortcut = 0)
QAction * addAction (const QIcon & icon , const QString & text , Functor functor , const QKeySequence & shortcut = 0)
QAction * addAction (const QIcon & icon , const QString & text , const QObject * context , Functor functor , const QKeySequence & shortcut = 0)

QToolBar :

QAction * addAction (const QString & text , const QObject * receiver , PointerToMemberFunction method )
QAction * addAction (const QString & text , Functor functor )
QAction * addAction (const QString & text , const QObject * context , Functor functor )
QAction * addAction (const QIcon & icon , const QString & text , const QObject * receiver , PointerToMemberFunction method )
QAction * addAction (const QIcon & icon , const QString & text , Functor functor )
QAction * addAction (const QIcon & icon , const QString & text , const QObject * context , Functor functor )

QBluetoothSocket :

QBluetooth::SecurityFlags preferredSecurityFlags () const
void setPreferredSecurityFlags (QBluetooth::SecurityFlags flags )

QQmlDebuggingEnabler :

bool connectToLocalDebugger (const QString & socketFileName , StartMode mode = DoNotWaitForClient)

QJSEngine :

void installExtensions (Extensions extensions , const QJSValue & object = QJSValue())

QQuickTextureFactory :

QQuickTextureFactory * textureFactoryForImage (const QImage & image )

QMediaPlayer :

void audioRoleChanged (QAudio::Role role )
QList<QAudio::Role> supportedAudioRoles () const

QWebEngineDownloadItem :

QString mimeType () const

QWebEngineProfile :

QWebEngineCookieStore * cookieStore ()
QString httpAcceptLanguage () const
void installUrlSchemeHandler (const QByteArray & scheme , QWebEngineUrlSchemeHandler * handler )
void removeAllUrlSchemeHandlers ()
void removeUrlScheme (const QByteArray & scheme )
void removeUrlSchemeHandler (QWebEngineUrlSchemeHandler * handler )
void setHttpAcceptLanguage (const QString & httpAcceptLanguage )
void setRequestInterceptor (QWebEngineUrlRequestInterceptor * interceptor )
const QWebEngineUrlSchemeHandler * urlSchemeHandler (const QByteArray & scheme ) const

QWebEnginePage :

void renderProcessTerminated (RenderProcessTerminationStatus terminationStatus , int exitCode )

QWebEngineView :

void renderProcessTerminated (QWebEnginePage::RenderProcessTerminationStatus terminationStatus , int exitCode )

QWebSocket :

void open (const QNetworkRequest & request )
QNetworkRequest request () const

新全局函数

bool operator< (const QVector<T> & lhs , const QVector<T> & rhs )
bool operator< (const QVarLengthArray<T, Prealloc1> & lhs , const QVarLengthArray<T, Prealloc2> & rhs )
bool operator< (const QList<T> & lhs , const QList<T> & rhs )
bool operator<= (const QVector<T> & lhs , const QVector<T> & rhs )
bool operator<= (const QVarLengthArray<T, Prealloc1> & lhs , const QVarLengthArray<T, Prealloc2> & rhs )
bool operator<= (const QList<T> & lhs , const QList<T> & rhs )
bool operator> (const QVector<T> & lhs , const QVector<T> & rhs )
bool operator> (const QVarLengthArray<T, Prealloc1> & lhs , const QVarLengthArray<T, Prealloc2> & rhs )
bool operator> (const QList<T> & lhs , const QList<T> & rhs )
bool operator>= (const QVector<T> & lhs , const QVector<T> & rhs )
bool operator>= (const QVarLengthArray<T, Prealloc1> & lhs , const QVarLengthArray<T, Prealloc2> & rhs )
bool operator>= (const QList<T> & lhs , const QList<T> & rhs )
uint qAlpha (QRgba64 rgba64 )
uint qBlue (QRgba64 rgba64 )
uint qCountLeadingZeroBits (quint32 v )
uint qCountTrailingZeroBits (quint64 v )
uint qCountTrailingZeroBits (quint16 v )
uint qCountTrailingZeroBits (quint8 v )
uint qCountTrailingZeroBits (quint32 v )
int qGlobalQHashSeed ()
uint qGreen (QRgba64 rgba64 )
uint qHash (QSizePolicy key , uint seed = 0)
uint qHash (const QTransform & key , uint seed = 0)
uint qHash (const QMatrix & key , uint seed = 0)
uint qHash (const QKeySequence & key , uint seed = 0)
uint qHash (const QVersionNumber & key , uint seed = 0)
uint qHash (const QVector<T> & key , uint seed = 0)
uint qHash (const QRegularExpression & key , uint seed = 0)
uint qHash (const QRegExp & key , uint seed = 0)
uint qHash (const QLocale & key , uint seed = 0)
uint qHash (const QList<T> & key , uint seed = 0)
uint qHash (const QMimeType & key , uint seed = 0)
uint qHash (const QUrlQuery & key , uint seed = 0)
QRgba64 qPremultiply (QRgba64 rgba64 )
uint qRed (QRgba64 rgba64 )
QRgba64 qRgba64 (quint64 c )
QRgba64 qRgba64 (quint16 r , quint16 g , quint16 b , quint16 a )
void qSetGlobalQHashSeed (int newSeed )
QRgba64 qUnpremultiply (QRgba64 rgba64 )

新宏

QTRY_VERIFY2 ( 条件 , message )
QTRY_VERIFY2_WITH_TIMEOUT ( 条件 , message , timeout )
QT_NO_PROCESS_COMBINED_ARGUMENT_START

新枚举类型

enum Role { UnknownRole, MusicRole, VideoRole, VoiceCommunicationRole, ..., GameRole }
enum OptionsAfterPositionalArgumentsMode { ParseAsOptions, ParseAsPositionalArguments }
enum RenderProcessTerminationStatus { NormalTerminationStatus, AbnormalTerminationStatus, CrashedTerminationStatus, KilledTerminationStatus }
enum EnterKeyType { EnterKeyDefault, EnterKeyReturn, EnterKeyDone, EnterKeyGo, ..., EnterKeyPrevious }

新的 Typedef

typedef const_reverse_iterator
typedef reverse_iterator
typedef const_reverse_iterator
typedef reverse_iterator
typedef const_reverse_iterator
typedef reverse_iterator
typedef const_reverse_iterator
typedef reverse_iterator
typedef const_reverse_iterator
typedef reverse_iterator
typedef const_reverse_iterator
typedef reverse_iterator
typedef const_reverse_iterator
typedef reverse_iterator

新特性

新 QML 类型

A
AbstractPhysicalDevice
E
EnterKey
L
Light
LogicalDevice
P
Playlist
PlaylistItem
Q
QuaternionAnimation
T
Transform

新 QML 特性

audioRole
audioRole
audioRole
bottomPadding
bottomPadding
bottomPadding
bottomPadding
bottomPadding
bottomPadding
bottomPadding
color
font.styleName
font.styleName
font.styleName
layer.textureMirroring
leftPadding
leftPadding
leftPadding
leftPadding
leftPadding
leftPadding
leftPadding
nativeText
padding
padding
padding
padding
padding
padding
padding
playlist
playlist
playlist
portableText
rightPadding
rightPadding
rightPadding
rightPadding
rightPadding
rightPadding
rightPadding
textureMirroring
topPadding
topPadding
topPadding
topPadding
topPadding
topPadding
topPadding
visibleRegion

新 QML 信号

editingFinished ()

新 QML 方法

list<int> supportedAudioRoles ()
int indexOf (url file )
list<int> supportedAudioRoles ()
void append (object item )
void clear ()
对象 get (int index )
void insert (int index , object item )
void move (int from , int to , int n = 1)
void remove (int index , int n = 1)
supportedAudioRoles ()

其它 Qt 5 发行的补充