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 发行的补充