Qt 6.4 中的新类和函数

This page contains a comprehensive list of all new classes and functions introduced in Qt 6.4.

新类

A
QAbstractHttpServer
H
QHttpServer
QHttpServerRequest
QHttpServerResponder
QHttpServerResponse
QHttpServerRouter
QHttpServerRouterRule
P
QPdfLink
QPdfPageNavigator
S
QSslServer
W
QWebEngineFileSystemAccessRequest
QWebSocketHandshakeOptions

新成员函数

QAbstractItemModelTester :

(从 6.4 起) void setUseFetchMore (bool value )

QByteArray :

(从 6.4 起) QByteArray percentDecoded (char percent ) const
(从 6.4 起) void resize (qsizetype newSize , char c )

QColor :

(从 6.4 起) QColor fromString (QAnyStringView name )
(从 6.4 起) bool isValidColorName (QAnyStringView name )

QColorTransform :

(从 6.4 起) bool isIdentity () const
(从 6.4 起) QRgbaFloat16 map (QRgbaFloat16 rgbafp16 ) const
(从 6.4 起) QRgbaFloat32 map (QRgbaFloat32 rgbafp32 ) const
(从 6.4 起) bool operator!= (const QColorTransform & ct1 , const QColorTransform & ct2 )
(从 6.4 起) bool operator== (const QColorTransform & ct1 , const QColorTransform & ct2 )

QDate :

(从 6.4 起) QDate addDuration (std::chrono::days ndays ) const
(从 6.4 起) QDate fromStdSysDays (const std::chrono::sys_days & days )

QDateTime :

(从 6.4 起) QDateTime addDuration (std::chrono::milliseconds msecs ) const
(从 6.4 起) QDateTime fromStdLocalTime (const std::chrono::local_time<std::chrono::milliseconds> & time )
(从 6.4 起) QDateTime fromStdTimePoint (const std::chrono::time_point<Clock, Duration> & time )
(从 6.4 起) QDateTime fromStdTimePoint (std::chrono::time_point<std::chrono::system_clock, std::chrono::milliseconds> time )
(从 6.4 起) QDateTime fromStdTimePoint (const std::chrono::local_time<std::chrono::milliseconds> & time )
(从 6.4 起) QDateTime fromStdZonedTime (const int & time )
(从 6.4 起) QDateTime operator+ (const QDateTime & dateTime , std::chrono::milliseconds duration )
(从 6.4 起) QDateTime operator+ (std::chrono::milliseconds duration , const QDateTime & dateTime )
(从 6.4 起) QDateTime & operator+= (std::chrono::milliseconds duration )
(从 6.4 起) std::chrono::milliseconds operator- (const QDateTime & lhs , const QDateTime & rhs )
(从 6.4 起) QDateTime operator- (const QDateTime & dateTime , std::chrono::milliseconds duration )
(从 6.4 起) QDateTime & operator-= (std::chrono::milliseconds duration )
(从 6.4 起) std::chrono::sys_time<std::chrono::milliseconds> toStdSysMilliseconds () const
(从 6.4 起) std::chrono::sys_seconds toStdSysSeconds () const

QFileInfo :

(从 6.4 起) bool isAlias () const

QFormLayout :

(从 6.4 起) bool isRowVisible (int row ) const
(从 6.4 起) bool isRowVisible (QWidget * widget ) const
(从 6.4 起) bool isRowVisible (QLayout * layout ) const
(从 6.4 起) void setRowVisible (int row , bool on )
(从 6.4 起) void setRowVisible (QWidget * widget , bool on )
(从 6.4 起) void setRowVisible (QLayout * layout , bool on )

QFuture :

(从 6.4 起) QFuture<U> unwrap ()

QHash :

(从 6.4 起) auto asKeyValueRange () &
(从 6.4 起) auto asKeyValueRange () const &
(从 6.4 起) auto asKeyValueRange () &&
(从 6.4 起) auto asKeyValueRange () const &&

QImage :

(从 6.4 起) QImage colorTransformed (const QColorTransform & transform ) const &
(从 6.4 起) QImage colorTransformed (const QColorTransform & transform ) &&

QJniEnvironment :

(从 6.4 起) jfieldID findField (jclass clazz , const char * fieldName )
(从 6.4 起) jmethodID findMethod (jclass clazz , const char * methodName )
(从 6.4 起) jfieldID findStaticField (jclass clazz , const char * fieldName )
(从 6.4 起) jmethodID findStaticMethod (jclass clazz , const char * methodName )

QJniObject :

