本页内容

QQmlSA::FixSuggestion Class

class QQmlSA::FixSuggestion

针对源代码中某个问题提出的修复建议。更多内容...

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

该类处于技术预览阶段,相关内容可能会发生变更。

公共函数

FixSuggestion(const QString &description, const QQmlSA::SourceLocation &location, const QList<QQmlSA::DocumentEdit> &documentEdits = {})
FixSuggestion(const QString &description, const QQmlSA::SourceLocation &location, const QQmlSA::DocumentEdit &documentEdit)
FixSuggestion(const QQmlSA::FixSuggestion &other)
FixSuggestion(QQmlSA::FixSuggestion &&other)
~FixSuggestion()
void addDocumentEdit(const QQmlSA::DocumentEdit &edit)
QString description() const
QList<QQmlSA::DocumentEdit> documentEdits() const
QString fileName() const
bool isAutoApplicable() const
QQmlSA::SourceLocation location() const
void setAutoApplicable(bool autoApplicable = true)
void setFileName(const QString &fileName)
QQmlSA::FixSuggestion &operator=(QQmlSA::FixSuggestion &&other)
QQmlSA::FixSuggestion &operator=(const QQmlSA::FixSuggestion &other)
bool operator!=(const QQmlSA::FixSuggestion &lhs, const QQmlSA::FixSuggestion &rhs)
bool operator==(const QQmlSA::FixSuggestion &lhs, const QQmlSA::FixSuggestion &rhs)

详细说明

成员函数文档

FixSuggestion::FixSuggestion(const QString &description, const QQmlSA::SourceLocation &location, const QList<QQmlSA::DocumentEdit> &documentEdits = {})

创建一个 FixSuggestion 对象。

FixSuggestion::FixSuggestion(const QString &description, const QQmlSA::SourceLocation &location, const QQmlSA::DocumentEdit &documentEdit)

创建一个 FixSuggestion 对象。

FixSuggestion::FixSuggestion(const QQmlSA::FixSuggestion &other)

创建other 的副本。

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

通过 move 操作构造一个 FixSuggestion 实例。

[noexcept] FixSuggestion::~FixSuggestion()

销毁该FixSuggestion 实例。

void FixSuggestion::addDocumentEdit(const QQmlSA::DocumentEdit &edit)

将文档edit 添加到此修复程序的编辑列表中。

QString FixSuggestion::description() const

返回修复措施的描述。

QList<QQmlSA::DocumentEdit> FixSuggestion::documentEdits() const

返回应用此修复后将对文档进行的编辑列表。

QString FixSuggestion::fileName() const

返回此修复建议所适用的文件名。

另请参阅 setFileName()。

bool FixSuggestion::isAutoApplicable() const

返回此建议的修复方案是否可以自动应用。

QQmlSA::SourceLocation FixSuggestion::location() const

返回定位结果的位置。

void FixSuggestion::setAutoApplicable(bool autoApplicable = true)

将autoApplicable 设置为确定是否可以自动应用此建议的修复方案。

另请参阅 isAutoApplicable()。

void FixSuggestion::setFileName(const QString &fileName)

将fileName 设置为该修复建议所适用的文件名。

另请参阅 fileName()。

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

将other 通过Move操作赋值给此FixSuggestion 实例。

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

将other 分配给此FixSuggestion 实例。

相关非成员

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

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

bool operator==(const QQmlSA::FixSuggestion &lhs, const QQmlSA::FixSuggestion &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.