Cppcheck: Add ability to manually run cppcheck

Run cppcheck on selected files from current project via "Analyze"->"Cppcheck...."
Show results in a separate view in the same manner as ClangTools plugin.

Fixes: QTCREATORBUG-21673
Change-Id: Ibcaf4057a387a990f1da59025f15ba58f996953f
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
Sergey Morozov
2019-11-03 23:00:16 +03:00
parent 07490e76de
commit 0aa95576c2
20 changed files with 936 additions and 126 deletions

View File

@@ -27,7 +27,16 @@
#include <coreplugin/dialogs/ioptionspage.h>
#include <QCoreApplication>
#include <QPointer>
#include <QWidget>
class QLineEdit;
class QCheckBox;
namespace Utils {
class PathChooser;
}
namespace Cppcheck {
namespace Internal {
@@ -58,6 +67,32 @@ public:
bool guessArguments = true;
};
class OptionsWidget final : public QWidget
{
Q_DECLARE_TR_FUNCTIONS(CppcheckOptionsPage)
public:
explicit OptionsWidget(QWidget *parent = nullptr);
void load(const CppcheckOptions &options);
void save(CppcheckOptions &options) const;
private:
Utils::PathChooser *m_binary = nullptr;
QLineEdit *m_customArguments = nullptr;
QLineEdit *m_ignorePatterns = nullptr;
QCheckBox *m_warning = nullptr;
QCheckBox *m_style = nullptr;
QCheckBox *m_performance = nullptr;
QCheckBox *m_portability = nullptr;
QCheckBox *m_information = nullptr;
QCheckBox *m_unusedFunction = nullptr;
QCheckBox *m_missingInclude = nullptr;
QCheckBox *m_inconclusive = nullptr;
QCheckBox *m_forceDefines = nullptr;
QCheckBox *m_showOutput = nullptr;
QCheckBox *m_addIncludePaths = nullptr;
QCheckBox *m_guessArguments = nullptr;
};
class CppcheckOptionsPage final : public Core::IOptionsPage
{
Q_OBJECT