Qt 6.2 中的新类和函数

本页包含 Qt 6.2 中引入的所有新类和函数的完整列表。

新命名空间

(预览) 命名空间QtAndroidPrivate

新类

新成员函数

QAbstractAxis

(自 6.2) voidlabelsTruncatedChanged(bool labelsTruncated)
(自 6.2) voidtruncateLabelsChanged(bool truncateLabels)

QAbstractProxyModel

(自 6.2) QModelIndexcreateSourceIndex(int row, int col, void *internalPtr) const

QAbstractSocket

(自 6.2) boolbind(QHostAddress::SpecialAddress addr, quint16 port, QAbstractSocket::BindMode mode)

QBarSet

(自 6.2) void取消选择所有柱状图()
(自 6.2) voiddeselectBar(int index)
(自 6.2) voiddeselectBars(const QList<int> &indexes)
(自 6.2) boolisBarSelected(int index) const
(自 6.2) void选择所有柱状图()
(自 6.2) voidselectBar(int index)
(自 6.2) voidselectBars(const QList<int> &indexes)
(自 6.2) QList<int>selectedBars() const
(自 6.2) QColorselectedColor() const
(自 6.2) voidsetBarSelected(int index, bool selected)
(自 6.2) voidsetSelectedColor(const QColor &color)
(自 6.2) voidtoggleSelection(const QList<int> &indexes)

QBluetoothDeviceDiscoveryAgent

(自 6.2) voiderrorOccurred(QBluetoothDeviceDiscoveryAgent::Error error)

QBluetoothDeviceInfo

(自 6.2) voidsetName(const QString &name)

QBluetoothLocalDevice

(自 6.2) voiderrorOccurred(QBluetoothLocalDevice::Error error)

QBluetoothServer

(自 6.2) voiderrorOccurred(QBluetoothServer::Error error)

QBluetoothServiceDiscoveryAgent

(自 6.2) voiderrorOccurred(QBluetoothServiceDiscoveryAgent::Error error)

QBluetoothSocket

(自 6.2) voiderrorOccurred(QBluetoothSocket::SocketError error)

QByteArray

(since 6.2) qsizetypelastIndexOf(QByteArrayView bv) const

QByteArrayView

(since 6.2) intcompare(QByteArrayView bv, Qt::CaseSensitivity cs) const
(since 6.2) qsizetypelastIndexOf(QByteArrayView bv) const

QCanBusDevice

(since 6.2) virtual QCanBusDeviceInfodeviceInfo() const

QCanBusDeviceInfo

(since 6.2) QStringplugin() const

QColorSpace

(since 6.2) QStringdescription() const
(自 6.2) voidsetDescription(const QString &description)

QFileInfo

(since 6.2) std::filesystem::pathfilesystemJunctionTarget() const
(since 6.2) QStringjunctionTarget() const

QFlags

(since 6.2) QFlags<T>fromInt(QFlags<T>::Int i)
(since 6.2) QFlags<T>operator&(QFlags<T> other) const
(since 6.2) QFlags<T> &operator&=(QFlags<T> mask)
(since 6.2) size_tqHash(QFlags<Enum> flags, size_t seed)
(自 6.2) booltestAnyFlag(Enum flag) const
(自 6.2) booltestAnyFlags(QFlags<T> flags) const
(自 6.2) booltestFlags(QFlags<T> flags) const
(since 6.2) QFlags<T>::InttoInt() const

QGeoAddress

(since 6.2) QGeoAddress &operator=(QGeoAddress &other)
(自 6.2) voidsetStreetNumber(const QString &streetNumber)
(since 6.2) QStringstreetNumber() const

QGeoAreaMonitorInfo

(since 6.2) QGeoAreaMonitorInfo &operator=(QGeoAreaMonitorInfo &&other)

QGeoAreaMonitorSource

(自 6.2) virtual QVariantbackendProperty(const QString &name) const
(自 6.2) virtual boolsetBackendProperty(const QString &name, const QVariant &value)

QGeoCoordinate

