Qt 5.5 中的新类和函数

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

新类

A
QAbstractVideoFilter
QAbstractAxisInput ( Qt3DInput )
QAxisSetting ( Qt3DInput )
AssimpImporter ( Qt3DRender )
QAbstractTexture ( Qt3DRender )
QAbstractTextureImage ( Qt3DRender )
B
QBlendEquationArguments ( Qt3DRender )
C
QCameraViewfinderSettings
QCameraViewfinderSettingsControl2
QComponent ( Qt3DCore )
QCamera ( Qt3DRender )
QCameraLens ( Qt3DRender )
QCameraSelector ( Qt3DRender )
QClipPlane ( Qt3DRender )
E
QEntity ( Qt3DCore )
F
FrameRateRange ( QCamera )
QFrameAction ( Qt3DLogic )
QFilterKey ( Qt3DRender )
QFrameGraphNode ( Qt3DRender )
G
QGraphicsApiFilter ( Qt3DRender )
I
QInputAspect ( Qt3DInput )
K
QKeyEvent ( Qt3DInput )
QKeyboardDevice ( Qt3DInput )
QKeyboardHandler ( Qt3DInput )
L
QLayer ( Qt3DRender )
QLayerFilter ( Qt3DRender )
M
QMouseDevice ( Qt3DInput )
QMouseEvent ( Qt3DInput )
QMouseHandler ( Qt3DInput )
QMaterial ( Qt3DRender )
N
QNode ( Qt3DCore )
QNoDraw ( Qt3DRender )
O
QOpenGLFunctions_4_4_Compatibility
QOpenGLFunctions_4_4_Core
QOpenGLFunctions_4_5_Compatibility
QOpenGLFunctions_4_5_Core
P
QPlatformSurfaceEvent
QPointLight ( Qt3DRender )
R
QRenderStateSet ( Qt3DRender )
S
QSslEllipticCurve
QSslPreSharedKeyAuthenticator
QSkyboxEntity ( Qt3DExtras )
QShaderData ( Qt3DRender )
QShaderProgram ( Qt3DRender )
QSpotLight ( Qt3DRender )
T
QTexture1D ( Qt3DRender )
QTexture1DArray ( Qt3DRender )
QTexture2D ( Qt3DRender )
QTexture2DArray ( Qt3DRender )
QTexture2DMultisample ( Qt3DRender )
QTexture2DMultisampleArray ( Qt3DRender )
QTexture3D ( Qt3DRender )
QTextureBuffer ( Qt3DRender )
QTextureCubeMap ( Qt3DRender )
QTextureCubeMapArray ( Qt3DRender )
QTextureImage ( Qt3DRender )
QTextureImageData ( Qt3DRender )
QTextureRectangle ( Qt3DRender )
QTextureWrapMode ( Qt3DRender )
V
QVideoFilterRunnable
W
QWebEngineDownloadItem
QWebEngineProfile
QWebEngineScript
QWebEngineScriptCollection
QWindowsWindowFunctions
QWheelEvent ( Qt3DInput )

新成员函数

QDBusConnection :

bool registerObject (const QString & path , const QString & interface , QObject * object , RegisterOptions options = ExportAdaptors)

QMessageLogger :

void info (const char * msg , ... ) const
void info (const QLoggingCategory & cat , const char * msg , ... ) const
void info (CategoryFunction catFunc , const char * msg , ... ) const
QDebug info () const
QDebug info (const QLoggingCategory & cat ) const
QDebug info (CategoryFunction catFunc ) const

QDebug :

QDebug & operator<< (char16_t t )
QDebug & operator<< (char32_t t )

QLoggingCategory :

bool isInfoEnabled () const

QTextStream :

bool readLineInto (QString * line , qint64 maxlen = 0)

QItemSelectionModel :

QAbstractItemModel * model ()
void modelChanged (QAbstractItemModel * model )
void setModel (QAbstractItemModel * model )

QJsonObject :

QJsonObject fromVariantHash (const QVariantHash & hash )
QVariantHash toVariantHash () const

QMetaMethod :

bool invokeOnGadget (void * gadget , QGenericReturnArgument returnValue , QGenericArgument val0 = QGenericArgument( Q_NULLPTR ), QGenericArgument val1 = QGenericArgument(), QGenericArgument val2 = QGenericArgument(), QGenericArgument val3 = QGenericArgument(), QGenericArgument val4 = QGenericArgument(), QGenericArgument val5 = QGenericArgument(), QGenericArgument val6 = QGenericArgument(), QGenericArgument val7 = QGenericArgument(), QGenericArgument val8 = QGenericArgument(), QGenericArgument val9 = QGenericArgument()) const
bool invokeOnGadget (void * gadget , QGenericArgument val0 = QGenericArgument( Q_NULLPTR ), QGenericArgument val1 = QGenericArgument(), QGenericArgument val2 = QGenericArgument(), QGenericArgument val3 = QGenericArgument(), QGenericArgument val4 = QGenericArgument(), QGenericArgument val5 = QGenericArgument(), QGenericArgument val6 = QGenericArgument(), QGenericArgument val7 = QGenericArgument(), QGenericArgument val8 = QGenericArgument(), QGenericArgument val9 = QGenericArgument()) const

