Qt 5.3 中的新类和函数

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

新名称空间

namespace QWebSocketProtocol
namespace QtAndroid

新类

A
QAndroidActivityResultReceiver
QAtomicInteger
C
QCameraInfo
QCameraInfoControl
M
QMacToolBar
QMacToolBarItem
QMarginsF
QMaskGenerator
QMediaServiceCameraInfoInterface
QMediaServiceDefaultDeviceInterface
N
QNearFieldShareManager
QNearFieldShareTarget
P
QPageLayout
QPageSize
Q
QQuickWidget
S
QSignalBlocker
W
QWebSocket
QWebSocketCorsAuthenticator
QWebSocketServer

新成员函数

QBluetoothLocalDevice :

connectedDevices () const
deviceConnected (const QBluetoothAddress & address )
deviceDisconnected (const QBluetoothAddress & address )

QMessageLogger :

critical (QMessageLogger::CategoryFunction catFunc ) const
critical (const QLoggingCategory & cat ) const
critical (QMessageLogger::CategoryFunction catFunc , const char * msg , ... ) const
critical (const QLoggingCategory & cat , const char * msg , ... ) const
debug (QMessageLogger::CategoryFunction catFunc ) const
debug (const QLoggingCategory & cat ) const
debug (QMessageLogger::CategoryFunction catFunc , const char * msg , ... ) const
debug (const QLoggingCategory & cat , const char * msg , ... ) const
warning (QMessageLogger::CategoryFunction catFunc ) const
warning (QMessageLogger::CategoryFunction catFunc , const char * msg , ... ) const
warning (const QLoggingCategory & cat , const char * msg , ... ) const

QProcess :

processId () const

QAtomicInteger :

fetchAndAndAcquire (T valueToAnd )
fetchAndAndOrdered (T valueToAnd )
fetchAndAndRelaxed (T valueToAnd )
fetchAndAndRelease (T valueToAnd )
fetchAndOrAcquire (T valueToOr )
fetchAndOrOrdered (T valueToOr )
fetchAndOrRelaxed (T valueToOr )
fetchAndOrRelease (T valueToOr )
fetchAndSubAcquire (T valueToSub )
fetchAndSubOrdered (T valueToSub )
fetchAndSubRelaxed (T valueToSub )
fetchAndSubRelease (T valueToSub )
fetchAndXorAcquire (T valueToXor )
fetchAndXorOrdered (T valueToXor )
fetchAndXorRelaxed (T valueToXor )
fetchAndXorRelease (T valueToXor )
operator T () const
operator&= (T value )
operator++ ()
operator++ ( int )
operator+= (T value )
operator-- ()
operator-- ( int )
operator-= (T value )
operator= ( T )
operator^= (T value )
operator|= (T value )

QByteArray :

fromCFData (CFDataRef data )
fromNSData (const NSData * data )
fromRawCFData (CFDataRef data )
fromRawNSData (const NSData * data )
toCFData () const
toNSData () const
toRawCFData () const
toRawNSData () const

QChar :

joiningType (uint ucs4 )
joiningType () const

QCoreApplication :

isSetuidAllowed ()
setSetuidAllowed (bool allow )

QJsonArray :

operator+ (const QJsonValue & value ) const
operator+= (const QJsonValue & value )
operator<< (const QJsonValue & value )

QRectF :

marginsAdded (const QMarginsF & margins ) const
marginsRemoved (const QMarginsF & margins ) const
operator+= (const QMarginsF & margins )
operator-= (const QMarginsF & margins )

QSharedPointer :

swap (QSharedPointer<T> & other )

QString :

contains (QLatin1String str , Qt::CaseSensitivity cs ) const
fromUcs4 (const char32_t * str , int size )
fromUtf16 (const char16_t * str , int size )

QVarLengthArray :

contains (const T & value ) const
indexOf (const T & value , int from ) const
lastIndexOf (const T & value , int from ) const

QFlag :

operator uint () const

QDBusServer :

isAnonymousAuthenticationAllowed () const
setAnonymousAuthenticationAllowed (bool value )

QMouseEvent :

flags () const
source () const

QOpenGLContext :

isOpenGLES () const
openGLModuleHandle ()
openGLModuleType ()

QOpenGLFramebufferObject :

takeTexture ()

QOpenGLFunctions :

