Qt 5.14 中的新类和函数

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

新名称空间

namespace QColorConstants

新类

C
QCalendar
QColorSpace
QColorTransform
D
QDepthRange ( Qt3DRender )
G
GraphicsPipelineState ( QSGMaterialRhiShader )
GraphicsStateInfo ( QQuickWindow )
QGeoPositionInfoSourceFactoryV2
QGregorianCalendar
H
QHttp2Configuration
J
QJalaliCalendar
QJulianCalendar
M
QMilankovicCalendar
N
QNoPicking ( Qt3DRender )
O
QOpcUaApplicationRecordDataType
QOpcUaGdsClient
QOpcUaKeyPair
QOpcUaX509CertificateSigningRequest
QOpcUaX509DistinguishedName
QOpcUaX509Extension
QOpcUaX509ExtensionBasicConstraints
QOpcUaX509ExtensionExtendedKeyUsage
QOpcUaX509ExtensionKeyUsage
QOpcUaX509ExtensionSubjectAlternativeName
Q
QQmlEngineExtensionPlugin
R
QRasterMode ( Qt3DRender )
QRecursiveMutex
QRomanCalendar
RenderState ( QSGMaterialRhiShader )
S
QSGMaterialRhiShader
QShaderImage ( Qt3DRender )
QSubtreeEnabler ( Qt3DRender )
T
QTextureDataUpdate ( Qt3DRender )
W
QWaylandIdleInhibitManagerV1
QWaylandQuickShellIntegration
QWaylandXdgOutputManagerV1
QWebEngineFindTextResult

新成员函数

QTransform :

QMatrix4x4 worldMatrix () const

QAbstractTexture :

void updateData (const Qt3DRender::QTextureDataUpdate & update )

QLowEnergyController :

QLowEnergyController * createCentral (const QBluetoothAddress & remoteDevice , const QBluetoothAddress & localDevice , QObject * parent )

QAtomicInteger :

T loadRelaxed () const
void storeRelaxed (T newValue )

QAtomicPointer :

T * loadRelaxed () const
void storeRelaxed (T * newValue )

QBasicTimer :

QBasicTimer & operator= (QBasicTimer && other )

FromBase64Result :

uint qHash (const QVarLengthArray<T, Prealloc> & key , uint seed )

QDate :

QDateTime endOfDay (const QTimeZone & zone ) const
bool setDate (int year , int month , int day , QCalendar cal )
QDateTime startOfDay (const QTimeZone & zone ) const

QJsonDocument :

const QJsonValue operator[] (QStringView key ) const

QJsonObject :

QJsonObject::const_iterator constFind (QStringView key ) const
bool contains (QStringView key ) const
QJsonObject::iterator find (QStringView key )
QJsonObject::const_iterator find (QStringView key ) const
QJsonObject::iterator insert (QStringView key , const QJsonValue & value )
QJsonObject::iterator insert (QLatin1String key , const QJsonValue & value )
QJsonValue operator[] (QStringView key ) const
QJsonValueRef operator[] (QStringView key )
void remove (QStringView key )
void remove (QLatin1String key )
QJsonValue take (QStringView key )
QJsonValue take (QLatin1String key )
QJsonValue value (QStringView key ) const

QJsonValue :

const QJsonValue operator[] (QStringView key ) const

QLineF :

QLineF::IntersectionType intersects (const QLineF & line , QPointF * intersectionPoint ) const

QList :

uint qHash (const QVarLengthArray<T, Prealloc> & key , uint seed )

QLocale :

QDate toDate (const QString & string , QLocale::FormatType format , QCalendar cal ) const
QDate toDate (const QString & string , const QString & format , QCalendar cal ) const
QDateTime toDateTime (const QString & string , QLocale::FormatType format , QCalendar cal ) const
QDateTime toDateTime (const QString & string , const QString & format , QCalendar cal ) const
QString toString (const QDate & date , QStringView format , QCalendar cal ) const
QString toString (const QDate & date , QLocale::FormatType format , QCalendar cal ) const
QString toString (const QDateTime & dateTime , QLocale::FormatType format , QCalendar cal ) const
QString toString (const QDateTime & dateTime , QStringView format , QCalendar cal ) const