QMetaEnum :

QMetaEnum fromType ()

QMetaProperty :

QVariant readOnGadget (const void * gadget ) const
bool resetOnGadget (void * gadget ) const
bool writeOnGadget (void * gadget , const QVariant & value ) const

QMetaType :

bool 等于 (const void * lhs , const void * rhs , int typeId , int * result )
const QMetaObject * metaObject () const
bool registerEqualsComparator ()
int type (const QByteArray & typeName )

QVariant :

QPersistentModelIndex toPersistentModelIndex () const

QAssociativeIterable :

const_iterator find (const QVariant & key ) const

QState :

QSignalTransition * addTransition (const QObject * sender , PointerToMemberFunction signal , QAbstractState * target )

QThread :

int loopLevel () const

QDateTime :

QDateTime fromCFDate (CFDateRef date )
QDateTime fromNSDate (const NSDate * date )
CFDateRef toCFDate () const
NSDate * toNSDate () const

QPair :

void swap (QPair & other )

QRegularExpression :

QRegularExpressionMatchIterator globalMatch (const QStringRef & subjectRef , int offset = 0, MatchType matchType = NormalMatch, MatchOptions matchOptions = NoMatchOption) const
QRegularExpressionMatch match (const QStringRef & subjectRef , int offset = 0, MatchType matchType = NormalMatch, MatchOptions matchOptions = NoMatchOption) const

QString :

QString asprintf (const char * cformat , ... )
QString fromStdU16String (const std::u16string & str )
QString fromStdU32String (const std::u32string & str )
int indexOf (const QRegularExpression & re , int from , QRegularExpressionMatch * rmatch ) const
QString & insert (int position , const QStringRef & str )
QString & insert (int position , const char * str )
QString & insert (int position , const QByteArray & str )
int lastIndexOf (const QRegularExpression & re , int from , QRegularExpressionMatch * rmatch ) const
QString & prepend (const QChar * str , int len )
QString & prepend (const QStringRef & str )
std::u16string toStdU16String () const
std::u32string toStdU32String () const
QString vasprintf (const char * cformat , va_list ap )

QTimeZone :

QTimeZone systemTimeZone ()
QTimeZone utc ()

QVarLengthArray :

QVarLengthArray<T, Prealloc> & operator= (std::initializer_list<T> list )

QVector :

void append (const QVector<T> & value )

QImageReader :

bool autoTransform () const
void setAutoTransform (bool enabled )
QImageIOHandler::Transformations transformation () const

QImageWriter :

bool optimizedWrite () const
bool progressiveScanWrite () const
void setOptimizedWrite (bool optimize )
void setProgressiveScanWrite (bool progressive )
void setTransformation (QImageIOHandler::Transformations transform )
QImageIOHandler::Transformations transformation () const

QWheelEvent :

Qt::MouseEventSource source () const

QOpenGLContext :

QOpenGLContext * globalShareContext ()
bool supportsThreadedOpenGL ()

QPlatformIntegration :

virtual void destroy ()
virtual void setApplicationIcon (const QIcon & icon ) const

QWindow :

void requestUpdate ()

QMatrix4x4 :

bool isAffine () const

QVector3D :

QVector3D & operator/= (const QVector3D & vector )
QVector3D project (const QMatrix4x4 & modelView , const QMatrix4x4 & projection , const QRect & viewport ) const
QVector3D unproject (const QMatrix4x4 & modelView , const QMatrix4x4 & projection , const QRect & viewport ) const

QVector2D :

QVector2D & operator/= (const QVector2D & vector )

QQuaternion :

QQuaternion conjugated () const
float dotProduct (const QQuaternion & q1 , const QQuaternion & q2 )
QQuaternion fromAxes (const QVector3D & xAxis , const QVector3D & yAxis , const QVector3D & zAxis )
QQuaternion fromDirection (const QVector3D & direction , const QVector3D & up )
QQuaternion fromEulerAngles (const QVector3D & eulerAngles )
QQuaternion fromEulerAngles (float pitch , float yaw , float roll )
QQuaternion fromRotationMatrix (const QMatrix3x3 & rot3x3 )
void getAxes (QVector3D * xAxis , QVector3D * yAxis , QVector3D * zAxis ) const
void getAxisAndAngle (QVector3D * axis , float * angle ) const
void getAxisAndAngle (float * x , float * y , float * z , float * angle ) const
void getEulerAngles (float * pitch , float * yaw , float * roll ) const
QQuaternion inverted () const
QQuaternion rotationTo (const QVector3D & from , const QVector3D & to )
QVector3D toEulerAngles () const
QMatrix3x3 toRotationMatrix () const

