Qt 6.7 中新增加的类和函数

该页面包含 Qt 6.7 中引入的所有新类和函数的详尽列表。

新命名空间

(自 6.7) 命名空间QtVideo

新类

新成员函数

QAbstractGrpcChannel

(自 6.7) 虚函数call(std::shared_ptr<QGrpcChannelOperation> channelOperation) = 0
(自 6.7) 虚函数startBidirStream(std::shared_ptr<QGrpcChannelOperation> channelOperation) = 0
(自 6.7) 虚函数startClientStream(std::shared_ptr<QGrpcChannelOperation> channelOperation) = 0
(自 6.7) 虚函数startServerStream(std::shared_ptr<QGrpcChannelOperation> channelOperation) = 0

QAbstractGrpcClient

(自 6.7) const std::shared_ptr<QAbstractGrpcChannel> &channel()
(自6.7起) voidchannelChanged()

QAnyStringView

(自6.7起) QDebugoperator<<(QDebug d, QAnyStringView s)

QAtomicInteger

(自6.7起) voidqYieldCpu()

QByteArrayView

(自6.7起) std::string_viewoperator std::string_view() const

QCalendar

(自6.7起) QDatematchCenturyToWeekday(const QCalendar::YearMonthDay &parts, int dow) const

QCanDbcFileParser

(自6.7起) boolparseData(QStringView data)

QCborStreamReader

(自6.7起) QByteArrayreadAllByteArray()
(自6.7起) QStringreadAllString()
(自6.7起) QByteArrayreadAllUtf8String()
(自6.7起) boolreadAndAppendToByteArray(QByteArray &dst)
(自6.7起) boolreadAndAppendToString(QString &dst)
(自6.7起) boolreadAndAppendToUtf8String(QByteArray &dst)
(自6.7起) QCborStreamReader::StringResult<QByteArray>readUtf8String()

QCheckBox

(自6.7起) voidcheckStateChanged(Qt::CheckState state)

QCoreApplication

(自6.7起) voidprocessEvents(QEventLoop::ProcessEventsFlags flags, QDeadlineTimer deadline)

QDBusAbstractInterface

(自6.7起) boolisInteractiveAuthorizationAllowed() const
(自6.7起) voidsetInteractiveAuthorizationAllowed(bool enable)

QDataStream

(自6.7起) QDataStream &readBytes(char *&s, qint64 &l)

QDate

(自6.7起) QDatefromString(QStringView string, QStringView format, int baseYear)
(自6.7起) QDatefromString(QStringView string, QStringView format, int baseYear, QCalendar cal)
(自6.7起) QDatefromString(const QString &string, QStringView format, int baseYear)
(自6.7起) QDatefromString(const QString &string, const QString &format, int baseYear)

QDateTime

(自6.7起) QDateTimefromString(QStringView string, QStringView format, int baseYear)
(自6.7起) QDateTimefromString(QStringView string, QStringView format, int baseYear, QCalendar cal)
(自6.7起) QDateTimefromString(const QString &string, QStringView format, int baseYear)
(自6.7起) QDateTimefromString(const QString &string, const QString &format, int baseYear)

QDebug

(自6.7起) QDebug &operator<<(std::nullopt_t)
(自6.7起) QDebug &operator<<(T i128)
(自6.7起) QDebug &operator<<(T u128)
(自6.7起) boolquoteStrings() const
(自6.7起) voidsetQuoteStrings(bool b)

QEventLoop

(自6.7起) voidprocessEvents(QEventLoop::ProcessEventsFlags flags, QDeadlineTimer deadline)

QEventLoopLocker

(自 6.7) QEventLoopLocker &operator=(QEventLoopLocker &&other)
(自6.7起) voidswap(QEventLoopLocker &other)
(自6.7起) voidswap(QEventLoopLocker &lhs, QEventLoopLocker &rhs)

QFont

(自6.7起) voidclearFeatures()
(自6.7起) voidclearVariableAxes()
(自 6.7) QList<QFont::Tag>featureTags() const
(自 6.7) quint32featureValue(QFont::Tag tag) const
(自6.7起) boolisFeatureSet(QFont::Tag tag) const
(自6.7起) boolisVariableAxisSet(QFont::Tag tag) const
(自6.7起) voidsetFeature(QFont::Tag tag, quint32 value)
(自6.7起) voidsetVariableAxis(QFont::Tag tag, float value)
(自6.7起) voidunsetFeature(QFont::Tag tag)
(自6.7起) voidunsetVariableAxis(QFont::Tag tag)
(自 6.7) QList<QFont::Tag>variableAxisTags() const
(自 6.7) floatvariableAxisValue(QFont::Tag tag) const

