Qt 6.5 中的新类和函数

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

新名称空间

(从 6.5 起) namespace QtCanBus
(从 6.5 起) namespace QtProtobuf

新类

A
QAbstractGrpcChannel
QAbstractGrpcClient
QAbstractProtobufSerializer
QAccessibleSelectionInterface
B
QBluetoothPermission
C
QCalendarPermission
QCameraPermission
QCanDbcFileParser
QCanFrameProcessor
QCanMessageDescription
QCanSignalDescription
QCanUniqueIdDescription
QContactsPermission
G
QGrpcCallReply
QGrpcHttp2Channel
QGrpcOperation
QGrpcStatus
H
QHttp1Configuration
L
QLatin1StringMatcher
QLocationPermission
M
MultiplexValueRange ( QCanSignalDescription )
QMicrophonePermission
P
ParseResult ( QDomDocument )
ParseResult ( QCanFrameProcessor )
QPermission
QProtobufMessage
QProtobufMessageDeleter
QProtobufSerializer
Q
QQuickAttachedPropertyPropagator
S
QScreenCapture
U
QUtiMimeConverter
W
QWaylandApplication ( QNativeInterface )

新成员函数

QAbstractOAuth2 :

(从 6.5 起) void setSslConfiguration (const QSslConfiguration & configuration )
(从 6.5 起) QSslConfiguration sslConfiguration () const
(从 6.5 起) void sslConfigurationChanged (const QSslConfiguration & configuration )

QAccessibleInterface :

(从 6.5 起) QAccessibleSelectionInterface * selectionInterface ()

QAnyStringView :

(从 6.5 起) void chop (qsizetype n )
(从 6.5 起) QAnyStringView chopped (qsizetype n ) const
(从 6.5 起) QAnyStringView first (qsizetype n ) const
(从 6.5 起) QAnyStringView last (qsizetype n ) const
(从 6.5 起) QAnyStringView sliced (qsizetype pos ) const
(从 6.5 起) QAnyStringView sliced (qsizetype pos , qsizetype n ) const
(从 6.5 起) void truncate (qsizetype n )

QBasicTimer :

(从 6.5 起) void start (std::chrono::milliseconds duration , QObject * object )
(从 6.5 起) void start (std::chrono::milliseconds duration , Qt::TimerType timerType , QObject * obj )

QByteArray :

(从 6.5 起) QByteArray::iterator erase (QByteArray::const_iterator it )
(从 6.5 起) QByteArray fromEcmaUint8Array (emscripten::val uint8array )
(从 6.5 起) QByteArray & removeAt (qsizetype pos )
(从 6.5 起) QByteArray & removeFirst ()
(从 6.5 起) QByteArray & removeLast ()
(从 6.5 起) emscripten::val toEcmaUint8Array ()

QCoreApplication :

(从 6.5 起) Qt::PermissionStatus checkPermission (const QPermission & permission )
(从 6.5 起) void requestPermission (const QPermission & permission , Functor && functor )
(从 6.5 起) void requestPermission (const QPermission & permission , const QObject * context , Functor functor )

QCryptographicHash :

(从 6.5 起) QCryptographicHash::Algorithm algorithm () const
(从 6.5 起) QCryptographicHash & operator= (QCryptographicHash && other )
(从 6.5 起) bool supportsAlgorithm (QCryptographicHash::Algorithm method )
(从 6.5 起) void swap (QCryptographicHash & other )

QDate :

(从 6.5 起) QDateTime endOfDay () const
(从 6.5 起) QDateTime startOfDay () const

QDateTime :

(从 6.5 起) QDateTime currentDateTime (const QTimeZone & zone )
(从 6.5 起) QDateTime fromMSecsSinceEpoch (qint64 msecs )
(从 6.5 起) QDateTime fromSecsSinceEpoch (qint64 secs )
(从 6.5 起) QTimeZone timeRepresentation () const

QDebug :

(从 6.5 起) QDebug & operator<< (const std::basic_string<Char, Args...> & s )
(从 6.5 起) QDebug & operator<< (std::basic_string_view<Char, Args...> s )

QDomDocument :