(从 6.4 起) auto callMethod (const char * methodName , const char * signature , Args &&... args ) const
(从 6.4 起) auto callMethod (const char * methodName , Args &&... args ) const
(从 6.4 起) QJniObject callObjectMethod (const char * methodName , Args &&... args ) const
(从 6.4 起) auto callStaticMethod (const char * className , const char * methodName , const char * signature , Args &&... args )
(从 6.4 起) auto callStaticMethod (jclass clazz , jmethodID methodId , Args &&... args )
(从 6.4 起) auto callStaticMethod (const char * className , const char * methodName , Args &&... args )
(从 6.4 起) auto callStaticMethod (jclass clazz , const char * methodName , Args &&... args )
(从 6.4 起) QJniObject callStaticObjectMethod (const char * className , const char * methodName , Args &&... args )
(从 6.4 起) QJniObject callStaticObjectMethod (jclass clazz , const char * methodName , Args &&... args )
(从 6.4 起) QJniObject construct (Args &&... args )

QLatin1StringView :

(从 6.4 起) const char * constBegin () const
(从 6.4 起) const char * constData () const
(从 6.4 起) const char * constEnd () const
(从 6.4 起) qsizetype count (QStringView str , Qt::CaseSensitivity cs ) const
(从 6.4 起) qsizetype count (QLatin1StringView l1 , Qt::CaseSensitivity cs ) const
(从 6.4 起) qsizetype count (QChar ch , Qt::CaseSensitivity cs ) const
(从 6.4 起) bool empty () const
(从 6.4 起) QLatin1Char first () const
(从 6.4 起) QLatin1Char last () const
(从 6.4 起) qsizetype length () const
(从 6.4 起) double toDouble (bool * ok ) const
(从 6.4 起) float toFloat (bool * ok ) const
(从 6.4 起) int toInt (bool * ok , int base ) const
(从 6.4 起) long toLong (bool * ok , int base ) const
(从 6.4 起) qlonglong toLongLong (bool * ok , int base ) const
(从 6.4 起) short toShort (bool * ok , int base ) const
(从 6.4 起) uint toUInt (bool * ok , int base ) const
(从 6.4 起) ulong toULong (bool * ok , int base ) const
(从 6.4 起) qulonglong toULongLong (bool * ok , int base ) const
(从 6.4 起) ushort toUShort (bool * ok , int base ) const

QLine :

(从 6.4 起) QLineF toLineF () const

QListWidgetItem :

(从 6.4 起) void setTextAlignment (Qt::Alignment alignment )

QMap :

(从 6.4 起) auto asKeyValueRange () &
(从 6.4 起) auto asKeyValueRange () const &
(从 6.4 起) auto asKeyValueRange () &&
(从 6.4 起) auto asKeyValueRange () const &&

QMargins :

(从 6.4 起) QMarginsF toMarginsF () const

QMqttSubscriptionProperties :

(从 6.4 起) bool noLocal () const
(从 6.4 起) void setNoLocal (bool noloc )

QMultiHash :

(从 6.4 起) auto asKeyValueRange () &
(从 6.4 起) auto asKeyValueRange () const &
(从 6.4 起) auto asKeyValueRange () &&
(从 6.4 起) auto asKeyValueRange () const &&

QMultiMap :

(从 6.4 起) auto asKeyValueRange () &
(从 6.4 起) auto asKeyValueRange () const &
(从 6.4 起) auto asKeyValueRange () &&
(从 6.4 起) auto asKeyValueRange () const &&

QMutexLocker :

(从 6.4 起) bool isLocked () const
(从 6.4 起) QMutexLocker<Mutex> & operator= (QMutexLocker<Mutex> && other )
(从 6.4 起) void swap (QMutexLocker<Mutex> & other )

QNetworkInformation :

(从 6.4 起) bool loadBackendByFeatures (QNetworkInformation::Features features )
(从 6.4 起) bool loadBackendByName (QStringView backend )

QObject :

(从 6.4 起) bool isQuickItemType () const
(从 6.4 起) void setObjectName (QAnyStringView name )

QPoint :

(从 6.4 起) QPointF toPointF () const

QPolygon :

(从 6.4 起) QPolygonF toPolygonF () const

QQmlApplicationEngine :

(从 6.4 起) void objectCreationFailed (const QUrl & url )

QQuickRenderTarget :