QHttpServerRequest

(自 6.7) QSslConfigurationsslConfiguration() const

QIcon

(自 6.7) QIconfromTheme(QIcon::ThemeIcon icon)
(自 6.7) QIconfromTheme(QIcon::ThemeIcon icon, const QIcon &fallback)
(自6.7起) boolhasThemeIcon(QIcon::ThemeIcon icon)

QJniObject

(自 6.7) autocallStaticMethod(const char *methodName, Args &&... args)

QMetaObject

(自6.7起) boolinvokeMethod(QObject *context, Functor &&function, Qt::ConnectionType type, QTemplatedMetaMethodReturnArgument<FunctorReturnType> ret, Args &&... arguments)
(自6.7起) boolinvokeMethod(QObject *context, Functor &&function, QTemplatedMetaMethodReturnArgument<FunctorReturnType> ret, Args &&... arguments)
(自6.7起) boolinvokeMethod(QObject *context, Functor &&function, Qt::ConnectionType type, Args &&... arguments)
(自6.7起) boolinvokeMethod(QObject *context, Functor &&function, Args &&... arguments)

QNetworkAccessManager

(自 6.7) QNetworkReply *get(const QNetworkRequest &request, QIODevice *data)
(自 6.7) QNetworkReply *get(const QNetworkRequest &request, const QByteArray &data)
(自6.7起) voidsetTransferTimeout(std::chrono::milliseconds duration)
(自 6.7) std::chrono::millisecondstransferTimeoutAsDuration() const

QNetworkRequest

(自6.7起) voidsetTransferTimeout(std::chrono::milliseconds duration)
(自 6.7) std::chrono::millisecondstransferTimeoutAsDuration() const

QObject

(自 6.7) TfindChild(Qt::FindChildOptions options) const

QOpcUaAttributeOperand

(自6.7起) booloperator!=(const QOpcUaAttributeOperand &lhs, const QOpcUaAttributeOperand &rhs)
(自6.7起) bool运算符==(const QOpcUaAttributeOperand &lhs, const QOpcUaAttributeOperand &rhs)

QOpcUaClient

(自 6.7) QOpcUaHistoryReadResponse *readHistoryEvents(const QOpcUaHistoryReadEventRequest &request)
(自6.7起) boolregisterNodes(const QStringList &nodesToRegister)
(自6.7起) voidregisterNodesFinished(const QStringList &nodesToRegister, const QStringList &registeredNodeIds, QOpcUa::UaStatusCode statusCode)
(自6.7起) boolunregisterNodes(const QStringList &nodesToUnregister)
(自6.7起) voidunregisterNodesFinished(const QStringList &nodesToUnregister, QOpcUa::UaStatusCode statusCode)

QOpcUaContentFilterElement

(自6.7起) bool运算符!=(const QOpcUaContentFilterElement &lhs, const QOpcUaContentFilterElement &rhs)

QOpcUaDataValue

(自 6.7) QVariant运算符 QVariant() const
(自6.7起) bool运算符!=(const QOpcUaDataValue &lhs, const QOpcUaDataValue &rhs)
(自6.7起) bool运算符==(const QOpcUaDataValue &lhs, const QOpcUaDataValue &rhs)
(自 6.7) quint16serverPicoseconds() const
(自6.7起) voidsetServerPicoseconds(quint16 serverPicoseconds)
(自6.7起) voidsetSourcePicoseconds(quint16 sourcePicoseconds)
(自 6.7) quint16sourcePicoseconds() const

QOpcUaElementOperand

(自6.7起) bool运算符!=(const QOpcUaElementOperand &lhs, const QOpcUaElementOperand &rhs)
(自6.7起) bool运算符==(const QOpcUaElementOperand &lhs, const QOpcUaElementOperand &rhs)

QOpcUaGenericStructHandler

(自6.7起) boolinitialized() const

QOpcUaHistoryReadRawRequest

(自6.7起) voidsetTimestampsToReturn(QOpcUa::TimestampsToReturn timestampsToReturn)
(自 6.7) QOpcUa::TimestampsToReturntimestampsToReturn() const

QOpcUaHistoryReadResponse

(自 6.7) QList)<QOpcUaHistoryEvent>events() const
(自6.7起) voidreadHistoryEventsFinished(const QList<QOpcUaHistoryEvent> &results, QOpcUa::UaStatusCode serviceResult)

QOpcUaLiteralOperand

