Qt 6.5 的新類和新函數

本頁包含 Qt 6.5 引入的所有新類和函數的綜閤列錶。

新名稱空間

(從 6.5 起) namespace QtCanBus
(從 6.5 起) namespace QtGrpc
(從 6.5 起) namespace QtProtobuf

新類

A
QAbstractGrpcChannel
QAbstractProtobufSerializer
QAccessibleSelectionInterface
B
QBluetoothPermission
C
QCalendarPermission
QCameraPermission
QCanDbcFileParser
QCanFrameProcessor
QCanMessageDescription
QCanSignalDescription
QCanUniqueIdDescription
QContactsPermission
G
QGrpcCallReply
QGrpcClientBase
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 起) 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 (QAnyStringView text , QDomDocument::ParseOptions options )
(從 6.5 起) QDomDocument::ParseResult setContent (QIODevice * device , QDomDocument::ParseOptions options )
(從 6.5 起) QDomDocument::ParseResult setContent (QXmlStreamReader * reader , QDomDocument::ParseOptions options )
(從 6.5 起) QDomDocument::ParseResult setContent (const QByteArray & data , 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 )

QHash :

(從 6.5 起) size_t qHash (Enum key , size_t seed )

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 起) QDebug fatal () const
(從 6.5 起) QDebug fatal (QMessageLogger::CategoryFunction catFunc ) const
(從 6.5 起) QDebug fatal (const QLoggingCategory & cat ) const
(從 6.5 起) void fatal (QMessageLogger::CategoryFunction catFunc , const char * msg , ...) const
(從 6.5 起) void fatal (const QLoggingCategory & cat , const char * msg , ...) const

QMetaMethod :

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

QMetaObject :

(從 6.5 起) bool invokeMethod (QObject * obj , const char * member , 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 , Qt::ConnectionType type , Args &&... args )
(從 6.5 起) bool invokeMethod (QObject * obj , const char * member , Qt::ConnectionType type , QTemplatedMetaMethodReturnArgument<ReturnArg> ret , 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 () const
(從 6.5 起) bool isUtcOrFixedOffset (Qt::TimeSpec spec )
(從 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 (QLatin1StringView str , Qt::CaseSensitivity cs ) const
(從 6.5 起) int compare (QStringView str , Qt::CaseSensitivity cs ) const
(從 6.5 起) int compare (QUtf8StringView 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 起) 枚舉類 ParseOption { Default, UseNamespaceProcessing, PreserveSpacingOnlyNodes }
(從 6.5 起) enum TargetBuffer { LeftBuffer, RightBuffer }
(從 6.5 起) 枚舉類 SvgVersion { SvgTiny12, Svg11 }
(從 6.5 起) enum GlyphRunRetrievalFlag { RetrieveGlyphIndexes, RetrieveGlyphPositions, RetrieveStringIndexes, RetrieveString, DefaultRetrievalFlags, RetrieveAll }
(從 6.5 起) enum Initialization { LocalTime, UTC }
(從 6.5 起) enum DebugMessageSeverityFlag { VerboseSeverity, InfoSeverity, WarningSeverity, ErrorSeverity }
(從 6.5 起) enum DebugMessageTypeFlag { GeneralMessage, ValidationMessage, PerformanceMessage }
(從 6.5 起) 枚舉類 PermissionStatus { Undetermined, Granted, Denied }

新枚舉值

枚舉值 Error::RssiReadError
枚舉值 Flag::NoPortabilityDrivers
枚舉值 InterfaceType::SelectionInterface
枚舉值 Language::Haryanvi
枚舉值 Language::Moksha
枚舉值 Language::NorthernFrisian
枚舉值 Language::Obolo
枚舉值 Language::Pijin
枚舉值 Language::Rajasthani
枚舉值 Language::TokiPona
枚舉值 PointConfiguration::LabelFormat
枚舉值 Script::Script_Kawi
枚舉值 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 起) MacOSSonoma
(從 6.5 起) Windows10_22H2

新 QML 類型

E
ExtendedSceneEnvironment
F
Fog
G
geoSatelliteInfo
I
InfiniteGrid
S
SatelliteSource
ScreenCapture
Settings

新 QML 特性

QML 類型 Camera :

(從 6.5 起) levelOfDetailBias : real

QML 類型 CaptureSession :

(從 6.5 起) screenCapture : ScreenCapture

QML 類型 DebugSettings :

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

QML 類型 DynamicRigidBody :

(從 6.5 起) kinematicEulerRotation : vector3d
(從 6.5 起) kinematicPivot : vector3d
(從 6.5 起) kinematicPosition : vector3d
(從 6.5 起) kinematicRotation : quaternion

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 類型 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 類型 pickResult :

(從 6.5 起) instanceIndex : int

新 QML 信號

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

新 QML 方法

QML 類型 Locale :

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

QML 類型 Qt :

(從 6.5 起) 組件 createComponent (string moduleUri , string typeName , enumeration mode , QtObject parent )

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 )