1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 18:49:58 +00:00
openmw-tes3mp/apps/opencs/view/settings/abstractpage.hpp

60 lines
1.1 KiB
C++
Raw Normal View History

2013-05-08 01:36:34 +00:00
#ifndef ABSTRACTPAGE_HPP
#define ABSTRACTPAGE_HPP
#include <QWidget>
#include <QList>
#include <QLayout>
#include "abstractblock.hpp"
class SettingMap;
class SettingList;
namespace CSVSettings {
2013-05-08 01:36:34 +00:00
typedef QList<AbstractBlock *> AbstractBlockList;
class AbstractPage: public QWidget
{
protected:
AbstractBlockList mAbstractBlocks;
public:
AbstractPage(QWidget *parent = 0);
AbstractPage (const QString &pageName, QWidget* parent = 0);
~AbstractPage();
virtual void setupUi()=0;
virtual void initializeWidgets (const CSMSettings::SettingMap &settings) = 0;
2013-05-08 01:36:34 +00:00
CSMSettings::SettingList *getSettings();
2013-05-08 01:36:34 +00:00
void setObjectName();
protected:
template <typename S, typename T>
AbstractBlock *buildBlock (T &def)
{
S *block = new S (this);
int ret = block->build (def);
if (ret < 0)
return 0;
QWidget::layout()->addWidget (block->getGroupBox());
return block;
}
};
}
#endif // ABSTRACTPAGE_HPP