(自6.7起) bool运算符!=(const QOpcUaLiteralOperand &lhs, const QOpcUaLiteralOperand &rhs)
(自6.7起) bool运算符==(const QOpcUaLiteralOperand &lhs, const QOpcUaLiteralOperand &rhs)

QOpcUaMonitoringParameters

(自 6.7) QHash<quint32, QOpcUa::UaStatusCode>failedTriggeredItemsStatus() const
(自6.7起) voidsetFailedTriggeredItemsStatus(const QHash<quint32, QOpcUa::UaStatusCode> &status)
(自6.7起) voidsetTriggeredItemIds(const QSet<quint32> &ids)
(自 6.7) QSet<quint32>triggeredItemIds() const

QOpcUaNode

(自 6.7) QOpcUaHistoryReadResponse *readHistoryEvents(const QDateTime &startTime, const QDateTime &endTime, QOpcUaMonitoringParameters::EventFilter &filter, quint32 numValues)
(自 6.7) QOpcUaHistoryReadResponse *readHistoryRaw(const QDateTime &startTime, const QDateTime &endTime, quint32 numValues, bool returnBounds, QOpcUa::TimestampsToReturn timestampsToReturn)
(自6.7起) voidvalueAttributeUpdated(const QVariant &value)

QOpcUaRelativePathElement

(自 6.7) QVariantoperator QVariant() const
(自6.7起) booloperator!=(const QOpcUaRelativePathElement &lhs, const QOpcUaRelativePathElement &rhs)

QOpcUaSimpleAttributeOperand

(自6.7起) booloperator!=(const QOpcUaSimpleAttributeOperand &lhs, const QOpcUaSimpleAttributeOperand &rhs)

QPartialOrdering

(自6.7起) boolis_eq(QPartialOrdering o)
(自6.7起) boolis_gt(QPartialOrdering o)
(自6.7起) boolis_gteq(QPartialOrdering o)
(自6.7起) boolis_lt(QPartialOrdering o)
(自6.7起) boolis_lteq(QPartialOrdering o)
(自6.7起) boolis_neq(QPartialOrdering o)

QProcess

(自6.7起) voidfailChildProcessModifier(const char *description, int error)

QProtobufMessage

(since 6.7) QList<QByteArray>unknownFieldData(qint32 field) const
(since 6.7) QList<qint32>unknownFieldNumbers() const

QProtobufSerializer

(自6.7起) voidshouldPreserveUnknownFields(bool preserveUnknownFields)

QQuickTextDocument

(preliminary) void保存()
(preliminary) voidsaveAs(const QUrl &url)
(自6.7起) voidsetTextDocument(QTextDocument *document)
(自6.7起) voidtextDocumentChanged()

QQuickView

(自6.7起) voidloadFromModule(QAnyStringView uri, QAnyStringView typeName)

QQuickWebEngineProfile

(自6.7起) voidclearHttpCacheCompleted()

QQuickWindow

(since 6.7) QSGTextNode *createTextNode() const

QRawFont

(自6.7起) QByteArrayfontTable(QFont::Tag tag) const

QRemoteObjectHost

(自6.7起) voidsetLocalServerOptions(QLocalServer::SocketOptions options)

QRhiColorAttachment

(since 6.7) intmultiViewCount() const
(自6.7起) voidsetMultiViewCount(int count)

QRhiGraphicsPipeline

(since 6.7) intmultiViewCount() const
(自6.7起) voidsetMultiViewCount(int count)

QShader

(since 6.7) QShader &operator=(QShader &&other)
(自6.7起) voidswap(QShader &other)

QShaderBaker

(自6.7起) voidsetMultiViewCount(int count)

QSharedPointer

(自6.7起) boolowner_before(const QSharedPointer<X> &other) const
(自6.7起) boolowner_before(const QWeakPointer<X> &other) const
(自6.7起) boolowner_equal(const QSharedPointer<X> &other) const
(自6.7起) boolowner_equal(const QWeakPointer<X> &other) const
(since 6.7) size_towner_hash() const

QSignalBlocker

(自6.7起) voiddismiss()

QSqlQuery

(自6.7起) boolisPositionalBindingEnabled() const
(自6.7起) voidsetPositionalBindingEnabled(bool enable)

QStaticLatin1StringMatcher

(自 6.7) autoqMakeStaticCaseInsensitiveLatin1StringMatcher(const char (&)[N] patternToMatch)
(自 6.7) autoqMakeStaticCaseSensitiveLatin1StringMatcher(const char (&)[N] patternToMatch)

QString