QVector4D :

QVector4D & operator/= (const QVector4D & vector )

QOpenGLTexture :

void allocateStorage (PixelFormat pixelFormat , PixelType pixelType )
ComparisonFunction comparisonFunction () const
ComparisonMode comparisonMode () const
void setComparisonMode (ComparisonMode mode )

QFontDatabase :

bool isPrivateFamily (const QString & family ) const

QPlatformFontDatabase :

QFont::Weight weightFromInteger (int weight )

QTextDocument :

QTextCursor find (const QRegularExpression & expr , int from = 0, FindFlags options = FindFlags()) const
QTextCursor find (const QRegularExpression & expr , const QTextCursor & cursor , FindFlags options = FindFlags()) const

QNetworkAccessManager :

void preSharedKeyAuthenticationRequired (QNetworkReply * reply , QSslPreSharedKeyAuthenticator * authenticator )

QNetworkReply :

void preSharedKeyAuthenticationRequired (QSslPreSharedKeyAuthenticator * authenticator )

QHostAddress :

void setAddress (const quint8 * ip6Addr )

QSslConfiguration :

QVector<QSslEllipticCurve> ellipticCurves () const
void setEllipticCurves (const QVector<QSslEllipticCurve> & curves )
QList<QSslCipher> supportedCiphers ()
QVector<QSslEllipticCurve> supportedEllipticCurves ()
QList<QSslCertificate> systemCaCertificates ()

QSslSocket :

void preSharedKeyAuthenticationRequired (QSslPreSharedKeyAuthenticator * authenticator )

QGraphicsScene :

void setSelectionArea (const QPainterPath & path , Qt::ItemSelectionOperation selectionOperation , Qt::ItemSelectionMode mode = Qt::IntersectsItemShape, const QTransform & deviceTransform = QTransform())

QOpenGLWidget :

void setUpdateBehavior (UpdateBehavior updateBehavior )
UpdateBehavior updateBehavior () const

QSpacerItem :

QSizePolicy sizePolicy () const

QAbstractScrollArea :

QMargins viewportMargins () const

QFrame :

void initStyleOption (QStyleOptionFrame * option ) const

QPlainTextEdit :

QMenu * createStandardContextMenu (const QPoint & position )

QBluetoothDeviceInfo :

QBluetoothUuid deviceUuid () const
void setDeviceUuid (const QBluetoothUuid & uuid )

QBluetoothHostInfo :

bool operator!= (const QBluetoothHostInfo & other ) const
bool operator== (const QBluetoothHostInfo & other ) const

QLowEnergyController :

QString remoteName () const

QLowEnergyService :

void characteristicRead (const QLowEnergyCharacteristic & characteristic , const QByteArray & value )
void descriptorRead (const QLowEnergyDescriptor & descriptor , const QByteArray & value )
void readCharacteristic (const QLowEnergyCharacteristic & characteristic )
void readDescriptor (const QLowEnergyDescriptor & descriptor )

QSGSimpleTextureNode :

void setSourceRect (const QRectF & r )
void setSourceRect (qreal x , qreal y , qreal w , qreal h )
QRectF sourceRect () const

QQuickWidget :

QQuickWindow * quickWindow () const

QGeoCircle :

QString toString () const

QGeoRectangle :

QString toString () const

QGeoShape :

QGeoCoordinate center () const
QString toString () const

QCamera :

void setViewfinderSettings (const QCameraViewfinderSettings & settings )
QList<FrameRateRange> supportedViewfinderFrameRateRanges (const QCameraViewfinderSettings & settings = QCameraViewfinderSettings()) const
QList<QVideoFrame::PixelFormat> supportedViewfinderPixelFormats (const QCameraViewfinderSettings & settings = QCameraViewfinderSettings()) const
QList<QSize> supportedViewfinderResolutions (const QCameraViewfinderSettings & settings = QCameraViewfinderSettings()) const
QList<QCameraViewfinderSettings> supportedViewfinderSettings (const QCameraViewfinderSettings & settings = QCameraViewfinderSettings()) const
QCameraViewfinderSettings viewfinderSettings () const

QCameraImageProcessing :

ColorFilter colorFilter () const
bool isColorFilterSupported (ColorFilter filter ) const
void setColorFilter (ColorFilter filter )

QWebEngineProfile :

void downloadRequested (QWebEngineDownloadItem * download )

QWebEnginePage :

