1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-21 09:23:53 +00:00
openmw/apps/opencs/model/settings/settingcontainer.hpp
graffy76 a8b45e0a13 Three primary changes:
1.  Declared QStringPair::isEmpty() const
2.  Split the CsSettings namespace into two: CSMSettings and
CSVSettings. (Required splitting the support.hpp file)
3.  Declared several classes as _noqt in CMakeLists.txt for OpenCS
2013-05-11 05:55:46 -05:00

37 lines
1,020 B
C++

#ifndef SETTINGCONTAINER_HPP
#define SETTINGCONTAINER_HPP
#include <QObject>
class QStringList;
namespace CSMSettings
{
class SettingContainer : public QObject
{
Q_OBJECT
QString *mValue;
QStringList *mValues;
public:
explicit SettingContainer (QObject *parent = 0);
explicit SettingContainer (const QString &value, QObject *parent = 0);
virtual QString getName() const {return "";}
void insert (const QString &value);
void update (const QString &value, int index = 0);
QString getValue (int index = -1) const;
inline QStringList *getValues() const { return mValues; }
int count() const;
//test for empty container
//useful for default-constructed containers returned by QMap when invalid key is passed
inline bool isEmpty() const { return (!mValue && !mValues); }
inline bool isMultiValue() const { return (mValues); }
};
}
#endif // SETTINGCONTAINER_HPP