(since 6.7) std::u16string_viewoperator std::u16string_view() const

QStringList

(since 6.7) QStringListfilter(const QStringMatcher &matcher) const
(since 6.7) QStringListfilter(QLatin1StringView str, Qt::CaseSensitivity cs) const

QStringMatcher

(since 6.7) QStringViewpatternView() const

QStringView

(自6.7起) boolisLower() const
(自6.7起) boolisUpper() const
(since 6.7) std::u16string_viewoperator std::u16string_view() const

QSvgWidget

(since 6.7) QtSvg::Optionsoptions() const
(自6.7起) voidsetOptions(QtSvg::Options options)

QTemporaryFile

(since 6.7) QTemporaryFile *createNativeFile(const std::filesystem::path &fileName)
(自6.7起) boolrename(const std::filesystem::path &newName)
(自6.7起) voidsetFileTemplate(const std::filesystem::path &name)

QUtf8StringView

(since 6.7) std::basic_string_view<QUtf8StringView::storage_type>operator std::basic_string_view<QUtf8StringView::storage_type>() const

QVariant

(自 6.7) QVariantfromMetaType(QMetaType type, const void *copy)
(自 6.7) Tqvariant_cast(QVariant &&value)

QVulkanWindow

(自6.7起) voidsetEnabledFeaturesModifier(const QVulkanWindow::EnabledFeaturesModifier &modifier)
(自6.7起) voidsetEnabledFeaturesModifier(QVulkanWindow::EnabledFeatures2Modifier modifier)

QWaylandSeat

(自6.7起) voidsendUnicodeKeyPressEvent(uint unicode)
(自6.7起) voidsendUnicodeKeyReleaseEvent(uint unicode)

QWeakPointer

(自6.7起) boolowner_before(const QWeakPointer<X> &other) const
(自6.7起) boolowner_before(const QSharedPointer<X> &other) const
(自6.7起) boolowner_equal(const QWeakPointer<X> &other) const
(自6.7起) boolowner_equal(const QSharedPointer<X> &other) const
(since 6.7) size_towner_hash() const

QWebEnginePage

(自6.7起) voidwebAuthUxRequested(QWebEngineWebAuthUxRequest *request)

QWebEngineProfile

(自6.7起) voidclearHttpCacheCompleted()

QWebEngineUrlRequestInfo

(since 6.7) QIODevice *requestBody() const

QWebEngineUrlRequestJob

(since 6.7) QIODevice *requestBody() const

命名空间中新增的功能

(since 6.7) Qt::strong_orderingcompareThreeWay(Enum lhs, Enum rhs)
(since 6.7) Qt::strong_orderingcompareThreeWay(const LeftType *lhs, const RightType *rhs)
(since 6.7) Qt::partial_orderingcompareThreeWay(FloatType lhs, IntType rhs)
(since 6.7) Qt::partial_orderingcompareThreeWay(IntType lhs, FloatType rhs)
(since 6.7) Qt::partial_orderingcompareThreeWay(LeftFloat lhs, RightFloat rhs)
(since 6.7) Qt::strong_orderingcompareThreeWay(LeftInt lhs, RightInt rhs)
(自6.7起) voidqSleep(std::chrono::milliseconds msecs)
(自6.7起) voidqWait(std::chrono::milliseconds msecs)
(自6.7起) boolqWaitFor(Functor predicate, QDeadlineTimer deadline)
(自6.7起) boolqWaitForWindowFocused(QWidget *widget, QDeadlineTimer timeout)
(自6.7起) boolqWaitForWindowFocused(QWindow *window, QDeadlineTimer timeout)

新增全局函数

(自 6.7) autoqCompareThreeWay(const LeftType &lhs, const RightType &rhs)
(自6.7起) voidqDrawPlainRoundedRect(QPainter *painter, const QRect &rect, qreal rx, qreal ry, const QColor &lineColor, int lineWidth, const QBrush *fill)
(自6.7起) voidqDrawPlainRoundedRect(QPainter *painter, int x, int y, int width, int height, qreal rx, qreal ry, const QColor &lineColor, int lineWidth, const QBrush *fill)

新增宏

(since 6.7) QT_NO_CONTEXTLESS_CONNECT
(since 6.7) Q_NODISCARD_CTOR_X(message)
(since 6.7) Q_NODISCARD_X(message)

新增枚举类型

