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
QWebChannel
QWebChannelAbstractTransport
QWebEnginePage
QWebEngineSettings
QWebEngineView
QWGLNativeContext
QWinMime

新成员函数

QBluetoothDeviceInfo :

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

QBluetoothTransferReply :

void error (QBluetoothTransferReply::TransferError errorType )

QBluetoothUuid :

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

QAbstractProxyModel :

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

QAbstractState :

void activeChanged (bool active )

QAbstractTransition :

void targetStateChanged ()
void targetStatesChanged ()

QByteArray :

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

QCommandLineParser :

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

QDebug :

QDebug & maybeQuote (char c )
QDebug & noquote ()
QDebug & quote ()
QDebug & resetFormat ()

QEnableSharedFromThis :

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

QHash :

uint qHashBits (const void * p , size_t len , uint seed )

QHistoryState :

void defaultStateChanged ()
void historyTypeChanged ()

QRegularExpression :

void optimize () const

QSignalTransition :

void senderObjectChanged ()
void signalChanged ()

QState :

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

QStateMachine :

void runningChanged (bool running )

QString :

QVector<QStringRef> splitRef (QChar sep , QString::SplitBehavior behavior , Qt::CaseSensitivity cs ) const

QStringList :

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

QStringRef :

QStringRef::const_iterator begin () const
QStringRef::const_iterator cbegin () const
QStringRef::const_iterator cend () const
QStringRef::const_iterator end () const

QSysInfo :

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

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 )

QUrl :

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

QVector :

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

QWeakPointer :

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

QGuiApplication :

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

QImageReader :

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

QImageWriter :

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

QOpenGLContext :

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

QOpenGLTexture :

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

QPlatformDrag :

virtual bool ownsDragObject () const

QPlatformWindow :

QPlatformScreen * screenForGeometry (const QRect & newGeometry ) const

QSurfaceFormat :

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

QAbstractVideoBuffer :

int mapPlanes (QAbstractVideoBuffer::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

QSslCertificate :

bool importPkcs12 (QIODevice * device , QSslKey * key , QSslCertificate * certificate , QList<QSslCertificate> * caCertificates , const QByteArray & passPhrase )
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

QQuickWindow :

void scheduleRenderJob (QRunnable * job , QQuickWindow::RenderStage stage )

QSGSimpleTextureNode :

bool ownsTexture () const
void setOwnsTexture (bool owns )

QGraphicsSceneMouseEvent :

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

QWinThumbnailToolBar :

void iconicLivePreviewPixmapRequested ()
void iconicThumbnailPixmapRequested ()

QX11Info :

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

QXmlSchema :

QXmlSchema & operator= (const QXmlSchema & other )

名称空间中的新函数

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

新全局函数

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

新宏

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

新枚举类型

enum CoreConfiguration { UnknownCoreConfiguration, LowEnergyCoreConfiguration, BaseRateCoreConfiguration, BaseRateAndLowEnergyCoreConfiguration }
enum CharacteristicType { DeviceName, Appearance, PeripheralPrivacyFlag, ReconnectionAddress, PeripheralPreferredConnectionParameters, …, BarometricPressureTrend }
enum DescriptorType { UnknownDescriptorType, CharacteristicExtendedProperties, CharacteristicUserDescription, ClientCharacteristicConfiguration, ServerCharacteristicConfiguration, …, EnvironmentalSensingTriggerSetting }
enum DepthStencilMode { DepthMode, StencilMode }
enum RenderStage { BeforeSynchronizingStage, AfterSynchronizingStage, BeforeRenderingStage, AfterRenderingStage, AfterSwapStage, NoStage }
enum UserInputResolutionOption { DefaultResolution, AssumeLocalFile }

新类型别名

typedef QLowEnergyHandle
typedef QLowEnergyHandle
typedef const_iterator

新特性

新 QML 类型

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

新 QML 特性

active
activeFocusItem
containsPress
contentItem
deviceId
devicePixelRatio
displayName
iconicLivePreviewSource
iconicNotificationsEnabled
iconicThumbnailSource
ignored
metaData.cameraManufacturer
metaData.cameraModel
metaData.dateTimeOriginal
metaData.event
metaData.gpsAltitude
metaData.gpsImgDirection
metaData.gpsLatitude
metaData.gpsLongitude
metaData.gpsProcessingMethod
metaData.gpsSpeed
metaData.gpsTimestamp
metaData.gpsTrack
metaData.orientation
metaData.subject
orientation
orientationUpdateMask
passwordMaskDelay
position
sidebarVisible
viewfinder.maximumFrameRate
viewfinder.minimumFrameRate
viewfinder.resolution
visibility

新 QML 信号

iconicLivePreviewRequested ()
iconicThumbnailRequested ()

新 QML 方法

ensureVisible ()
findChild ()

其它 Qt 5 发行的补充