CppEditor: Add quickfix for creating a forward declaration

In header files, a forward declaration is often preferable to including
another header file, so let's offer this as a quickfix.

Fixes: QTCREATORBUG-23444
Change-Id: Ib50550abb5337098e4122e65e2af42a66742d6f6
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
Christian Kandeler
2020-05-22 16:56:40 +02:00
parent 7c92db106d
commit 6c4b8b10b7
4 changed files with 373 additions and 9 deletions

View File

@@ -71,6 +71,18 @@ private:
QString m_include;
};
class AddForwardDeclForUndefinedIdentifierOp: public CppQuickFixOperation
{
public:
AddForwardDeclForUndefinedIdentifierOp(const CppQuickFixInterface &interface, int priority,
const QString &fqClassName, int symbolPos);
private:
void perform() override;
const QString m_className;
const int m_symbolPos;
};
/*!
Rewrite
a op b