(自 6.2) QGeoCoordinate &operator=(QGeoCoordinate &&other)

QGeoLocation

(自 6.2) QGeoShapeboundingShape() const
(自 6.2) QGeoLocation &operator=(QGeoLocation &&other)
(自 6.2) voidsetBoundingShape(const QGeoShape &boundingShape)

QGeoPositionInfo

(自 6.2) QGeoPositionInfo &operator=(QGeoPositionInfo &&other)

QGeoSatelliteInfo

(自 6.2) QGeoSatelliteInfo &operator=(QGeoSatelliteInfo &&other)

QGeoSatelliteInfoSource

(自 6.2) virtual QVariantbackendProperty(const QString &name) const
(自 6.2) virtual boolsetBackendProperty(const QString &name, const QVariant &value)

QGraphicsSceneEvent

(自 6.2) quint64timestamp() const

QGraphicsSceneWheelEvent

(自 6.2) boolisInverted() const
(自 6.2) Qt::ScrollPhasephase() const
(自 6.2) QPointpixelDelta() const

QImage

(自 6.2) QSizeFdeviceIndependentSize() const
(自 6.2) QImagefromData(QByteArrayView data, const char *format)
(自 6.2) boolloadFromData(QByteArrayView data, const char *format)

QJSEngine

(自 6.2) QJSValuenewSymbol(const QString &name)

QJniEnvironment

(自 6.2) jfieldIDfindField(jclass clazz, const char *fieldName, const char *signature)
(自 6.2) jmethodIDfindMethod(jclass clazz, const char *methodName, const char *signature)
(自 6.2) jfieldIDfindStaticField(jclass clazz, const char *fieldName, const char *signature)
(自 6.2) jmethodIDfindStaticMethod(jclass clazz, const char *methodName, const char *signature)
(自 6.2) boolisValid() const

QJniObject

(自 6.2) QByteArrayclassName() const
(since 6.2) jclassobjectClass() const

QLatin1StringView

(since 6.2) qsizetypelastIndexOf(QStringView str, Qt::CaseSensitivity cs) const
(since 6.2) qsizetypelastIndexOf(QLatin1StringView l1, Qt::CaseSensitivity cs) const

QLegend

(自 6.2) voidattachedToChartChanged(bool attached)
(自 6.2) boolisInteractive() const
(自 6.2) voidsetInteractive(bool interactive)

QLocale

(since 6.2) QLocale::TerritorycodeToTerritory(QStringView territoryCode)
(since 6.2) QStringnativeTerritoryName() const
(since 6.2) QLocale::Territoryterritory() const
(since 6.2) QStringterritoryToCode(QLocale::Territory territory)
(since 6.2) QStringterritoryToString(QLocale::Territory territory)

QLockFile

(自 6.2) voidsetStaleLockTime(std::chrono::milliseconds staleLockTime)
(since 6.2) std::chrono::millisecondsstaleLockTimeAsDuration() const
(自 6.2) booltryLock(std::chrono::milliseconds timeout)

QLowEnergyCharacteristic

(since 6.2) QLowEnergyDescriptorclientCharacteristicConfiguration() const

QLowEnergyController

(since 6.2) QLowEnergyController *createPeripheral(const QBluetoothAddress &localDevice, QObject *parent)
(自 6.2) voiderrorOccurred(QLowEnergyController::Error newError)
(since 6.2) intmtu() const

QLowEnergyService

(自 6.2) voiderrorOccurred(QLowEnergyService::ServiceError newError)

QMetaMethod

(自 6.2) boolisConst() const

QMetaObject

(since 6.2) QMetaTypemetaType() const

QModbusRtuSerialServer

(since 6.2) intinterFrameDelay() const
(自 6.2) voidsetInterFrameDelay(int microseconds)

QNativeGestureEvent

(since 6.2) QPointFdelta() const
(since 6.2) intfingerCount() const

QAndroidApplication