virtual bool acceptNavigationRequest (const QUrl & url , NavigationType type , bool isMainFrame )
QWebEngineProfile * profile () const
void setWebChannel (QWebChannel * channel )
QWebChannel * webChannel () const

名称空间中的新函数

char * toString (QSizePolicy sp )
char * toString (QSizePolicy::ControlType ct )
char * toString (QSizePolicy::ControlTypes cts )
char * toString (QSizePolicy::Policy p )

新全局函数

bool operator!= (const QSslPreSharedKeyAuthenticator & lhs , const QSslPreSharedKeyAuthenticator & rhs )
bool operator!= (QSslEllipticCurve lhs , QSslEllipticCurve rhs )
bool operator!= (const QCameraViewfinderSettings & lhs , const QCameraViewfinderSettings & rhs )
QVector3D operator* (const QQuaternion & quaternion , const QVector3D & vec )
const QVector4D operator/ (const QVector4D & vector , const QVector4D & divisor )
const QVector3D operator/ (const QVector3D & vector , const QVector3D & divisor )
const QVector2D operator/ (const QVector2D & vector , const QVector2D & divisor )
QDebug operator<< (QDebug debug , QSslEllipticCurve curve )
bool operator<= (const QUuid & lhs , const QUuid & rhs )
bool operator== (QSslEllipticCurve lhs , QSslEllipticCurve rhs )
bool operator>= (const QUuid & lhs , const QUuid & rhs )
int qEnvironmentVariableIntValue (const char * varName , bool * ok = Q_NULLPTR)
uint qHash (QSslEllipticCurve curve , uint seed = 0)
uint qHash (const QSet<T> & key , uint seed = 0)
uint qHashRange (InputIterator first , InputIterator last , uint seed = 0)
uint qHashRangeCommutative (InputIterator first , InputIterator last , uint seed = 0)
QPixelFormat qPixelFormatAlpha (uchar channelSize , QPixelFormat::TypeInterpretation typeInterpretation = QPixelFormat::UnsignedInteger)
QJSEngine * qjsEngine (const QObject * object )
void swap (QPair<T1, T2> & lhs , QPair<T1, T2> & rhs )

新宏

Q_ENUM ( ... )
Q_FLAG ( ... )
qCInfo ( category , const char * message , ... )
qCInfo ( category )
qInfo (const char * message , ... )

新枚举类型

enum ColorFilter { ColorFilterNone, ColorFilterGrayscale, ColorFilterNegative, ColorFilterSolarize, ..., ColorFilterVendor }
enum Transformation { TransformationNone, TransformationMirror, TransformationFlip, TransformationRotate180, ..., TransformationRotate270 }
enum ComparisonFunction { CompareLessEqual, CompareGreaterEqual, CompareLess, CompareGreater, ..., CompareNever }
enum ComparisonMode { CompareRefToTexture, CompareNone }
enum UpdateBehavior { NoPartialUpdate, PartialUpdate }
enum TabFocusBehavior { NoTabFocus, TabFocusTextControls, TabFocusListControls, TabFocusAllControls }

新特性

新 QML 类型

A
AbstractAxisInput
AbstractTextureImage
AxisSetting
B
BlendEquation
BlendEquationArguments
C
Camera
CameraLens
CameraSelector
CircularGauge
CircularGaugeStyle
ClipPlane
Component3D
D
DelayButton
DelayButtonStyle
Dial
DialStyle
E
Entity
EntityLoader
F
FilterKey
FrameAction
FrameGraphNode
G
Gauge
GaugeStyle
GraphicsApiFilter
I
ItemSelectionModel
K
KeyEvent
KeyboardDevice
KeyboardHandler
L
LayerFilter
M
Material
MouseDevice
MouseEvent
MouseHandler
N
NoDraw
Node
NodeInstantiator
P
PieMenu
PieMenuStyle
PointLight
R
RenderStateSet
S
ShaderProgram
Shortcut
SpotLight
StatusIndicator
StatusIndicatorStyle
T
TextureImage
ToggleButton
ToggleButtonStyle
TreeView
TreeViewStyle
Tumbler
TumblerColumn
TumblerStyle
W
WheelEvent

新 QML 特性

autoTransform
colorFilter
direction
height
polling
scrollGestureEnabled
shortcuts
styleHints
width

新 QML 信号

tagFound ()
tagRemoved ()
smartZoom ()

新 QML 方法

list<object> supportedViewfinderFrameRateRanges (size resolution = undefined)
list<size> supportedViewfinderResolutions (real minimumFrameRate = undefined, real maximumFrameRate = undefined)
string getDataAsArrayBuffer (string format )
color hsva (real hue , real saturation , real value , real alpha )
geocircle shapeToCircle (geoshape shape ) const
georectangle shapeToRectangle (geoshape shape ) const

其它 Qt 5 发行的补充