(从 6.5 起) QDomDocument::ParseResult setContent (const QByteArray & data , QDomDocument::ParseOptions options )
(从 6.5 起) QDomDocument::ParseResult setContent (QAnyStringView data , QDomDocument::ParseOptions options )
(从 6.5 起) QDomDocument::ParseResult setContent (QIODevice * device , QDomDocument::ParseOptions options )
(从 6.5 起) QDomDocument::ParseResult setContent (QXmlStreamReader * reader , QDomDocument::ParseOptions options )

QGlyphRun :

(从 6.5 起) void setSourceString (const QString & sourceString )
(从 6.5 起) void setStringIndexes (const QList<qsizetype> & stringIndexes )
(从 6.5 起) QString sourceString () const
(从 6.5 起) QList<qsizetype> stringIndexes () const

QGuiApplication :

(从 6.5 起) void setBadgeNumber (qint64 number )

QHttp1Configuration :

(从 6.5 起) bool operator!= (const QHttp1Configuration & lhs , const QHttp1Configuration & rhs )
(从 6.5 起) bool operator== (const QHttp1Configuration & lhs , const QHttp1Configuration & rhs )
(从 6.5 起) size_t qHash (const QHttp1Configuration & key , size_t seed )

QHttpServerRequest :

(从 6.5 起) QHostAddress localAddress () const
(从 6.5 起) quint16 localPort () const
(从 6.5 起) quint16 remotePort () const

QHttpServerResponder :

(从 6.5 起) void sendResponse (const QHttpServerResponse & response )

QLatin1StringView :

(从 6.5 起) int compare (QUtf8StringView str , Qt::CaseSensitivity cs ) const

QLibraryInfo :

(从 6.5 起) bool isSharedBuild ()

QLowEnergyController :

(从 6.5 起) void readRssi ()
(从 6.5 起) void rssiRead (qint16 rssi )

QMessageLogger :

(从 6.5 起) void fatal (const QLoggingCategory & cat , const char * msg , ...) const
(从 6.5 起) void fatal (QMessageLogger::CategoryFunction catFunc , const char * msg , ...) const
(从 6.5 起) QDebug fatal () const
(从 6.5 起) QDebug fatal (const QLoggingCategory & cat ) const
(从 6.5 起) QDebug fatal (QMessageLogger::CategoryFunction catFunc ) const

QMetaMethod :

(从 6.5 起) bool invoke (QObject * obj , Qt::ConnectionType type , QTemplatedMetaMethodReturnArgument<ReturnArg> ret , Args &&... arguments ) const
(从 6.5 起) bool invoke (QObject * obj , Qt::ConnectionType type , Args &&... arguments ) const
(从 6.5 起) bool invoke (QObject * obj , QTemplatedMetaMethodReturnArgument<ReturnArg> ret , Args &&... arguments ) const
(从 6.5 起) bool invoke (QObject * obj , Args &&... arguments ) const
(从 6.5 起) bool invokeOnGadget (void * gadget , QTemplatedMetaMethodReturnArgument<ReturnArg> ret , Args &&... arguments ) const
(从 6.5 起) bool invokeOnGadget (void * gadget , Args &&... arguments ) const

QMetaObject :

(从 6.5 起) bool invokeMethod (QObject * obj , const char * member , Qt::ConnectionType type , QTemplatedMetaMethodReturnArgument<ReturnArg> ret , Args &&... args )
(从 6.5 起) bool invokeMethod (QObject * obj , const char * member , Qt::ConnectionType type , Args &&... args )
(从 6.5 起) bool invokeMethod (QObject * obj , const char * member , QTemplatedMetaMethodReturnArgument<ReturnArg> ret , Args &&... args )
(从 6.5 起) bool invokeMethod (QObject * obj , const char * member , Args &&... args )
(从 6.5 起) QObject * newInstance (Args &&... arguments ) const

QMetaType :

(从 6.5 起) bool isCopyConstructible () const
(从 6.5 起) bool isDefaultConstructible () const
(从 6.5 起) bool isDestructible () const
(从 6.5 起) bool isMoveConstructible () const
(从 6.5 起) QDebug operator<< (QDebug d , QMetaType m )
(从 6.5 起) int qRegisterMetaType (QMetaType meta )
(从 6.5 起) void registerType () const