(since 6.2) QJniObjectcontext()
(自 6.2) voidhideSplashScreen(int duration)
(自 6.2) boolisActivityContext()
(since 6.2) QFuture<QVariant>runOnAndroidMainThread(const std::function<QVariant ()> &runnable, const QDeadlineTimer timeout)
(since 6.2) intsdkVersion()

QNdefFilter

(自 6.2) boolmatch(const QNdefMessage &message) const

QNdefMessage

(since 6.2) QNdefMessage &operator=(const QNdefMessage &other)
(since 6.2) QNdefMessage &operator=(QNdefMessage &&other)

QNdefRecord

(自 6.2) voidclear()

QNearFieldManager

(自 6.2) boolisEnabled() const
(自 6.2) voidsetUserInformation(const QString &信息)
(自 6.2) voidtargetDetectionStopped()

QNetworkCacheMetaData

(自 6.2) QDebugoperator<<(QDebug 调试, const QNetworkAddressEntry &条目)

QNetworkRequest

(自 6.2) qint64decompressedSafetyCheckThreshold() const
(自 6.2) voidsetDecompressedSafetyCheckThreshold(qint64 阈值)

QPixmap

(自 6.2) QSizeFdeviceIndependentSize() const

QQmlContext

(自 6.2) QObject *objectForName(const QString &名称) const

QQmlListReference

(since 6.2) qsizetypesize() const

QQuickItemGrabResult

(自 6.2) boolsaveToFile(const QUrl &文件路径) const

QQuickRenderTarget

(自 6.2) QQuickRenderTargetfromOpenGLRenderBuffer(uint 渲染缓冲区ID, const QSize &像素大小, int 样本数量)

QSqlQuery

(自 6.2) QSqlQuery &operator=(QSqlQuery &&其他)
(自 6.2) voidswap(QSqlQuery &其他)

QSqlQueryModel

(自 6.2) voidsetQuery(QSqlQuery &&查询)

QString

(since 6.2) qsizetypelastIndexOf(QLatin1StringView 字符串, Qt::CaseSensitivity 敏感度) const
(since 6.2) qsizetypelastIndexOf(const QString &字符串, Qt::CaseSensitivity 敏感度) const
(since 6.2) qsizetypelastIndexOf(QStringView 字符串, Qt::CaseSensitivity 敏感度) const
(since 6.2) qsizetypelastIndexOf(const QRegularExpression &正则表达式, QRegularExpressionMatch *匹配) const

QStringView

(since 6.2) qsizetypelastIndexOf(QStringView 字符串, Qt::CaseSensitivity 敏感度) const
(since 6.2) qsizetypelastIndexOf(QLatin1StringView l1, Qt::CaseSensitivity 敏感度) const
(since 6.2) qsizetypelastIndexOf(const QRegularExpression &正则表达式, QRegularExpressionMatch *匹配) const

QTimeZone

(since 6.2) QLocale::Territoryterritory() const

QUntypedBindable

(since 6.2) QMetaTypemetaType() const

QWaylandBufferRef

(自 6.2) boolhasProtectedContent() const

QWebEnginePage

(自 6.2) voidloadingChanged(const QWebEngineLoadingInfo &loadingInfo)
(自 6.2) voidnavigationRequested(QWebEngineNavigationRequest &请求)
(自 6.2) voidnewWindowRequested(QWebEngineNewWindowRequest &请求)

QWebEngineProfile

(自 6.2) voidrequestIconForIconURL(const QUrl &url, int 所需像素大小, std::function<void (const QIcon &, const QUrl &)> 图标可回调) const
(自 6.2) voidrequestIconForPageURL(const QUrl &url, int 所需像素大小, std::function<void (const QIcon &, const QUrl &, const QUrl &)> 图标可回调) const

QWebEngineView

(自 6.2) QWebEngineView *forPage(const QWebEnginePage *page)
(since 6.2) QWebEngineContextMenuRequest *lastContextMenuRequest() const
(自 6.2) voidpdfPrintingFinished(const QString &filePath, bool success)
(自 6.2) voidprint(QPrinter *printer)
(自 6.2) voidprintFinished(bool success)
(自 6.2) voidprintRequested()
(自 6.2) voidprintToPdf(const QString &filePath, const QPageLayout &layout, const QPageRanges &ranges)
(自 6.2) voidprintToPdf(const std::function<void (const QByteArray &)> &resultCallback, const QPageLayout &layout, const QPageRanges &ranges)

