Qt 6.3 的新類和新函數

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

新類

O
QOpcUaDataValue
QOpcUaHistoryData
QOpcUaHistoryReadRawRequest
QOpcUaHistoryReadResponse
W
QWaylandPresentationTime
WhenAnyResult ( QtFuture )

新成員函數

QAbstract3DGraph :

(從 6.3 起) bool hasSeries (QAbstract3DSeries * series ) const

QBluetoothDeviceInfo :

(從 6.3 起) QMultiHash<QBluetoothUuid, QByteArray> serviceData () const
(從 6.3 起) QByteArray serviceData (const QBluetoothUuid & serviceId ) const
(從 6.3 起) QList<QBluetoothUuid> serviceIds () const
(從 6.3 起) bool setServiceData (const QBluetoothUuid & serviceId , const QByteArray & data )

QByteArray :

(從 6.3 起) bool isValidUtf8 () const

QByteArrayList :

(從 6.3 起) QByteArray join (QByteArrayView separator ) const

QByteArrayMatcher :

(從 6.3 起) qsizetype indexIn (QByteArrayView data , qsizetype from ) const

QByteArrayView :

(從 6.3 起) bool isValidUtf8 () const
(從 6.3 起) double toDouble (bool * ok ) const
(從 6.3 起) float toFloat (bool * ok ) const
(從 6.3 起) int toInt (bool * ok , int base ) const
(從 6.3 起) long toLong (bool * ok , int base ) const
(從 6.3 起) qlonglong toLongLong (bool * ok , int base ) const
(從 6.3 起) short toShort (bool * ok , int base ) const
(從 6.3 起) uint toUInt (bool * ok , int base ) const
(從 6.3 起) ulong toULong (bool * ok , int base ) const
(從 6.3 起) qulonglong toULongLong (bool * ok , int base ) const
(從 6.3 起) ushort toUShort (bool * ok , int base ) const
(從 6.3 起) QByteArrayView trimmed () const

QCborArray :

(從 6.3 起) QCborArray fromJsonArray (QJsonArray && array )

QCborMap :

(從 6.3 起) QCborMap fromJsonObject (QJsonObject && obj )

QCollator :

(從 6.3 起) int defaultCompare (QStringView s1 , QStringView s2 )
(從 6.3 起) QCollatorSortKey defaultSortKey (QStringView key )

QCryptographicHash :

(從 6.3 起) QByteArrayView resultView () const

QDebug :

(從 6.3 起) QDebug operator<< (QDebug debug , const QVarLengthArray<T, P> & array )

QDir :

(從 6.3 起) bool mkdir (const QString & dirName , QFileDevice::Permissions permissions ) const

QDirIterator :

(從 6.3 起) QFileInfo nextFileInfo ()

QDoubleValidator :

(從 6.3 起) virtual void fixup (QString & input ) const override

QFile :

(從 6.3 起) std::filesystem::path filesystemSymLinkTarget () const
(從 6.3 起) std::filesystem::path filesystemSymLinkTarget (const std::filesystem::path & fileName )
(從 6.3 起) bool open (QIODeviceBase::OpenMode mode , QFileDevice::Permissions permissions )

QFontComboBox :

(從 6.3 起) std::optional<QFont> displayFont (const QString & fontFamily ) const
(從 6.3 起) QString sampleTextForFont (const QString & fontFamily ) const
(從 6.3 起) QString sampleTextForSystem (QFontDatabase::WritingSystem writingSystem ) const
(從 6.3 起) void setDisplayFont (const QString & fontFamily , const QFont & font )
(從 6.3 起) void setSampleTextForFont (const QString & fontFamily , const QString & sampleText )
(從 6.3 起) void setSampleTextForSystem (QFontDatabase::WritingSystem writingSystem , const QString & sampleText )

QFontMetrics :

(從 6.3 起) QRect boundingRect (const QString & text , const QTextOption & option ) const
(從 6.3 起) int horizontalAdvance (const QString & text , const QTextOption & option ) const
(從 6.3 起) QRect tightBoundingRect (const QString & text , const QTextOption & option ) const

QFontMetricsF :

(從 6.3 起) QRectF boundingRect (const QString & text , const QTextOption & option ) const
(從 6.3 起) qreal horizontalAdvance (const QString & text , const QTextOption & option ) const
(從 6.3 起) QRectF tightBoundingRect (const QString & text , const QTextOption & option ) const

QInputDevice :

(從 6.3 起) QStringList seatNames ()

QLatin1StringView :

(從 6.3 起) qsizetype lastIndexOf (QChar ch , Qt::CaseSensitivity cs ) const

QLocalServer :

(從 6.3 起) int listenBacklogSize () const
(從 6.3 起) void setListenBacklogSize (int size )

QLocale :