QEGLContext :

(从 6.5 起) virtual void invalidateContext () = 0

QNetworkRequest :

(从 6.5 起) QHttp1Configuration http1Configuration () const
(从 6.5 起) void setHttp1Configuration (const QHttp1Configuration & configuration )

QOpenGLBuffer :

(从 6.5 起) QOpenGLBuffer & operator= (QOpenGLBuffer && other )
(从 6.5 起) void swap (QOpenGLBuffer & other )

QOpenGLWidget :

(从 6.5 起) QOpenGLWidget::TargetBuffer currentTargetBuffer () const
(从 6.5 起) GLuint defaultFramebufferObject (QOpenGLWidget::TargetBuffer targetBuffer ) const
(从 6.5 起) QImage grabFramebuffer (QOpenGLWidget::TargetBuffer targetBuffer )
(从 6.5 起) void makeCurrent (QOpenGLWidget::TargetBuffer targetBuffer )

QQmlApplicationEngine :

(从 6.5 起) void loadFromModule (QAnyStringView uri , QAnyStringView typeName )

QQmlComponent :

(从 6.5 起) bool isBound () const
(从 6.5 起) void loadFromModule (QAnyStringView uri , QAnyStringView typeName , QQmlComponent::CompilationMode mode )

QQmlEngine :

(从 6.5 起) void offlineStoragePathChanged ()
(从 6.5 起) T singletonInstance (QAnyStringView uri , QAnyStringView typeName )

QQuickGraphicsConfiguration :

(从 6.5 起) bool isAutomaticPipelineCacheEnabled () const
(从 6.5 起) void setAutomaticPipelineCache (bool enable )
(从 6.5 起) void setDebugLayer (bool enable )
(从 6.5 起) void setDebugMarkers (bool enable )
(从 6.5 起) void setPipelineCacheLoadFile (const QString & filename )
(从 6.5 起) void setPipelineCacheSaveFile (const QString & filename )
(从 6.5 起) void setPreferSoftwareDevice (bool enable )

QRectF :

(从 6.5 起) QRectF fromDOMRect (emscripten::val domRect )
(从 6.5 起) emscripten::val toDOMRect () const

QRegularExpression :

(从 6.5 起) QRegularExpressionMatchIterator globalMatchView (QStringView subjectView , qsizetype offset , QRegularExpression::MatchType matchType , QRegularExpression::MatchOptions matchOptions ) const
(从 6.5 起) QRegularExpressionMatch matchView (QStringView subjectView , qsizetype offset , QRegularExpression::MatchType matchType , QRegularExpression::MatchOptions matchOptions ) const

QSGRenderNode :

(从 6.5 起) const QMatrix4x4 * projectionMatrix () const

QString :

(从 6.5 起) QString & append (QUtf8StringView str )
(从 6.5 起) QString::iterator erase (QString::const_iterator it )
(从 6.5 起) QString & insert (qsizetype position , QUtf8StringView str )
(从 6.5 起) QString & operator+= (QUtf8StringView str )
(从 6.5 起) QString & prepend (QUtf8StringView str )
(从 6.5 起) QString & removeAt (qsizetype pos )
(从 6.5 起) QString & removeFirst ()
(从 6.5 起) QString & removeLast ()

QStringView :

(从 6.5 起) int compare (QUtf8StringView str , Qt::CaseSensitivity cs ) const

QSvgGenerator :

(从 6.5 起) QSvgGenerator::SvgVersion svgVersion () const

QTextLayout :

(从 6.5 起) QList<QGlyphRun> glyphRuns (int from , int length , QTextLayout::GlyphRunRetrievalFlags retrievalFlags ) const

QTextLine :

(从 6.5 起) QList<QGlyphRun> glyphRuns (int from , int length , QTextLayout::GlyphRunRetrievalFlags retrievalFlags ) const

QTimeZone :