glBindTexture (GLenum target , GLuint texture )
glBlendFunc (GLenum sfactor , GLenum dfactor )
glClear (GLbitfield mask )
glClearColor (GLclampf red , GLclampf green , GLclampf blue , GLclampf alpha )
glClearStencil (GLint s )
glColorMask (GLboolean red , GLboolean green , GLboolean blue , GLboolean alpha )
glCopyTexImage2D (GLenum target , GLint level , GLenum internalformat , GLint x , GLint y , GLsizei width , GLsizei height , GLint border )
glCopyTexSubImage2D (GLenum target , GLint level , GLint xoffset , GLint yoffset , GLint x , GLint y , GLsizei width , GLsizei height )
glCullFace (GLenum mode )
glDeleteTextures (GLsizei n , const GLuint * textures )
glDepthFunc (GLenum func )
glDepthMask (GLboolean flag )
glDisable (GLenum cap )
glDrawArrays (GLenum mode , GLint first , GLsizei count )
glDrawElements (GLenum mode , GLsizei count , GLenum type , const GLvoid * indices )
glEnable (GLenum cap )
glFinish ()
glFlush ()
glFrontFace (GLenum mode )
glGenTextures (GLsizei n , GLuint * textures )
glGetBooleanv (GLenum pname , GLboolean * params )
glGetError ()
glGetFloatv (GLenum pname , GLfloat * params )
glGetIntegerv (GLenum pname , GLint * params )
glGetString (GLenum name )
glGetTexParameterfv (GLenum target , GLenum pname , GLfloat * params )
glGetTexParameteriv (GLenum target , GLenum pname , GLint * params )
glHint (GLenum target , GLenum mode )
glIsEnabled (GLenum cap )
glIsTexture (GLuint texture )
glLineWidth (GLfloat width )
glPixelStorei (GLenum pname , GLint param )
glPolygonOffset (GLfloat factor , GLfloat units )
glReadPixels (GLint x , GLint y , GLsizei width , GLsizei height , GLenum format , GLenum type , GLvoid * pixels )
glScissor (GLint x , GLint y , GLsizei width , GLsizei height )
glStencilFunc (GLenum func , GLint ref , GLuint mask )
glStencilMask (GLuint mask )
glStencilOp (GLenum fail , GLenum zfail , GLenum zpass )
glTexImage2D (GLenum target , GLint level , GLint internalformat , GLsizei width , GLsizei height , GLint border , GLenum format , GLenum type , const GLvoid * pixels )
glTexParameterf (GLenum target , GLenum pname , GLfloat param )
glTexParameterfv (GLenum target , GLenum pname , const GLfloat * params )
glTexParameteri (GLenum target , GLenum pname , GLint param )
glTexParameteriv (GLenum target , GLenum pname , const GLint * params )
glTexSubImage2D (GLenum target , GLint level , GLint xoffset , GLint yoffset , GLsizei width , GLsizei height , GLenum format , GLenum type , const GLvoid * pixels )
glViewport (GLint x , GLint y , GLsizei width , GLsizei height )

QOpenGLShaderProgram :

create ()

QOpenGLTexture :

setCompressedData (int mipLevel , int layer , QOpenGLTexture::CubeMapFace cubeFace , int dataSize , const void * data , const QOpenGLPixelTransferOptions *const options )
setData (QOpenGLTexture::PixelFormat sourceFormat , QOpenGLTexture::PixelType sourceType , const void * data , const QOpenGLPixelTransferOptions *const options )
setData (int mipLevel , QOpenGLTexture::PixelFormat sourceFormat , QOpenGLTexture::PixelType sourceType , const void * data , const QOpenGLPixelTransferOptions *const options )
setData (int mipLevel , int layer , QOpenGLTexture::CubeMapFace cubeFace , QOpenGLTexture::PixelFormat sourceFormat , QOpenGLTexture::PixelType sourceType , const void * data , const QOpenGLPixelTransferOptions *const options )
setData (int mipLevel , int layer , QOpenGLTexture::PixelFormat sourceFormat , QOpenGLTexture::PixelType sourceType , const void * data , const QOpenGLPixelTransferOptions *const options )

QPagedPaintDevice :

pageLayout () const
setPageLayout (const QPageLayout & newPageLayout )
setPageMargins (const QMarginsF & margins )
setPageMargins (const QMarginsF & margins , QPageLayout::Unit units )
setPageOrientation (QPageLayout::Orientation orientation )
setPageSize (const QPageSize & pageSize )

QPdfWriter :

pageLayout () const
resolution () const
setPageLayout (const QPageLayout & newPageLayout )
setPageMargins (const QMarginsF & margins )
setPageMargins (const QMarginsF & margins , QPageLayout::Unit units )
setPageOrientation (QPageLayout::Orientation orientation )
setPageSize (const QPageSize & pageSize )
setResolution (int resolution )

QPixmap :

fromImage (QImage && image , Qt::ImageConversionFlags flags )

QSurface :

supportsOpenGL () const

QSurfaceFormat :