(從 6.3 起) QLocale::Language codeToLanguage (QStringView languageCode , QLocale::LanguageCodeTypes codeTypes )
(從 6.3 起) QString languageToCode (QLocale::Language 語言 , QLocale::LanguageCodeTypes codeTypes )

QEGLContext :

(從 6.3 起) virtual EGLConfig config () const = 0
(從 6.3 起) virtual EGLDisplay display () const = 0

QNetworkInformation :

(從 6.3 起) bool loadDefaultBackend ()
(從 6.3 起) QNetworkInformation::Features supportedFeatures () const

QNetworkReply :

(從 6.3 起) void requestSent ()
(從 6.3 起) void socketStartedConnecting ()

QObject :

(從 6.3 起) QList<T> findChildren (Qt::FindChildOptions options ) const

QOpcUaClient :

(從 6.3 起) QOpcUaHistoryReadResponse * readHistoryData (const QOpcUaHistoryReadRawRequest & request )

QOpcUaLocalizedText :

(從 6.3 起) QDebug operator<< (QDebug debug , const QOpcUaLocalizedText & text )

QOpcUaNode :

(從 6.3 起) QOpcUaHistoryReadResponse * readHistoryRaw (const QDateTime & startTime , const QDateTime & endTime , quint32 numValues , bool returnBounds )

QOpcUaQualifiedName :

(從 6.3 起) QDebug operator<< (QDebug debug , const QOpcUaQualifiedName & name )

QProcessEnvironment :

(從 6.3 起) bool inheritsFromParent () const

QQuickItem :

(從 6.3 起) void dumpItemTree () const
(從 6.3 起) void ensurePolished ()

QQuickRenderTarget :

(從 6.3 起) qreal devicePixelRatio () const
(從 6.3 起) void setDevicePixelRatio (qreal ratio )

QRegularExpressionMatch :

(從 6.3 起) bool hasCaptured (QAnyStringView name ) const
(從 6.3 起) bool hasCaptured (int nth ) const

QSemaphore :

(從 6.3 起) bool tryAcquire (int n , std::chrono::duration<Rep, Period> timeout )
(從 6.3 起) bool try_acquire ()
(從 6.3 起) bool try_acquire_for (const std::chrono::duration<Rep, Period> & timeout )
(從 6.3 起) bool try_acquire_until (const std::chrono::time_point<Clock, Duration> & tp )

QString :

(從 6.3 起) qsizetype lastIndexOf (QChar ch , Qt::CaseSensitivity cs ) const

QStringView :

(從 6.3 起) qsizetype lastIndexOf (QChar ch , Qt::CaseSensitivity cs ) const

QTableWidgetSelectionRange :

(從 6.3 起) bool operator!= (const QTableWidgetSelectionRange & lhs , const QTableWidgetSelectionRange & rhs )
(從 6.3 起) bool operator== (const QTableWidgetSelectionRange & lhs , const QTableWidgetSelectionRange & rhs )

QTcpServer :

(從 6.3 起) int listenBacklogSize () const
(從 6.3 起) void setListenBacklogSize (int size )

QThreadPool :

(從 6.3 起) void startOnReservedThread (QRunnable * runnable )
(從 6.3 起) void startOnReservedThread (Callable && callableToRun )

QUrl :

(從 6.3 起) QString fromAce (const QByteArray & domain , QUrl::AceProcessingOptions options )
(從 6.3 起) QByteArray toAce (const QString & domain , QUrl::AceProcessingOptions options )

QUtf8StringView :

(從 6.3 起) bool isValidUtf8 () const

QVarLengthArray :

(從 6.3 起) QVarLengthArray<T, Prealloc>::iterator emplace (QVarLengthArray<T, Prealloc>::const_iterator pos , Args &&... args )
(從 6.3 起) T & emplace_back (Args &&... args )

QWidget :

(從 6.3 起) QAction * addAction (const QString & text )
(從 6.3 起) QAction * addAction (const QIcon & icon , const QString & text )
(從 6.3 起) QAction * addAction (const QString & text , const QKeySequence & shortcut )
(從 6.3 起) QAction * addAction (const QIcon & icon , const QString & text , const QKeySequence & shortcut )
(從 6.3 起) QAction * addAction (const QString & text , Args &&... args )
(從 6.3 起) QAction * addAction (const QIcon & icon , const QString & text , Args &&... args )
(從 6.3 起) QAction * addAction (const QString & text , const QKeySequence & shortcut , Args &&... args )
(從 6.3 起) QAction * addAction (const QIcon & icon , const QString & text , const QKeySequence & shortcut , Args &&... args )
(從 6.3 起) QAction * addAction (const QString & text , const QObject * receiver , const char * member , Qt::ConnectionType type )
(從 6.3 起) QAction * addAction (const QIcon & icon , const QString & text , const QObject * receiver , const char * member , Qt::ConnectionType type )
(從 6.3 起) QAction * addAction (const QString & text , const QKeySequence & shortcut , const QObject * receiver , const char * member , Qt::ConnectionType type )
(從 6.3 起) QAction * addAction (const QIcon & icon , const QString & text , const QKeySequence & shortcut , const QObject * receiver , const char * member , Qt::ConnectionType type )