QWebSocket

(自 6.2) voidalertReceived(QSsl::AlertLevel level, QSsl::AlertType type, const QString &description)
(自 6.2) voidalertSent(QSsl::AlertLevel level, QSsl::AlertType type, const QString &description)
(自 6.2) void继续中断的手势()
(自 6.2) voidhandshakeInterruptedOnError(const QSslError &error)
(自 6.2) voidpeerVerifyError(const QSslError &error)

QWebSocketServer

(自 6.2) voidalertReceived(QSsl::AlertLevel level, QSsl::AlertType type, const QString &description)
(自 6.2) voidalertSent(QSsl::AlertLevel level, QSsl::AlertType type, const QString &description)
(自 6.2) voidhandshakeInterruptedOnError(const QSslError &error)

QXYSeries

(since 6.2) QPair<qreal, qreal>bestFitLineEquation(bool &ok) const
(自 6.2) voidclearPointConfiguration(const int index)
(自 6.2) voidclearPointConfiguration(const int index, const QXYSeries::PointConfiguration key)
(自 6.2) voidclearPointsConfiguration()
(自 6.2) voidclearPointsConfiguration(const QXYSeries::PointConfiguration key)
(自 6.2) voidcolorBy(const QList<qreal> &sourceData, const QLinearGradient &gradient)
(自 6.2) void取消所有点的选择()
(自 6.2) voiddeselectPoint(int index)
(自 6.2) voiddeselectPoints(const QList<int> &indexes)
(自 6.2) boolisPointSelected(int index)
(since 6.2) const QImage &lightMarker() const
(自 6.2) voidlightMarkerChanged(const QImage &lightMarker)
(since 6.2) qrealmarkerSize() const
(since 6.2) QHash<QXYSeries::PointConfiguration, QVariant>pointConfiguration(const int index) const
(since 6.2) QHash<int, QHash<QXYSeries::PointConfiguration, QVariant>>pointsConfiguration() const
(自 6.2) void选择所有点()
(自 6.2) voidselectPoint(int index)
(自 6.2) voidselectPoints(const QList<int> &indexes)
(since 6.2) const QImage &selectedLightMarker() const
(自 6.2) QList<int>selectedPoints() const
(自 6.2) voidsetLightMarker(const QImage &lightMarker)
(自 6.2) voidsetMarkerSize(qreal size)
(自 6.2) voidsetPointConfiguration(const int index, const QHash<QXYSeries::PointConfiguration, QVariant> &configuration)
(自 6.2) voidsetPointConfiguration(const int index, const QXYSeries::PointConfiguration key, const QVariant &value)
(自 6.2) voidsetPointSelected(int index, bool selected)
(自 6.2) voidsetPointsConfiguration(const QHash<int, QHash<QXYSeries::PointConfiguration, QVariant>> &pointsConfiguration)
(自 6.2) voidsetSelectedLightMarker(const QImage &selectedLightMarker)
(自 6.2) voidsizeBy(const QList<qreal> &sourceData, const qreal minSize, const qreal maxSize)
(自 6.2) voidtoggleSelection(const QList<int> &indexes)

命名空间中的新函数

(自 6.2) voidbeginPropertyUpdateGroup()
(自 6.2) boolbindService(const QAndroidIntent &serviceIntent, const QAndroidServiceConnection &serviceConnection, QtAndroidPrivate::BindFlags flags)
(初期) QFuture<QtAndroidPrivate::PermissionResult>checkPermission(const QString &permission)
(自 6.2) voidendPropertyUpdateGroup()
(初期) QFuture<QtAndroidPrivate::PermissionResult>requestPermission(const QString &permission)
(自 6.2) voidstartActivity(const QJniObject &intent, int receiverRequestCode, std::function.lt;void (int, int, const QJniObject &)> callbackFunc)
(自 6.2) voidstartActivity(const QAndroidIntent &intent, int receiverRequestCode, QAndroidActivityResultReceiver *resultReceiver)
(自 6.2) voidstartActivity(const QJniObject &intent, int receiverRequestCode, QAndroidActivityResultReceiver *resultReceiver)
(自 6.2) voidstartIntentSender(const QJniObject &intentSender, int receiverRequestCode, QAndroidActivityResultReceiver *resultReceiver)