QMetaProperty :

int relativePropertyIndex () const

QPoint :

QPoint transposed () const

QPointF :

QPointF transposed () const

QRegExp :

uint qHash (const QVarLengthArray<T, Prealloc> & key , uint seed )

QSharedPointer :

std::shared_ptr<X> qSharedPointerObjectCast (const std::shared_ptr<T> & src )
std::shared_ptr<X> qSharedPointerObjectCast (std::shared_ptr<T> && src )
std::shared_ptr<X> qobject_pointer_cast (const std::shared_ptr<T> & src )
std::shared_ptr<X> qobject_pointer_cast (std::shared_ptr<T> && src )

QString :

int compare (QChar ch , Qt::CaseSensitivity cs ) const
bool contains (QStringView str , Qt::CaseSensitivity cs ) const
int indexOf (QStringView str , int from , Qt::CaseSensitivity cs ) const
int lastIndexOf (QStringView str , int from , Qt::CaseSensitivity cs ) const
QStringList split (const QString & sep , Qt::SplitBehavior behavior , Qt::CaseSensitivity cs ) const
QStringList split (QChar sep , Qt::SplitBehavior behavior , Qt::CaseSensitivity cs ) const
QStringList split (const QRegExp & rx , Qt::SplitBehavior behavior ) const
QStringList split (const QRegularExpression & re , Qt::SplitBehavior behavior ) const
QVector<QStringRef> splitRef (const QString & sep , Qt::SplitBehavior behavior , Qt::CaseSensitivity cs ) const
QVector<QStringRef> splitRef (QChar sep , Qt::SplitBehavior behavior , Qt::CaseSensitivity cs ) const
QVector<QStringRef> splitRef (const QRegExp & rx , Qt::SplitBehavior behavior ) const
QVector<QStringRef> splitRef (const QRegularExpression & re , Qt::SplitBehavior behavior ) const

QStringList :

QStringList filter (QStringView str , Qt::CaseSensitivity cs ) const
QString join (QStringView separator ) const
QStringList & replaceInStrings (QStringView before , QStringView after , Qt::CaseSensitivity cs )
QStringList & replaceInStrings (const QString & before , QStringView after , Qt::CaseSensitivity cs )
QStringList & replaceInStrings (QStringView before , const QString & after , Qt::CaseSensitivity cs )

QStringMatcher :

qsizetype indexIn (QStringView str , qsizetype from ) const

QStringRef :

int compare (QChar ch , Qt::CaseSensitivity cs ) const
bool contains (QStringView str , Qt::CaseSensitivity cs ) const
int indexOf (QStringView str , int from , Qt::CaseSensitivity cs ) const
int lastIndexOf (QStringView str , int from , Qt::CaseSensitivity cs ) const
QVector<QStringRef> split (const QString & sep , Qt::SplitBehavior behavior , Qt::CaseSensitivity cs ) const
QVector<QStringRef> split (QChar sep , Qt::SplitBehavior behavior , Qt::CaseSensitivity cs ) const

QStringView :

uint qHash (const QVarLengthArray<T, Prealloc> & key , uint seed )
int toWCharArray (wchar_t * array ) const

QVarLengthArray :

uint qHash (const QVarLengthArray<T, Prealloc> & key , uint seed )

QVector :

QVector<T> & operator= (std::initializer_list<T> args )
uint qHash (const QVarLengthArray<T, Prealloc> & key , uint seed )
void swapItemsAt (int i , int j )

qfloat16 :

bool isNormal () const

QDBusObjectPath :

QVariant operator QVariant () const

QAbstractTextDocumentLayout :

QTextBlock blockWithMarkerAt (const QPointF & pos ) const

QColor :

QColor toExtendedRgb () const

QFontMetrics :