(从 6.5 起) QTimeZone asBackendZone () const
(从 6.5 起) int fixedSecondsAheadOfUtc () const
(从 6.5 起) QTimeZone fromDurationAheadOfUtc (std::chrono::seconds offset )
(从 6.5 起) QTimeZone fromSecondsAheadOfUtc (int offset )
(从 6.5 起) bool isUtcOrFixedOffset (Qt::TimeSpec spec )
(从 6.5 起) bool isUtcOrFixedOffset () const
(从 6.5 起) Qt::TimeSpec timeSpec () const

QTransform :

(从 6.5 起) QTransform & rotate (qreal a , Qt::Axis axis , qreal distanceToPlane )
(从 6.5 起) QTransform & rotateRadians (qreal a , Qt::Axis axis , qreal distanceToPlane )

QUtf8StringView :

(从 6.5 起) int compare (QUtf8StringView str , Qt::CaseSensitivity cs ) const
(从 6.5 起) int compare (QStringView str , Qt::CaseSensitivity cs ) const
(从 6.5 起) int compare (QLatin1StringView str , Qt::CaseSensitivity cs ) const

QVulkanInstance :

(从 6.5 起) void clearDebugOutputFilters ()
(从 6.5 起) void installDebugOutputFilter (QVulkanInstance::DebugUtilsFilter filter )

QWebEngineProfile :

(从 6.5 起) bool isPushServiceEnabled () const
(从 6.5 起) void setPushServiceEnabled (bool enable )

QWebEngineUrlRequestInfo :

(从 6.5 起) QHash<QByteArray, QByteArray> httpHeaders () const

QWebSocket :

(从 6.5 起) void errorOccurred (QAbstractSocket::SocketError error )

名称空间中的新函数

(从 6.5 起) bool currentTestResolved ()
(从 6.5 起) void qRegisterTestCase (const QString & name , QTest::TestEntryFunction entryFunction )
(从 6.5 起) char * toString (const QKeySequence & ks )

新宏

(从 6.5 起) QML_CONSTRUCTIBLE_VALUE
(从 6.5 起) QML_STRUCTURED_VALUE
(从 6.5 起) Q_DECLARE_EXPORTED_LOGGING_CATEGORY ( name , EXPORT_MACRO )
(从 6.5 起) Q_PROCESSOR_LOONGARCH
(从 6.5 起) Q_PROCESSOR_LOONGARCH_32
(从 6.5 起) Q_PROCESSOR_LOONGARCH_64
(从 6.5 起) void Q_UNREACHABLE_RETURN (...)
(从 6.5 起) qCFatal ( category , const char * message , ...)
(从 6.5 起) qCFatal ( category )

新枚举类型

(从 6.5 起) enum class ParseOption { Default, UseNamespaceProcessing, PreserveSpacingOnlyNodes }
(从 6.5 起) enum TargetBuffer { LeftBuffer, RightBuffer }
(从 6.5 起) enum class SvgVersion { SvgTiny12, Svg11 }
(从 6.5 起) enum GlyphRunRetrievalFlag { RetrieveGlyphIndexes, RetrieveGlyphPositions, RetrieveStringIndexes, RetrieveString, DefaultRetrievalFlags, RetrieveAll }
(从 6.5 起) enum 初始化 { LocalTime, UTC }
(从 6.5 起) enum DebugMessageSeverityFlag { VerboseSeverity, InfoSeverity, WarningSeverity, ErrorSeverity }
(从 6.5 起) enum DebugMessageTypeFlag { GeneralMessage, ValidationMessage, PerformanceMessage }
(从 6.5 起) enum class PermissionStatus { Undetermined, Granted, Denied }

New Enum Values

enum value Error::RssiReadError
enum value Flag::NoPortabilityDrivers
enum value InterfaceType::SelectionInterface
enum value Language::Haryanvi
enum value Language::Moksha
enum value Language::NorthernFrisian
enum value Language::Obolo
enum value Language::Pijin
enum value Language::Rajasthani
enum value Language::TokiPona
enum value PointConfiguration::LabelFormat
enum value Script::Script_Kawi
enum value UnicodeVersion::Unicode_15_0

新类型别名

(从 6.5 起) DebugUtilsFilter

新特性

新的变量

