EHM DAL 0.2.3
Data abstraction layer for Eastside Hockey Manager
Loading...
Searching...
No Matches
abstract_data_type.h
1#pragma once
2
3// Qt headers
4#include <QVariant>
5
6namespace ehm_dal::data_types {
11{
12public:
14
15 // Get data
20 QVariant data(const qint32 role = Qt::DisplayRole) const;
21
22 // Set data
23 Q_DECL_DEPRECATED void set(const QVariant &value,
24 const qint32 role = Qt::EditRole); // TODO to be deprecated
30 void setData(const QVariant &value, const qint32 role = Qt::EditRole);
31
32private:
33 virtual QVariant value(const qint32 role = Qt::DisplayRole) const = 0;
34 virtual void setValue(const QVariant &value) = 0;
35};
36
37} // namespace ehm_dal::data_types
The AbstractDataType class provides common virtual functions for all integral game data types.
Definition: abstract_data_type.h:11
void setData(const QVariant &value, const qint32 role=Qt::EditRole)
Sets the role data for the item at to value.
QVariant data(const qint32 role=Qt::DisplayRole) const
Returns the data stored under the given role for the item.
namespace ehm_dal::data_types
Definition: attribute.h:6