forked from qt-creator/qt-creator
CppTools: Apply new SettingsPage patterns
Change-Id: Id7410041d5813dc3df9aeb650074f961e394cd2d Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -30,52 +30,14 @@
|
||||
#include <coreplugin/dialogs/ioptionspage.h>
|
||||
|
||||
#include <QPointer>
|
||||
#include <QWidget>
|
||||
|
||||
QT_FORWARD_DECLARE_CLASS(QComboBox)
|
||||
QT_FORWARD_DECLARE_CLASS(QSettings)
|
||||
|
||||
namespace CppTools {
|
||||
|
||||
namespace Internal {
|
||||
|
||||
namespace Ui { class CppCodeModelSettingsPage; }
|
||||
|
||||
class CppCodeModelSettingsWidget: public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
CppCodeModelSettingsWidget();
|
||||
~CppCodeModelSettingsWidget() override;
|
||||
|
||||
void setSettings(const QSharedPointer<CppCodeModelSettings> &s);
|
||||
void applyToSettings() const;
|
||||
|
||||
private:
|
||||
void setupGeneralWidgets();
|
||||
void setupClangCodeModelWidgets();
|
||||
|
||||
bool applyGeneralWidgetsToSettings() const;
|
||||
bool applyClangCodeModelWidgetsToSettings() const;
|
||||
|
||||
private:
|
||||
Ui::CppCodeModelSettingsPage *m_ui = nullptr;
|
||||
QSharedPointer<CppCodeModelSettings> m_settings;
|
||||
};
|
||||
|
||||
class CppCodeModelSettingsPage: public Core::IOptionsPage
|
||||
class CppCodeModelSettingsPage final : public Core::IOptionsPage
|
||||
{
|
||||
public:
|
||||
explicit CppCodeModelSettingsPage(QSharedPointer<CppCodeModelSettings> &settings);
|
||||
|
||||
QWidget *widget() override;
|
||||
void apply() override;
|
||||
void finish() override;
|
||||
|
||||
private:
|
||||
const QSharedPointer<CppCodeModelSettings> m_settings;
|
||||
QPointer<CppCodeModelSettingsWidget> m_widget;
|
||||
};
|
||||
|
||||
} // Internal namespace
|
||||
|
||||
Reference in New Issue
Block a user