qreal fontDpi () const

QFontMetricsF :

qreal fontDpi () const

QGuiApplication :

Qt::HighDpiScaleFactorRoundingPolicy highDpiScaleFactorRoundingPolicy ()
void setHighDpiScaleFactorRoundingPolicy (Qt::HighDpiScaleFactorRoundingPolicy policy )

QImage :

void applyColorTransform (const QColorTransform & transform )
QColorSpace colorSpace () const
void convertToColorSpace (const QColorSpace & colorSpace )
QImage convertedToColorSpace (const QColorSpace & colorSpace ) const
void setColorSpace (const QColorSpace & colorSpace )

QOpenGLTexture :

void setData (int xOffset , int yOffset , int zOffset , int width , int height , int depth , QOpenGLTexture::PixelFormat sourceFormat , QOpenGLTexture::PixelType sourceType , const void * data , const QOpenGLPixelTransferOptions *const options )
void setData (int xOffset , int yOffset , int zOffset , int width , int height , int depth , int mipLevel , QOpenGLTexture::PixelFormat sourceFormat , QOpenGLTexture::PixelType sourceType , const void * data , const QOpenGLPixelTransferOptions *const options )
void setData (int xOffset , int yOffset , int zOffset , int width , int height , int depth , int mipLevel , int layer , QOpenGLTexture::PixelFormat sourceFormat , QOpenGLTexture::PixelType sourceType , const void * data , const QOpenGLPixelTransferOptions *const options )
void setData (int xOffset , int yOffset , int zOffset , int width , int height , int depth , int mipLevel , int layer , QOpenGLTexture::CubeMapFace face , QOpenGLTexture::PixelFormat sourceFormat , QOpenGLTexture::PixelType sourceType , const void * data , const QOpenGLPixelTransferOptions *const options )
void setData (int xOffset , int yOffset , int zOffset , int width , int height , int depth , int mipLevel , int layer , QOpenGLTexture::CubeMapFace face , int layerCount , QOpenGLTexture::PixelFormat sourceFormat , QOpenGLTexture::PixelType sourceType , const void * data , const QOpenGLPixelTransferOptions *const options )

QPlatformFontDatabase :

bool isFamilyPopulated (const QString & familyName )

QTextBlockFormat :

QTextBlockFormat::MarkerType marker () const
void setMarker (QTextBlockFormat::MarkerType marker )

QTextDocument :

void setMarkdown (const QString & markdown , QTextDocument::MarkdownFeatures features )
QString toMarkdown (QTextDocument::MarkdownFeatures features ) const

QTextTableCellFormat :

qreal bottomBorder () const
QBrush bottomBorderBrush () const
QTextFrameFormat::BorderStyle bottomBorderStyle () const
qreal leftBorder () const
QBrush leftBorderBrush () const
QTextFrameFormat::BorderStyle leftBorderStyle () const
qreal rightBorder () const
QBrush rightBorderBrush () const
QTextFrameFormat::BorderStyle rightBorderStyle () const
void setBorder (qreal width )
void setBorderBrush (const QBrush & brush )
void setBorderStyle (QTextFrameFormat::BorderStyle style )
void setBottomBorder (qreal width )
void setBottomBorderBrush (const QBrush & brush )
void setBottomBorderStyle (QTextFrameFormat::BorderStyle style )
void setLeftBorder (qreal width )
void setLeftBorderBrush (const QBrush & brush )
void setLeftBorderStyle (QTextFrameFormat::BorderStyle style )
void setRightBorder (qreal width )
void setRightBorderBrush (const QBrush & brush )
void setRightBorderStyle (QTextFrameFormat::BorderStyle style )
void setTopBorder (qreal width )
void setTopBorderBrush (const QBrush & brush )
void setTopBorderStyle (QTextFrameFormat::BorderStyle style )
qreal topBorder () const
QBrush topBorderBrush () const
QTextFrameFormat::BorderStyle topBorderStyle () const

QTextTableFormat :