options () const
setOption (QSurfaceFormat::FormatOption option , bool on )
setOptions (QSurfaceFormat::FormatOptions options )
setSwapInterval (int interval )
swapInterval () const
testOption (QSurfaceFormat::FormatOption option ) const

QTextBlock :

textFormats () const

QTextCharFormat :

setFont (const QFont & font , QTextCharFormat::FontPropertiesInheritanceBehavior behavior )

QTextFormat :

isEmpty () const

QPlatformIntegration :

virtual openGLModuleType ()

QPlatformSystemTrayIcon :

virtual createMenu () const

QPlatformTheme :

virtual standardButtonText (int button ) const

QPlatformWindow :

virtual normalGeometry () const

QMediaServiceProvider :

virtual cameraOrientation (const QByteArray & device ) const
virtual cameraPosition (const QByteArray & device ) const
virtual defaultDevice (const QByteArray & serviceType ) const

QMediaServiceProviderHint :

cameraPosition () const

QSslConfiguration :

allowedNextProtocols () const
nextNegotiatedProtocol () const
nextProtocolNegotiationStatus () const
setAllowedNextProtocols (QList<QByteArray> protocols )

QNmeaPositionInfoSource :

setUserEquivalentRangeError (double uere )
userEquivalentRangeError () const

QPrinterInfo :

availablePrinterNames ()
defaultPageSize () const
defaultPrinterName ()
isRemote () const
maximumPhysicalPageSize () const
minimumPhysicalPageSize () const
state () const
supportedPageSizes () const
supportedResolutions () const
supportsCustomPageSizes () const

QPrinter :

pageLayout () const
setPageLayout (const QPageLayout & newLayout )
setPageMargins (const QMarginsF & margins , QPageLayout::Unit units )
setPageOrientation (QPageLayout::Orientation orientation )
setPageSize (const QPageSize & pageSize )

QQuickWindow :

afterAnimating ()
afterSynchronizing ()
openglContextCreated (QOpenGLContext * context )
sceneGraphAboutToStop ()
sceneGraphError (QQuickWindow::SceneGraphError error , const QString & message )

QSerialPortInfo :

serialNumber () const

QPlainTextEdit :

find (const QRegExp & exp , QTextDocument::FindFlags options )

QTextEdit :

find (const QRegExp & exp , QTextDocument::FindFlags options )

名称空间中的新函数

androidActivity ()
androidSdkVersion ()
ignoreMessage (QtMsgType type , const QRegularExpression & messagePattern )
startActivity (const QAndroidJniObject & intent , int receiverRequestCode , QAndroidActivityResultReceiver * resultReceiver )
startIntentSender (const QAndroidJniObject & intentSender , int receiverRequestCode , QAndroidActivityResultReceiver * resultReceiver )

新全局函数

operator+ (const QRectF & lhs , const QMarginsF & rhs )
operator+ (const QMarginsF & lhs , const QRectF & rhs )
operator+ (int lhs , const QMargins & rhs )
operator+ (const QMargins & margins )
operator+ (const QMargins & lhs , int rhs )
operator- (const QRectF & lhs , const QMarginsF & rhs )
operator- (const QRect & lhs , const QMargins & rhs )
operator- (const QMargins & lhs , int rhs )
qHash (const QFont & font , uint seed )
qHash (long double key , uint seed )
qHash (float key , uint seed )
qHash (double key , uint seed )
qPremultiply (QRgb rgb )
qRemovePostRoutine (QtCleanUpFunction ptr )
qUnpremultiply (QRgb rgb )

新宏

QVERIFY_EXCEPTION_THROWN ( 表达式 , exceptiontype )
qCCritical ( category , const char * message , ... )
qCDebug ( category , const char * message , ... )
qCWarning ( category , const char * message , ... )

新枚举类型

enum Position { UnspecifiedPosition, BackFace, FrontFace }
enum OpenGLModuleType { LibGL, LibGLES }
enum SceneGraphError { ContextNotAvailable }
enum FontPropertiesInheritanceBehavior { FontPropertiesSpecifiedOnly, FontPropertiesAll }
enum MouseEventFlag { MouseEventCreatedDoubleClick, MouseEventFlagMask }
enum MouseEventSource { MouseEventNotSynthesized, MouseEventSynthesizedBySystem, MouseEventSynthesizedByQt, MouseEventSynthesizedByApplication }

新的 Typedef

typedef CategoryFunction

新特性

新 QML 类型

C
Calendar
CalendarStyle
CoordinateAnimation
D
Dialog
M
Matrix4x4
MenuBarStyle
MenuStyle
W
WebSocket
WebSocketServer

新 QML 特性

currentFont
mipmap

新 QML 方法

linkAt ()
linkAt ()

其它 Qt 5 发行的补充