名稱空間中的新函數

(從 6.3 起) void failOnWarning (const char * message )
(從 6.3 起) void failOnWarning (const QRegularExpression & messagePattern )
(從 6.3 起) QFuture<OutputSequence> whenAll (InputIt first , InputIt last )
(從 6.3 起) QFuture<OutputSequence> whenAll (Futures &&... futures )
(從 6.3 起) QFuture<QtFuture::WhenAnyResult<T>> whenAny (InputIt first , InputIt last )
(從 6.3 起) QFuture<std::variant<std::decay_t<Futures>...>> whenAny (Futures &&... futures )

新全局函數

(從 6.3 起) const char * qWebEngineChromiumSecurityPatchVersion ()

新宏

(從 6.3 起) QT_TRID_N_NOOP ( id )
(從 6.3 起) QVERIFY_THROWS_EXCEPTION ( exceptiontype , ...)
(從 6.3 起) QVERIFY_THROWS_NO_EXCEPTION (...)
(從 6.3 起) Q_APPLICATION_STATIC ( Type , VariableName , ...)
(從 6.3 起) Q_GADGET_EXPORT ( EXPORT_MACRO )

新枚舉類型

(從 6.3 起) 枚舉類 TransportMedium { Unknown, Ethernet, Cellular, WiFi, Bluetooth }
(從 6.3 起) enum Initialization { InheritFromParent }
(從 6.3 起) enum AceProcessingOption { IgnoreIDNWhitelist, AceTransitionalProcessing }

新枚舉值

枚舉值 Language::Kaingang
枚舉值 Language::Nheengatu
枚舉值 PixelMetric::PM_LineEditIconMargin
枚舉值 Script::Script_CyproMinoan
枚舉值 Script::Script_NagMundari
枚舉值 Script::Script_OldUyghur
枚舉值 Script::Script_Tangsa
枚舉值 Script::Script_Toto
枚舉值 Script::Script_Vithkuqi
枚舉值 StandardPixmap::SP_TabCloseButton
枚舉值 StyleHint::SH_SpinBox_SelectOnStep
枚舉值 UnicodeVersion::Unicode_14_0

新特性

新的變量

(從 6.3 起) MacOSMonterey
(從 6.3 起) Windows10_1809
(從 6.3 起) Windows10_1903
(從 6.3 起) Windows10_1909
(從 6.3 起) Windows10_2004
(從 6.3 起) Windows10_20H2
(從 6.3 起) Windows10_21H1
(從 6.3 起) Windows10_21H2
(從 6.3 起) Windows11

新 QML 類型

D
DynamicBurst3D
F
FolderDialog
M
MessageDialog
P
ParticleCustomShape3D
PresentationTime
Q
QtShell
QtShellChrome
QtShellSurface
T
TreeView
TreeViewDelegate

新 QML 特性

QML 類型 Bar3DSeries :

(從 6.3 起) rowColors : list<ThemeColor>

QML 類型 Bars3D :

(從 6.3 起) barSeriesMargin : size

QML 類型 FileInstancing :

(從 6.3 起) instanceCount : int

QML 類型 HeightMapSurfaceDataProxy :

(從 6.3 起) autoScaleY : real
(從 6.3 起) maxYValue : real
(從 6.3 起) minYValue : real

QML 類型 HoverHandler :

(從 6.3 起) blocking : bool

QML 類型 InstanceList :

(從 6.3 起) instanceCount : int

QML 類型 ParticleSystem3DLogging :

(從 6.3 起) timeDeviation : real

QML 類型 SpriteParticle3D :

(從 6.3 起) lights : list<Light>
(從 6.3 起) offsetX : real
(從 6.3 起) offsetY : real

QML 類型 Surface3DSeries :

(從 6.3 起) wireframeColor : color

QML 類型 TextMetrics :

(從 6.3 起) renderType : enumeration

QML 類型 WheelHandler :

(從 6.3 起) blocking : bool

新 QML 方法

QML 類型 AbstractGraph3D :

(從 6.3 起) bool hasSeries (Abstract3DSeries series )

QML 類型 Instancing :

(從 6.3 起) color instanceColor (int index )
(從 6.3 起) vector3d instanceCustomData (int index )
(從 6.3 起) vector3d instancePosition (int index )
(從 6.3 起) quaternion instanceRotation (int index )
(從 6.3 起) vector3d instanceScale (int index )

QML 類型 Item :

(從 6.3 起) dumpItemTree ()

QML 類型 TestCase :

(從 6.3 起) failOnWarning ( message )