2016-02-22 17:18:18 +01:00
|
|
|
/****************************************************************************
|
|
|
|
|
**
|
|
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
|
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator.
|
|
|
|
|
**
|
|
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
|
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
|
|
|
|
**
|
|
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
|
|
|
|
**
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2016-02-26 17:50:38 +01:00
|
|
|
#include "cpptools_global.h"
|
|
|
|
|
|
2016-02-22 17:18:18 +01:00
|
|
|
#include "clangdiagnosticconfig.h"
|
|
|
|
|
|
2017-09-08 13:00:44 +02:00
|
|
|
#include <QHash>
|
2016-02-22 17:18:18 +01:00
|
|
|
#include <QWidget>
|
|
|
|
|
|
2018-01-26 10:27:58 +01:00
|
|
|
#include <memory>
|
|
|
|
|
|
2018-02-07 09:20:30 +01:00
|
|
|
QT_BEGIN_NAMESPACE
|
2019-10-21 14:59:57 +02:00
|
|
|
class QTabWidget;
|
2018-02-07 09:20:30 +01:00
|
|
|
QT_END_NAMESPACE
|
2018-01-26 10:27:58 +01:00
|
|
|
|
2016-02-22 17:18:18 +01:00
|
|
|
namespace CppTools {
|
|
|
|
|
|
2019-10-21 14:59:57 +02:00
|
|
|
class ClangDiagnosticConfig;
|
|
|
|
|
|
2018-01-26 10:27:58 +01:00
|
|
|
namespace Ui {
|
|
|
|
|
class ClangDiagnosticConfigsWidget;
|
2018-02-06 13:17:36 +01:00
|
|
|
class ClangBaseChecks;
|
2018-01-26 10:27:58 +01:00
|
|
|
}
|
2016-02-22 17:18:18 +01:00
|
|
|
|
2019-10-01 16:53:01 +02:00
|
|
|
class ConfigsModel;
|
2018-05-16 07:58:53 +02:00
|
|
|
|
2016-02-26 17:50:38 +01:00
|
|
|
class CPPTOOLS_EXPORT ClangDiagnosticConfigsWidget : public QWidget
|
2016-02-22 17:18:18 +01:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2019-10-01 16:53:01 +02:00
|
|
|
explicit ClangDiagnosticConfigsWidget(const ClangDiagnosticConfigs &configs,
|
2019-09-25 15:46:15 +02:00
|
|
|
const Core::Id &configToSelect,
|
|
|
|
|
QWidget *parent = nullptr);
|
2018-05-07 15:06:32 +02:00
|
|
|
~ClangDiagnosticConfigsWidget() override;
|
2016-02-22 17:18:18 +01:00
|
|
|
|
2019-10-21 14:59:57 +02:00
|
|
|
void sync();
|
|
|
|
|
|
2019-10-01 16:53:01 +02:00
|
|
|
ClangDiagnosticConfigs configs() const;
|
|
|
|
|
const ClangDiagnosticConfig currentConfig() const;
|
2016-02-22 17:18:18 +01:00
|
|
|
|
2019-10-21 14:59:57 +02:00
|
|
|
protected:
|
|
|
|
|
void updateConfig(const CppTools::ClangDiagnosticConfig &config);
|
|
|
|
|
virtual void syncExtraWidgets(const ClangDiagnosticConfig &) {}
|
|
|
|
|
QTabWidget *tabWidget() const;
|
2018-01-26 10:27:58 +01:00
|
|
|
|
2019-10-21 14:59:57 +02:00
|
|
|
private:
|
2016-02-22 17:18:18 +01:00
|
|
|
void onCopyButtonClicked();
|
2019-10-01 16:53:01 +02:00
|
|
|
void onRenameButtonClicked();
|
2016-02-22 17:18:18 +01:00
|
|
|
void onRemoveButtonClicked();
|
|
|
|
|
|
2019-01-31 10:16:28 +01:00
|
|
|
void onClangOnlyOptionsChanged();
|
2016-02-22 17:18:18 +01:00
|
|
|
|
2016-02-26 17:50:38 +01:00
|
|
|
void setDiagnosticOptions(const QString &options);
|
2017-09-08 13:00:44 +02:00
|
|
|
void updateValidityWidgets(const QString &errorMessage);
|
2016-02-26 17:50:38 +01:00
|
|
|
|
2019-01-31 10:16:28 +01:00
|
|
|
void connectClangOnlyOptionsChanged();
|
|
|
|
|
void disconnectClangOnlyOptionsChanged();
|
2016-02-26 17:50:38 +01:00
|
|
|
|
2016-02-22 17:18:18 +01:00
|
|
|
private:
|
|
|
|
|
Ui::ClangDiagnosticConfigsWidget *m_ui;
|
2019-10-01 16:53:01 +02:00
|
|
|
ConfigsModel *m_configsModel = nullptr;
|
2017-09-08 13:00:44 +02:00
|
|
|
QHash<Core::Id, QString> m_notAcceptedOptions;
|
2018-01-26 10:27:58 +01:00
|
|
|
|
2018-02-06 13:17:36 +01:00
|
|
|
std::unique_ptr<CppTools::Ui::ClangBaseChecks> m_clangBaseChecks;
|
|
|
|
|
QWidget *m_clangBaseChecksWidget = nullptr;
|
2016-02-22 17:18:18 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // CppTools namespace
|