RedPanda-CPP/RedPandaIDE/settingsdialog/settingswidget.h

43 lines
905 B
C
Raw Normal View History

2021-04-16 22:04:48 +08:00
#ifndef SETTINGSWIDGET_H
#define SETTINGSWIDGET_H
#include <QWidget>
2021-04-18 11:25:40 +08:00
class QAbstractItemView;
2021-04-16 22:04:48 +08:00
class SettingsWidget : public QWidget
{
Q_OBJECT
public:
explicit SettingsWidget(const QString& name, const QString& group, QWidget *parent = nullptr);
virtual void init();
void load();
void save();
signals:
void settingsChanged(bool changed);
2021-04-16 22:04:48 +08:00
protected:
virtual void doLoad() = 0;
virtual void doSave() = 0;
2021-04-18 11:25:40 +08:00
void connectAbstractItemView(QAbstractItemView* pView);
void disconnectAbstractItemView(QAbstractItemView* pView);
2021-04-16 22:04:48 +08:00
public:
const QString& group();
const QString& name();
bool isSettingsChanged();
2021-04-18 11:25:40 +08:00
void connectInputs();
void disconnectInputs();
2021-04-16 22:04:48 +08:00
public slots:
void setSettingsChanged();
void clearSettingsChanged();
2021-04-18 11:25:40 +08:00
private:
2021-04-16 22:04:48 +08:00
private:
bool mSettingsChanged;
QString mGroup;
QString mName;
};
#endif // SETTINGSWIDGET_H