(since 6.7) enum classTransitionResolution { Reject, RelativeToBefore, RelativeToAfter, PreferBefore, PreferAfter, …, LegacyBehavior }
(since 6.7) enum classThemeIcon { AddressBookNew, ApplicationExit, AppointmentNew, CallStart, CallStop, …, NThemeIcons }
(since 6.7) enum classTagSeparator { Dash, Underscore }
(since 6.7) enum classTimestampsToReturn { Source, Server, Both, Neither, Invalid }
(since 6.7) enumOption { NoOption, Tiny12FeaturesOnly }
(since 6.7) enum classRotation { None, Clockwise90, Clockwise180, Clockwise270 }

新增枚举值

新类型别名

(since 6.7) const_pointer
(since 6.7) pointer
(since 6.7) QRhiShaderResourceBindingSet
(since 6.7) EnabledFeatures2Modifier

新属性

新变量

新QML类型

新的QML属性

QML类型 ConvexMeshShape

(since 6.7) geometry : Geometry

QML类型 CustomMaterial

(since 6.7) destinationAlphaBlend : enumeration
(since 6.7) sourceAlphaBlend : enumeration

QML类型 GeoJsonData

(since 6.7) model : QVariant
(since 6.7) sourceUrl : QUrl

QML类型 HeightFieldShape

(since 6.7) image : Image

QML类型 Item

(since 6.7) focusPolicy : enumeration

QML类型 MediaPlayer

(since 6.7) autoPlay : bool

QML类型 PathText

(since 6.7) font.variableAxes : object

QML类型 PhysicsWorld

(since 6.7) numThreads : int
(since 6.7) reportKinematicKinematicCollisions : bool
(since 6.7) reportStaticKinematicCollisions : bool

QML类型 Rectangle

(since 6.7) bottomLeftRadius : real
(since 6.7) bottomRightRadius : real
(since 6.7) topLeftRadius : 实数
(since 6.7) topRightRadius : 实数

QML 类型 Shape

(since 6.7) horizontalAlignment : 枚举
(since 6.7) verticalAlignment : 枚举

QML 类型 ShapePath

(since 6.7) pathHints : PathHints

QML 类型 SystemPalette

(since 6.7) accent : 颜色

QML 类型 Text

(since 6.7) font.variableAxes : 对象

QML 类型 TextDocument

(初步) errorString : 字符串
(初步) modified : 布尔
(初步) source : url
(初步) status : 枚举

QML 类型 TextEdit

(初步) cursorSelection : QtQuick::TextSelection
(since 6.7) font.variableAxes : 对象

QML 类型 TextInput

(since 6.7) font.variableAxes : 对象

QML 类型 Texture

(since 6.7) textureProvider : RenderExtension

QML 类型 TriangleMeshShape

(since 6.7) geometry : 几何体

QML 类型 Video

(since 6.7) autoPlay : 布尔

QML 类型 View3D

(since 6.7) effectiveTextureSize : 大小
(since 6.7) explicitTextureHeight : 整数
(since 6.7) explicitTextureWidth : 整数

QML 类型 Window

(初步) parent : 变量

QML 类型 cameraDevice

(since 6.7) correctionAngle : QtVideo::Rotation

新的 QML 方法

QML 类型 StackView

(自 6.7 版本以来) 项目popCurrentItem(操作)
(自 6.7 版本以来) 项目popToIndex(索引, 操作)
(自 6.7 版本以来) 项目popToItem(项目, 操作)
(自 6.7 版本以来) 项目pushItem(项目, 属性, 操作)
(自 6.7 版本以来) 项目pushItem(组件, 属性, 操作)
(自 6.7 版本以来) 项目pushItem(url, 属性, 操作)
(自 6.7 版本以来) 项目pushItems(项目列表, 操作)
(自 6.7 版本以来) 项目replaceCurrentItem(项目列表, 操作)
(自 6.7 版本以来) 项目replaceCurrentItem(项目, 属性, 操作)
(自 6.7 版本以来) 项目replaceCurrentItem(组件, 属性, 操作)
(自 6.7 版本以来) 项目replaceCurrentItem(url, 属性, 操作)

QML 类型 TextDocument

(preliminary) void保存()
(preliminary) voidsaveAs(url url)

QML 类型 WaylandSeat

(自6.7起) voidsendUnicodeKeyPressEvent(uint unicode)
(自6.7起) voidsendUnicodeKeyReleaseEvent(uint unicode)

© 2024 Qt 公司有限公司。本文件中包含的文档贡献归各自所有者所有版权。附带的文档受免费软件基金会发布的 GNU 自由文档许可证版本 1.3 条款的约束。Qt 及相关标志是 Qt 公司在芬兰和其他全球国家/地区的商标。所有其他商标均为各自所有者的财产。