bool borderCollapse () const
void setBorderCollapse (bool borderCollapse )

QWheelEvent :

QPointF position () const

QKnxNetIpServerInfo :

QHostAddress hostAddress () const
QNetworkInterface networkInterface () const

QMqttClient :

void connectToHostEncrypted (const QSslConfiguration & conf )

QAudioDeviceInfo :

QString realm () const

QMediaContent :

QNetworkRequest request () const

QNetworkAccessManager :

bool autoDeleteReplies () const
void setAutoDeleteReplies (bool shouldAutoDelete )

QNetworkRequest :

QHttp2Configuration http2Configuration () const
void setHttp2Configuration (const QHttp2Configuration & configuration )

QJSEngine :

bool isInterrupted () const
void setInterrupted (bool interrupted )

QQmlApplicationEngine :

void setInitialProperties (const QVariantMap & initialProperties )

QQmlComponent :

QObject * createWithInitialProperties (const QVariantMap & initialProperties , QQmlContext * context )
void setInitialProperties (QObject * component , const QVariantMap & properties )

QQmlEngine :

int qmlRegisterAnonymousType (const char * uri , int versionMajor )
int qmlRegisterSingletonInstance (const char * uri , int versionMajor , int versionMinor , const char * typeName , QObject * cppObject )
int qmlRegisterSingletonType (const char * uri , int versionMajor , int versionMinor , const char * typeName , std::function<QObject *(QQmlEngine *, QJSEngine *)> callback )

QQuickView :

void setInitialProperties (const QVariantMap & initialProperties )

QQuickWindow :

void afterRenderPassRecording ()
void beforeRenderPassRecording ()
void beginExternalCommands ()
QSGTexture * createTextureFromNativeObject (QQuickWindow::NativeObjectType type , const void * nativeObjectPtr , int nativeLayout , const QSize & size , QQuickWindow::CreateTextureOptions options ) const
void endExternalCommands ()

QSGAbstractRenderer :

void setProjectionMatrixToRect (const QRectF & rect , QSGAbstractRenderer::MatrixTransformFlags flags )

QSGRendererInterface :

bool isApiRhiBased (QSGRendererInterface::GraphicsApi api )

QSGTexture :

int comparisonKey () const
void updateRhiTexture (QRhi * rhi , QRhiResourceUpdateBatch * resourceUpdates )

QCanBusDevice :

QCanBusDevice::CanBusStatus busStatus () const
void clearError ()
bool hasBusStatus () const
void resetController ()
void setCanBusStatusGetter (std::function<CanBusStatus ()> busStatusGetter )
void setResetControllerFunction (std::function<void ()> resetter )

QModbusDevice :

QIODevice * device () const

QWaylandSurface :

bool inputRegionContains (const QPointF & position ) const

QWaylandXdgPopup :

void sendPopupDone ()

QWaylandXdgPopupV6 :

void sendPopupDone ()

QWebEngineUrlRequestInfo :

QUrl initiator () const

QWebSocketServer :

std::chrono::milliseconds handshakeTimeout () const
int handshakeTimeoutMS () const
void setHandshakeTimeout (std::chrono::milliseconds msec )

QComboBox :

void textActivated (const QString & text )
void textHighlighted (const QString & text )

QDoubleSpinBox :

void textChanged (const QString & text )

QFileDialog :

void saveFileContent (const QByteArray & fileContent , const QString & fileNameHint )

QFileSystemModel :

void setOption (QFileSystemModel::Option option , bool on )
bool testOption (QFileSystemModel::Option option ) const

QGraphicsItemAnimation :

QTransform transformAt (qreal step ) const

QGraphicsWidget :

void setContentsMargins (QMarginsF margins )
void setWindowFrameMargins (QMarginsF margins )

QSpinBox :

void textChanged (const QString & text )

QWidget :

QScreen * screen () const

名称空间中的新函数

