Qt 5.4 的新类和新函数

此页面包含 Qt 5.4 引入的所有新类和函数的综合列表。在此页面底部可以找到之前 Qt 5 发行的新 API 链接。

新类

A
QAbstractPlanarVideoBuffer
B
QByteArrayList
C
QCocoaNativeContext
D
QDistanceFilter
QDistanceReading
QDistanceSensor
E
QEGLNativeContext
QEnableSharedFromThis
G
QGLXNativeContext
L
QLowEnergyCharacteristic
QLowEnergyController
QLowEnergyDescriptor
QLowEnergyService
O
QOpenGLWidget
QOpenGLWindow
P
QPaintDeviceWindow
QPixelFormat
Q
QQuickRenderControl
R
QRasterWindow
S
QSGAbstractRenderer
QSGEngine
QStorageInfo
W
QWGLNativeContext
QWebChannel
QWebChannelAbstractTransport
QWebEngineCertificateError
QWebEngineHistory
QWebEngineHistoryItem
QWebEnginePage
QWebEngineSettings
QWebEngineView
QWinMime

新成员函数

类 QSysInfo :

QString buildAbi ()
QString buildCpuArchitecture ()
QString currentCpuArchitecture ()
QString kernelType ()
QString kernelVersion ()
QString prettyProductName ()
QString productType ()
QString productVersion ()

类 QDebug :

QDebug & maybeQuote (char c = '"')
QDebug & noquote ()
QDebug & quote ()
QDebug & resetFormat ()

类 QUrl :

QUrl fromUserInput (const QString & userInput , const QString & workingDirectory , UserInputResolutionOptions options = DefaultResolution)

类 QAbstractProxyModel :

virtual bool canDropMimeData (const QMimeData * data , Qt::DropAction action , int row , int column , const QModelIndex & parent ) const
virtual bool dropMimeData (const QMimeData * data , Qt::DropAction action , int row , int column , const QModelIndex & parent )

类 QTimer :

void singleShot (int msec , const QObject * receiver , PointerToMemberFunction method )
void singleShot (int msec , Qt::TimerType timerType , const QObject * receiver , PointerToMemberFunction method )
void singleShot (int msec , Functor functor )
void singleShot (int msec , Qt::TimerType timerType , Functor functor )
void singleShot (int msec , const QObject * context , Functor functor )
void singleShot (int msec , Qt::TimerType timerType , const QObject * context , Functor functor )

类 QAbstractTransition :

void targetStateChanged ()
void targetStatesChanged ()

类 QAbstractState :

void activeChanged (bool active )

类 QHistoryState :

void defaultStateChanged ()
void historyTypeChanged ()

类 QSignalTransition :

void senderObjectChanged ()
void signalChanged ()

类 QState :

void childModeChanged ()
void errorStateChanged ()
void initialStateChanged ()

类 QStateMachine :

void runningChanged (bool running )

类 QByteArray :

QByteArray fromStdString (const std::string & str )
std::string toStdString () const

类 QCommandLineParser :

bool addOptions (const QList<QCommandLineOption> & options )
void showVersion ()

类 QRegularExpression :

void optimize () const

类 QWeakPointer :

QSharedPointer<T> lock () const
void swap (QWeakPointer<T> & other )

类 QEnableSharedFromThis :

QSharedPointer<T> sharedFromThis ()
QSharedPointer<const T> sharedFromThis () const

类 QStringList :

QStringList & operator<< (const QList<QString> & other )
QStringList & operator= (const QList<QString> & other )
QStringList & operator= (QList<QString> && other )

类 QString :