(从 6.4 起) QQuickRenderTarget fromD3D11Texture (void * texture , uint format , const QSize & pixelSize , int sampleCount )
(从 6.4 起) QQuickRenderTarget fromMetalTexture (MTLTexture * texture , uint format , const QSize & pixelSize , int sampleCount )
(从 6.4 起) QQuickRenderTarget fromOpenGLTexture (uint textureId , uint format , const QSize & pixelSize , int sampleCount )
(从 6.4 起) QQuickRenderTarget fromPaintDevice (QPaintDevice * device )
(从 6.4 起) QQuickRenderTarget fromVulkanImage (VkImage image , VkImageLayout layout , VkFormat format , const QSize & pixelSize , int sampleCount )
(从 6.4 起) bool mirrorVertically () const
(从 6.4 起) void setMirrorVertically (bool enable )

QRect :

(从 6.4 起) QRectF toRectF () const

QSGMaterialShader :

(从 6.4 起) int combinedImageSamplerCount (int binding ) const

QSize :

(从 6.4 起) QSizeF toSizeF () const

QStringView :

(从 6.4 起) qsizetype count (QLatin1StringView l1 , Qt::CaseSensitivity cs ) const
(从 6.4 起) int localeAwareCompare (QStringView other ) const

QTableWidgetItem :

(从 6.4 起) void setTextAlignment (Qt::Alignment alignment )

QTcpServer :

(从 6.4 起) void pendingConnectionAvailable ()

QTemporaryDir :

(从 6.4 起) QTemporaryDir & operator= (QTemporaryDir && other )
(从 6.4 起) void swap (QTemporaryDir & other )

QTextCursor :

(从 6.4 起) void insertMarkdown (const QString & markdown , QTextDocument::MarkdownFeatures features )

QTextDocumentFragment :

(从 6.4 起) QTextDocumentFragment fromMarkdown (const QString & markdown , QTextDocument::MarkdownFeatures features )
(从 6.4 起) QString toMarkdown (QTextDocument::MarkdownFeatures features ) const
(从 6.4 起) QString toRawText () const

QTextStream :

(从 6.4 起) QTextStream & operator>> (char16_t & c )

QTextToSpeech :

(从 6.4 起) bool setEngine (const QString & engine , const QVariantMap & params )

QTimeZone :

(从 6.4 起) QTimeZone fromStdTimeZonePtr (const int * timeZone )

QTreeWidgetItem :

(从 6.4 起) void setTextAlignment (int column , Qt::Alignment alignment )

QUrlQuery :

(从 6.4 起) size_t qHash (QMetaType type , size_t seed )

QVarLengthArray :

(从 6.4 起) void resize (qsizetype size , const T & v )

QVersionNumber :

(从 6.4 起) QVersionNumber fromString (QAnyStringView string , qsizetype * suffixIndex )

QVoice :

(从 6.4 起) QDataStream & operator<< (QDataStream & stream , const QVoice & voice )
(从 6.4 起) QDebug operator<< (QDebug debug , const QVoice & voice )
(从 6.4 起) QDataStream & operator>> (QDataStream & stream , QVoice & voice )
(从 6.4 起) void swap (QVoice & other )

QWebEnginePage :

(从 6.4 起) void fileSystemAccessRequested (QWebEngineFileSystemAccessRequest request )

QWebSocket :

(从 6.4 起) QWebSocketHandshakeOptions handshakeOptions () const
(从 6.4 起) void open (const QUrl & url , const QWebSocketHandshakeOptions & options )
(从 6.4 起) void open (const QNetworkRequest & request , const QWebSocketHandshakeOptions & options )
(从 6.4 起) QString subprotocol () const

QWebSocketServer :

(从 6.4 起) void setSupportedSubprotocols (const QStringList & protocols )
(从 6.4 起) QStringList supportedSubprotocols () const

名称空间中的新函数

(从 6.4 起) QLatin1StringView operator""_L1 (const char * str , size_t size )
(从 6.4 起) QLatin1Char operator""_L1 (char ch )
(从 6.4 起) QByteArray operator""_ba (const char * str , size_t size )
(从 6.4 起) QString operator""_s (const char16_t * str , size_t size )
(从 6.4 起) bool qIsPolishScheduled (const QQuickWindow * window )
(从 6.4 起) bool qWaitForPolish (const QQuickWindow * window , int timeout )
(从 6.4 起) bool qWaitForPolish (const QQuickItem * item , int timeout )

新宏