(从 6.5 起) dstAlpha
(从 6.5 起) separateBlendFactors
(从 6.5 起) srcAlpha
(从 6.5 起) Android12
(从 6.5 起) Android12L
(从 6.5 起) Android13
(从 6.5 起) Windows10_22H2

新 QML 类型

E
ExtendedSceneEnvironment
F
Fog
G
geoSatelliteInfo
I
InfiniteGrid
S
SatelliteSource
ScreenCapture
设置

新 QML 特性

QML 类型 Camera :

(从 6.5 起) levelOfDetailBias : float

QML 类型 CaptureSession :

(从 6.5 起) screenCapture : ScreenCapture

QML 类型 DebugSettings :

(从 6.5 起) materialOverride : enumeration
(从 6.5 起) wireframeEnabled : bool

QML 类型 DynamicRigidBody :

(从 6.5 起) kinematicEulerRotation : vector4d
(从 6.5 起) kinematicPivot : vector3d
(从 6.5 起) kinematicPosition : vector3d
(从 6.5 起) kinematicRotation : vector3d

QML 类型 Item :

(从 6.5 起) layer.live : bool

QML 类型 MapCircle :

(从 6.5 起) referenceSurface : enum

QML 类型 MapPolygon :

(从 6.5 起) referenceSurface : enum

QML 类型 MapPolyline :

(从 6.5 起) referenceSurface : enum

QML 类型 MapRectangle :

(从 6.5 起) referenceSurface : enum

QML 类型 MediaPlayer :

(从 6.5 起) playing : bool

QML 类型 Model :

(从 6.5 起) levelOfDetailBias : real

QML 类型 PickResult :

(从 6.5 起) instanceIndex : int

QML 类型 PrincipledMaterial :

(从 6.5 起) vertexColorsEnabled : bool

QML 类型 ReflectionProbe :

(从 6.5 起) texture : CubeMapTexture

QML 类型 RenderStats :

(从 6.5 起) drawCallCount : quint64
(从 6.5 起) drawVertexCount : quint64
(从 6.5 起) effectGenerationTime : qint64
(从 6.5 起) extendedDataCollectionEnabled : bool
(从 6.5 起) graphicsAPIName : string
(从 6.5 起) imageDataSize : quint64
(从 6.5 起) materialGenerationTime : qint64
(从 6.5 起) meshDataSize : quint64
(从 6.5 起) pipelineCount : int
(从 6.5 起) pipelineCreationTime : qint64
(从 6.5 起) renderPassCount : int
(从 6.5 起) vmemAllocCount : quint32
(从 6.5 起) vmemUsedBytes : quint64

QML 类型 SceneEnvironment :

(从 6.5 起) aoEnabled : bool
(从 6.5 起) debugSettings : QtQuick3D::DebugSettings
(从 6.5 起) fog : QtQuick3D::Fog
(从 6.5 起) scissorRect : rect

QML 类型 SpecularGlossyMaterial :

(从 6.5 起) vertexColorsEnabled : bool

QML 类型 TableView :

(从 6.5 起) editTriggers : enumeration
(从 6.5 起) resizableColumns : bool
(从 6.5 起) resizableRows : bool

QML 类型 TapHandler :

(从 6.5 起) exclusiveSignals : enumeration

QML 类型 TreeViewDelegate :

(从 6.5 起) editing : bool

新 QML 信号

(从 6.5 起) frameDone (float timestep )
(从 6.5 起) layoutChanged ()

新 QML 方法

QML 类型 Locale :

(从 6.5 起) string toString (int i )
(从 6.5 起) string toString (double f , char format , int precision )
(从 6.5 起) string toString (Date date , string format )
(从 6.5 起) string toString (Date date , FormatType format )

QML 类型 TableView :

(从 6.5 起) closeEditor ()
(从 6.5 起) edit (QModelIndex modelIndex )
(从 6.5 起) Item itemAtIndex (QModelIndex index )
(从 6.5 起) positionViewAtIndex (QModelIndex index , PositionMode mode , point offset , rect subRect )

QML 类型 TestCase :

(从 6.5 起) bool waitForPolish (object windowOrItem , int timeout )