新全局函数

(自6.2起) std::underlying_type_t<Enum>qToUnderlying(Enum e)
(自6.2起) const char *qWebEngineChromiumVersion()
(自6.2起) const char *qWebEngineVersion()

新宏

(自6.2起) PRIXQUINTPTR
(自6.2起) PRIdQINTPTR
(自6.2起) PRIdQPTRDIFF
(自6.2起) PRIdQSIZETYPE
(自6.2起) PRIiQINTPTR
(自6.2起) PRIiQPTRDIFF
(自6.2起) PRIiQSIZETYPE
(自6.2起) PRIoQUINTPTR
(自6.2起) PRIuQUINTPTR
(自6.2起) PRIxQUINTPTR
(自6.2起) Q_IMPORT_QML_PLUGIN(PluginName)

新枚举类型

(自6.2起) enumRubberBand { NoRubberBand, VerticalRubberBand, HorizontalRubberBand, RectangleRubberBand, ClickThroughRubberBand }
(自6.2起) enumSocketOption { NoOptions, AbstractNamespaceOption }
(自6.2起) enumDiscoveryMode { FullDiscovery, SkipValueDiscovery }
(自6.2起) enumEditFlag { CanUndo, CanRedo, CanCut, CanCopy, CanPaste, …, CanEditRichly }
(自6.2起) enumMediaFlag { MediaInError, MediaPaused, MediaMuted, MediaLoop, MediaCanSave, …, MediaCanRotate }
(自6.2起) enumMediaType { MediaTypeNone, MediaTypeImage, MediaTypeVideo, MediaTypeAudio, MediaTypeCanvas, …, MediaTypePlugin }
(自6.2起) enum classPointConfiguration { Color, Size, Visibility, LabelVisibility, LabelFormat }
(自6.2起) enum classBindFlag { None, AutoCreate, DebugUnbind, NotForeground, AboveClient, …, ExternalService }

新枚举值

新属性

新变量

(自6.2起) CCCDDisable
(自6.2起) CCCDEnableIndication
(自6.2起) CCCDEnableNotification

新 QML 类型

新 QML 属性

QML 类型 ColorGroup

(自6.2起) placeholderText : 颜色

QML 类型 Image

(自6.2起) mirrorVertically : 布尔值

QML 类型 SystemPalette

(自6.2起) placeholderText : 颜色

QML 类型 TableView

(自6.2起) selectionModel : ItemSelectionModel

QML 类型 Texture

(自6.2起) autoOrientation : 布尔值

新 QML 方法

QML 类型 Locale

(自 6.2) 字符串formattedDataSize(int bytes, int precision, DataSizeFormat format)

QML 类型 TableView

(自 6.2) 实数columnWidth(int column)
(自 6.2) 实数implicitColumnWidth(int column)
(自 6.2) 实数implicitRowHeight(int row)
(自 6.2) boolisColumnLoaded(int column)
(自 6.2) boolisRowLoaded(int row)
(自 6.2) 实数rowHeight(int row)

QML 类型 View3D

(自 6.2) List<PickResult>pickAll(float x, float y)
(自 6.2) PickResultrayPick(vector3d origin, vector3d direction)
(自 6.2) List<PickResult>rayPickAll(vector3d origin, vector3d direction)

© 2024 Qt公司版权所有。本文件的文档贡献均为各自所有者的版权。本提供的文档按照由自由软件基金会发布的版本1.3 GNU自由文档许可证 的条款进行许可。Qt及其相应标志是芬兰以及全球其他国家的Qt公司注册商标。