QVector<QStringRef> splitRef (const QString & sep , SplitBehavior behavior = KeepEmptyParts, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
QVector<QStringRef> splitRef (QChar sep , SplitBehavior behavior = KeepEmptyParts, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
QVector<QStringRef> splitRef (const QRegExp & rx , SplitBehavior behavior = KeepEmptyParts) const
QVector<QStringRef> splitRef (const QRegularExpression & re , SplitBehavior behavior = KeepEmptyParts) const

类 QStringRef :

const_iterator begin () const
const_iterator cbegin () const
const_iterator cend () const
const_iterator end () const
QVector<QStringRef> split (const QString & sep , QString::SplitBehavior behavior = QString::KeepEmptyParts, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
QVector<QStringRef> split (QChar sep , QString::SplitBehavior behavior = QString::KeepEmptyParts, Qt::CaseSensitivity cs = Qt::CaseSensitive) const

类 QVector :

int removeAll (const T & t )
bool removeOne (const T & t )

类 QImageReader :

QByteArray subType () const
QList<QByteArray> supportedSubTypes () const

类 QImageWriter :

void setSubType (const QByteArray & type )
QByteArray subType () const
QList<QByteArray> supportedSubTypes () const

类 QGuiApplication :

void paletteChanged (const QPalette & palette )
void screenRemoved (QScreen * screen )

类 QOpenGLContext :

QVariant nativeHandle () const
void setNativeHandle (const QVariant & handle )

类 QPlatformDrag :

virtual bool ownsDragObject () const

类 QPlatformWindow :

QPlatformScreen * screenForGeometry (const QRect & newGeometry ) const

类 QSurfaceFormat :

QSurfaceFormat defaultFormat ()
void setDefaultFormat (const QSurfaceFormat & format )

类 QOpenGLTexture :

DepthStencilMode depthStencilMode () const
void setDepthStencilMode (DepthStencilMode mode )
Target target () const

类 QSslCertificate :

bool importPkcs12 (QIODevice * device , QSslKey * key , QSslCertificate * certificate , QList<QSslCertificate> * caCertificates = Q_NULLPTR, const QByteArray & passPhrase = QByteArray())
bool isSelfSigned () const

类 QSslConfiguration :

QSsl::SslProtocol sessionProtocol () const

类 QSslSocket :

QSsl::SslProtocol sessionProtocol () const
long sslLibraryBuildVersionNumber ()
QString sslLibraryBuildVersionString ()

类 QPrinterInfo :

QPrinter::DuplexMode defaultDuplexMode () const
QList<QPrinter::DuplexMode> supportedDuplexModes () const

类 QGraphicsSceneMouseEvent :

Qt::MouseEventFlags flags () const
Qt::MouseEventSource source () const

类 QBluetoothDeviceInfo :

QBluetoothDeviceInfo::CoreConfigurations coreConfigurations () const
void setCoreConfigurations (QBluetoothDeviceInfo::CoreConfigurations coreConfigs )

类 QBluetoothTransferReply :

void error (QBluetoothTransferReply::TransferError errorType )

类 QBluetoothUuid :

QString characteristicToString (CharacteristicType uuid )
QString descriptorToString (DescriptorType uuid )
QString protocolToString (ProtocolUuid uuid )

类 QQuickWindow :

void scheduleRenderJob (QRunnable * job , RenderStage stage )

类 QSGSimpleTextureNode :

bool ownsTexture () const
void setOwnsTexture (bool owns )

类 QAbstractVideoBuffer :

int mapPlanes (MapMode mode , int * numBytes , int[4] bytesPerLine , uchar *[4] data )

类 QVideoFrame :

uchar * bits (int plane )
const uchar * bits (int plane ) const
int bytesPerLine (int plane ) const
int planeCount () const

类 QX11Info :

QByteArray nextStartupId ()
void setNextStartupId (const QByteArray & id )

类 QWinThumbnailToolBar :

void iconicLivePreviewPixmapRequested ()
void iconicThumbnailPixmapRequested ()

类 QXmlSchema :

QXmlSchema & operator= (const QXmlSchema & other )

名称空间中的新函数

QFuture<T> run (QThreadPool * pool , Function function , ... )

新全局函数

QString qFormatLogMessage (QtMsgType type , const QMessageLogContext & context , const QString & str )
uint qHash (const QSslError & key , uint seed = 0)
uint qHash (const QSslCertificate & key , uint seed = 0)
uint qHashBits (const void * p , size_t len , uint seed = 0)
quint64 qNextPowerOfTwo (qint64 value )
quint32 qNextPowerOfTwo (qint32 value )
quint64 qNextPowerOfTwo (quint64 value )
quint32 qNextPowerOfTwo (quint32 value )

新宏

Q_LOGGING_CATEGORY ( name , string , msgType )
const char * qUtf8Printable (const QString & str )

新枚举类型

enum CoreConfiguration { UnknownCoreConfiguration, BaseRateCoreConfiguration, BaseRateAndLowEnergyCoreConfiguration, LowEnergyCoreConfiguration }
enum CharacteristicType { AerobicHeartRateLowerLimit, AerobicHeartRateUpperLimit, AerobicThreshold, Age, ..., WindChill }
enum DescriptorType { CharacteristicExtendedProperties, CharacteristicUserDescription, ClientCharacteristicConfiguration, ServerCharacteristicConfiguration, ..., UnknownDescriptorType }
enum DepthStencilMode { DepthMode, StencilMode }
enum RenderStage { BeforeSynchronizingStage, AfterSynchronizingStage, BeforeRenderingStage, AfterRenderingStage, AfterSwapStage, NoStage }
enum UserInputResolutionOption { DefaultResolution, AssumeLocalFile }

新的 Typedef

typedef QLowEnergyHandle
typedef const_iterator

新特性

新 QML 类型

A
ApplicationWindowStyle
F
FinalState
FontMetrics
H
HistoryState
O
OpenGLInfo
Q
QAbstractState
QAbstractTransition
QSignalTransition
S
SignalTransition
State
StateMachine
T
TextMetrics
TimeoutTransition
W
WebChannel

新 QML 特性

active
activeFocusItem
containsPress
contentItem
devicePixelRatio
iconicLivePreviewSource
iconicNotificationsEnabled
iconicThumbnailSource
ignored
orientationUpdateMask
passwordMaskDelay
sidebarVisible
visibility

新 QML 信号

iconicLivePreviewRequested ()
iconicThumbnailRequested ()

新 QML 方法

QtObject findChild ( parent , objectName )
ensureVisible (int position )

其它 Qt 5 发行的补充