2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2022 The Qt Company Ltd.
|
2022-12-21 10:12:09 +01:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2022-07-28 16:13:35 +02:00
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <cppeditor/cppcodestylesettingspage.h>
|
|
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
|
2022-07-22 09:44:47 +02:00
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
|
class QCheckBox;
|
|
|
|
|
class QComboBox;
|
|
|
|
|
class QLabel;
|
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
|
2022-07-28 16:13:35 +02:00
|
|
|
namespace ProjectExplorer { class Project; }
|
|
|
|
|
|
|
|
|
|
namespace ClangFormat {
|
|
|
|
|
|
|
|
|
|
class ClangFormatGlobalConfigWidget : public CppEditor::CppCodeStyleWidget
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
explicit ClangFormatGlobalConfigWidget(ProjectExplorer::Project *project = nullptr,
|
|
|
|
|
QWidget *parent = nullptr);
|
|
|
|
|
~ClangFormatGlobalConfigWidget() override;
|
|
|
|
|
void apply() override;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
void initCheckBoxes();
|
|
|
|
|
void initIndentationOrFormattingCombobox();
|
2022-08-19 15:20:22 +02:00
|
|
|
void initOverrideCheckBox();
|
2023-01-10 14:29:49 +01:00
|
|
|
void initUseGlobalSettingsCheckBox();
|
2022-07-28 16:13:35 +02:00
|
|
|
|
2022-08-19 15:20:22 +02:00
|
|
|
bool projectClangFormatFileExists();
|
|
|
|
|
|
|
|
|
|
ProjectExplorer::Project *m_project;
|
|
|
|
|
|
|
|
|
|
QLabel *m_projectHasClangFormat;
|
2022-07-22 09:44:47 +02:00
|
|
|
QLabel *m_formattingModeLabel;
|
|
|
|
|
QComboBox *m_indentingOrFormatting;
|
|
|
|
|
QCheckBox *m_formatWhileTyping;
|
|
|
|
|
QCheckBox *m_formatOnSave;
|
2022-08-19 15:20:22 +02:00
|
|
|
QCheckBox *m_overrideDefault;
|
2023-01-10 14:29:49 +01:00
|
|
|
QCheckBox *m_useGlobalSettings;
|
2022-07-28 16:13:35 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace ClangFormat
|