本页内容

QQmlSA::Method Class

class QQmlSA::Method

表示一个 QML 方法。更多...

头文件: #include <qqmlsa.h>
CMake: find_package(Qt6 REQUIRED COMPONENTS QmlCompiler)
target_link_libraries(mytarget PRIVATE Qt6::QmlCompiler)
状态: 技术预览

该类目前处于技术预览阶段,内容可能会有变动。

公共类型

(technology preview) class Methods

公共函数

Method()
Method(const QQmlSA::Method &other)
Method(QQmlSA::Method &&other)
~Method()
QString methodName() const
QQmlSA::MethodType methodType() const
QQmlSA::SourceLocation sourceLocation() const
QQmlSA::Method &operator=(QQmlSA::Method &&other)
QQmlSA::Method &operator=(const QQmlSA::Method &other)
bool operator!=(const QQmlSA::Method &lhs, const QQmlSA::Method &rhs)
bool operator==(const QQmlSA::Method &lhs, const QQmlSA::Method &rhs)

详细说明

成员函数文档

Method::Method()

创建一个新的 Method 对象。

Method::Method(const QQmlSA::Method &other)

创建other 的副本。

[noexcept] Method::Method(QQmlSA::Method &&other)

通过“Move”构造一个 Method 实例。

[noexcept] Method::~Method()

销毁该方法。

QString Method::methodName() const

返回此方法的名称。

QQmlSA::MethodType Method::methodType() const

返回此方法的类型。

QQmlSA::SourceLocation Method::sourceLocation() const

返回 QML 代码中定义此方法的位置。

[noexcept] QQmlSA::Method &Method::operator=(QQmlSA::Method &&other)

将 `other ` 移入并赋值给此 `Method` 实例。

QQmlSA::Method &Method::operator=(const QQmlSA::Method &other)

将other 赋值给此Method实例。

相关的非成员

bool operator!=(const QQmlSA::Method &lhs, const QQmlSA::Method &rhs)

如果lhs 和rhs 不相等,则返回true ;否则返回false 。

bool operator==(const QQmlSA::Method &lhs, const QQmlSA::Method &rhs)

如果 `lhs ` 和 `rhs ` 相等,则返回 `true `;否则返回 `false `。

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.