(从 6.4 起) QCOMPARE_EQ ( computed , baseline )
(从 6.4 起) QCOMPARE_GE ( computed , baseline )
(从 6.4 起) QCOMPARE_GT ( computed , baseline )
(从 6.4 起) QCOMPARE_LE ( computed , baseline )
(从 6.4 起) QCOMPARE_LT ( computed , baseline )
(从 6.4 起) QCOMPARE_NE ( computed , baseline )
(从 6.4 起) QTRY_COMPARE_EQ ( computed , baseline )
(从 6.4 起) QTRY_COMPARE_EQ_WITH_TIMEOUT ( computed , baseline , timeout )
(从 6.4 起) QTRY_COMPARE_GE ( computed , baseline )
(从 6.4 起) QTRY_COMPARE_GE_WITH_TIMEOUT ( computed , baseline , timeout )
(从 6.4 起) QTRY_COMPARE_GT ( computed , baseline )
(从 6.4 起) QTRY_COMPARE_GT_WITH_TIMEOUT ( computed , baseline , timeout )
(从 6.4 起) QTRY_COMPARE_LE ( computed , baseline )
(从 6.4 起) QTRY_COMPARE_LE_WITH_TIMEOUT ( computed , baseline , timeout )
(从 6.4 起) QTRY_COMPARE_LT ( computed , baseline )
(从 6.4 起) QTRY_COMPARE_LT_WITH_TIMEOUT ( computed , baseline , timeout )
(从 6.4 起) QTRY_COMPARE_NE ( computed , baseline )
(从 6.4 起) QTRY_COMPARE_NE_WITH_TIMEOUT ( computed , baseline , timeout )
(从 6.4 起) Q_CONSTINIT

新枚举类型

(从 6.4 起) enum PolygonMode { Fill, Line }

New Enum Values

enum value Error::InvalidResponseError
enum value Error::MissingPermissionsError
enum value Error::MissingPermissionsError
enum value Error::MissingPermissionsError
enum value Error::MissingPermissionsError
enum value Error::MissingPermissionsError
enum value Resource::RedirectPaintDevice
enum value SocketError::MissingPermissionsError

新特性

新的变量

(从 6.4 起) polygonMode
(从 6.4 起) MacOSVentura
(从 6.4 起) Windows11_21H2
(从 6.4 起) Windows11_22H2

新 QML 类型

B
BakedLightmap
BoxShape
C
CapsuleShape
CharacterController
CollisionShape
ColorDialog
ConvexMeshShape
D
DynamicRigidBody
F
FrameAnimation
H
HeightFieldGeometry
HeightFieldShape
I
InstanceModel
InstanceRepeater
L
Lightmapper
LineParticle3D
LookAtNode
P
PdfBookmarkModel
PdfPageImage
PhysicsBody
PhysicsMaterial
PhysicsNode
PhysicsWorld
PlaneShape
R
Repeller3D
S
ScaleAffector3D
SphereShape
StaticRigidBody
SystemInformation
T
TriangleMeshShape
TriggerBody

新 QML 特性

QML 类型 Model :

(从 6.4 起) castsReflections : bool

QML 类型 ReflectionProbe :

(从 6.4 起) debugView : bool

QML 类型 SceneEnvironment :

(从 6.4 起) skyBoxCubeMap : QtQuick3D::CubeMapTexture
(从 6.4 起) skyboxBlurAmount : float
(从 6.4 起) specularAAEnabled : bool

QML 类型 SpriteParticle3D :

(从 6.4 起) castsReflections : bool

QML 类型 TableView :

(从 6.4 起) animate : bool
(从 6.4 起) keyNavigationEnabled : bool
(从 6.4 起) pointerNavigationEnabled : bool
(从 6.4 起) selectionBehavior : enumeration

QML 类型 View3D :

(从 6.4 起) renderFormat : enumeration

QML 类型 WaylandSurface :

(从 6.4 起) isOpaque : bool

QML 类型 WebSocket :

(从 6.4 起) negotiatedSubprotocol : QString
(从 6.4 起) requestedSubprotocols : QStringList

QML 类型 WebSocketServer :

(从 6.4 起) supportedSubprotocols : QStringList

新 QML 方法

QML 类型 TableView :

(从 6.4 起) point cellAtIndex (QModelIndex modelIndex )
(从 6.4 起) int columnAtIndex (QModelIndex modelIndex )
(从 6.4 起) QModelIndex modelIndex (point cell )
(从 6.4 起) int rowAtIndex (QModelIndex modelIndex )

QML 类型 TreeView :

(从 6.4 起) collapseRecursively ( row )
(从 6.4 起) expandRecursively ( row , depth )
(从 6.4 起) expandToIndex (QModelIndex index )