Qt 6.3 中的新类和函数

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

新类

O
QOpcUaDataValue
QOpcUaHistoryData
QOpcUaHistoryReadRawRequest
QOpcUaHistoryReadResponse
W
QWaylandPresentationTime
WhenAnyResult ( QtFuture )

新成员函数

QAbstract3DGraph :

bool hasSeries (QAbstract3DSeries * series ) const

QBluetoothDeviceInfo :

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

QByteArray :

bool isValidUtf8 () const

QByteArrayList :

QByteArray join (QByteArrayView separator ) const

QByteArrayMatcher :

qsizetype indexIn (QByteArrayView data , qsizetype from ) const

QByteArrayView :

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

QCborArray :

QCborArray fromJsonArray (QJsonArray && array )

QCborMap :

QCborMap fromJsonObject (QJsonObject && obj )

QCollator :

int defaultCompare (QStringView s1 , QStringView s2 )
QCollatorSortKey defaultSortKey (QStringView key )

QCryptographicHash :

QByteArrayView resultView () const

QDebug :

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

QDir :

bool mkdir (const QString & dirName , QFile::Permissions permissions ) const

QDirIterator :

QFileInfo nextFileInfo ()

QDoubleValidator :

virtual void fixup (QString & input ) const override

QFile :

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

QFontComboBox :

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

QFontMetrics :

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

QFontMetricsF :

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

QInputDevice :

QStringList seatNames ()

QLatin1StringView :

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

QLocalServer :

int listenBacklogSize () const
void setListenBacklogSize (int size )

QLocale :

QLocale::Language codeToLanguage (QStringView languageCode , QLocale::LanguageCodeTypes codeTypes )
QString languageToCode (QLocale::Language 语言 , QLocale::LanguageCodeTypes codeTypes )

QEGLContext :

virtual EGLConfig config () const = 0
virtual EGLDisplay display () const = 0

QNetworkInformation :

bool loadDefaultBackend ()
QNetworkInformation::Features supportedFeatures () const

QNetworkReply :

void requestSent ()
void socketStartedConnecting ()

QObject :

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

QOpcUaClient :

QOpcUaHistoryReadResponse * readHistoryData (const QOpcUaHistoryReadRawRequest & request )

QOpcUaLocalizedText :

QDebug operator<< (QDebug debug , const QOpcUaLocalizedText & text )

QOpcUaNode :

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

QOpcUaQualifiedName :

QDebug operator<< (QDebug debug , const QOpcUaQualifiedName & name )

QProcessEnvironment :

bool inheritsFromParent () const

QQuickItem :

void dumpItemTree () const
void ensurePolished ()

QQuickRenderTarget :

qreal devicePixelRatio () const
void setDevicePixelRatio (qreal ratio )

QRegularExpressionMatch :

bool hasCaptured (const QString & name ) const
bool hasCaptured (QStringView name ) const
bool hasCaptured (int nth ) const

QSemaphore :

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

QString :

qsizetype lastIndexOf (QChar c , Qt::CaseSensitivity cs ) const

QStringView :

qsizetype lastIndexOf (QChar c , Qt::CaseSensitivity cs ) const

QTableWidgetSelectionRange :

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

QTcpServer :

int listenBacklogSize () const
void setListenBacklogSize (int size )

QThreadPool :

void startOnReservedThread (QRunnable * runnable )
void startOnReservedThread (std::function<void ()> functionToRun )

QUrl :

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

QUtf8StringView :

bool isValidUtf8 () const

QVarLengthArray :

QVarLengthArray::iterator emplace (QVarLengthArray::const_iterator pos , Args &&... args )
T & emplace_back (Args &&... args )

QWidget :

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

名称空间中的新函数

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

新全局函数

const char * qWebEngineChromiumSecurityPatchVersion ()

新宏

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

新枚举类型

enum class TransportMedium { Unknown, Ethernet, Cellular, WiFi, Bluetooth }
enum Initialization { InheritFromParent }
enum AceProcessingOption { IgnoreIDNWhitelist, AceTransitionalProcessing }

新特性

新的变量

MacOSMonterey
Windows10_1809
Windows10_1903
Windows10_1909
Windows10_2004
Windows10_20H2
Windows10_21H1
Windows10_21H2
Windows11

新 QML 类型

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

新 QML 特性

QML 类型 Bar3DSeries :

rowColors : list<ThemeColor>

QML 类型 Bars3D :

barSeriesMargin : size

QML 类型 FileInstancing :

instanceCount : int

QML 类型 HeightMapSurfaceDataProxy :

autoScaleY : real
maxYValue : real
minYValue : real

QML 类型 HoverHandler :

blocking : bool

QML 类型 InstanceList :

instanceCount : int

QML 类型 ParticleSystem3DLogging :

timeDeviation : real

QML 类型 SpriteParticle3D :

lights : list<Light>
offsetX : float
offsetY : float

QML 类型 Surface3DSeries :

wireframeColor : color

QML 类型 TextMetrics :

renderType : enumeration

QML 类型 WheelHandler :

blocking : bool

新 QML 方法

QML 类型 AbstractGraph3D :

bool hasSeries (Abstract3DSeries series )

QML 类型 Instancing :

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

QML 类型 Item :

dumpItemTree ()

QML 类型 TestCase :

failOnWarning ( message )