QTextStream & bin (QTextStream & stream )
QTextStream & bom (QTextStream & stream )
QTextStream & center (QTextStream & stream )
QTextStream & dec (QTextStream & stream )
QTextStream & endl (QTextStream & stream )
QTextStream & fixed (QTextStream & stream )
QTextStream & flush (QTextStream & stream )
QTextStream & forcepoint (QTextStream & stream )
QTextStream & forcesign (QTextStream & stream )
QTextStream & hex (QTextStream & stream )
QTextStream & left (QTextStream & stream )
QTextStream & lowercasebase (QTextStream & stream )
QTextStream & lowercasedigits (QTextStream & stream )
QTextStream & noforcepoint (QTextStream & stream )
QTextStream & noforcesign (QTextStream & stream )
QTextStream & noshowbase (QTextStream & stream )
QTextStream & oct (QTextStream & stream )
QTextStream & reset (QTextStream & stream )
QTextStream & right (QTextStream & stream )
QTextStream & scientific (QTextStream & stream )
QTextStream & showbase (QTextStream & stream )
QTextStream & uppercasebase (QTextStream & stream )
QTextStream & uppercasedigits (QTextStream & stream )
QTextStream & ws (QTextStream & stream )

新全局函数

T qExchange (T & obj , U && newValue )
T qExchange (T & obj , U && newValue )
uint qHash (const QVarLengthArray<T, Prealloc> & key , uint seed )
std::shared_ptr<X> qSharedPointerObjectCast (std::shared_ptr<T> && src )
std::shared_ptr<X> qSharedPointerObjectCast (const std::shared_ptr<T> & src )
int qmlRegisterAnonymousType (const char * uri , int versionMajor )
int qmlRegisterSingletonInstance (const char * uri , int versionMajor , int versionMinor , const char * typeName , QObject * cppObject )
int qmlRegisterSingletonType (const char * uri , int versionMajor , int versionMinor , const char * typeName , std::function<QObject *(QQmlEngine *, QJSEngine *)> callback )
std::shared_ptr<X> qobject_pointer_cast (std::shared_ptr<T> && src )
std::shared_ptr<X> qobject_pointer_cast (const std::shared_ptr<T> & src )

新宏

Q_NAMESPACE_EXPORT ( EXPORT_MACRO )
Q_NAMESPACE_EXPORT ( EXPORT_MACRO )

新枚举类型

enum BlendFactor { Zero, One, SrcColor, OneMinusSrcColor, DstColor, …, OneMinusSrc1Alpha }
enum ColorMaskComponent { R, G, B, A }
enum CullMode { CullNone, CullFront, CullBack }
enum class ExclusionPolicy { None, Exclusive, ExclusiveOptional }
enum class CanBusStatus { Unknown, Good, Warning, Error, BusOff }
enum class YearRange { First, Last }
enum Option { DontWatchForChanges, DontResolveSymlinks, DontUseCustomDirectoryIcons }
enum NativeObjectType { NativeObjectTexture }
enum MatrixTransformFlag { MatrixTransformFlipY }
enum class MarkerType { NoMarker, Unchecked, Checked }
enum class HighDpiScaleFactorRoundingPolicy { Unset, Round, Ceil, Floor, RoundPreferFloor, PassThrough }
enum SplitBehaviorFlags { KeepEmptyParts, SkipEmptyParts }

新特性

新 QML 类型

B
BoundaryRule
D
DepthRange
I
IdleInhibitManagerV1
N
NoPicking
Q
QtRemoteObjects
R
RasterMode
RegularExpressionValidator
S
Scene3DView
ShaderImage
SubtreeEnabler
T
TableModel
TableModelColumn
X
XdgOutputManagerV1

新 QML 特性

autoFadeIn
autoFadeIn
autoFadeIn
autoFadeIn
autoFadeIn
buffersToClear
compositingMode
currentFrame
currentFrame
entity
frameCount
frameCount
inhibitsIdle
lens
restoreMode
transform
viewport
worldMatrix

新 QML 方法

sendPopupDone ()
sendPopupDone ()

其它 Qt 5 发行的补充