Blame view

src/tablemodel/modeldataitem.h 627 Bytes
1dce31e3   Peter M. Groen   Setting up tablem...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
  #pragma once
  
  #include <QHash>
  #include <QString>
  #include <QVariant>
  
  namespace osdev {
  namespace components {
  namespace datamodels {
  
  class ModelDataItem
  {
  public:
      ModelDataItem();
      ModelDataItem(const QHash<QString, QVariant> &data_item);
  
      void        setData(const QString &name, const QVariant &value);
      QVariant    getData(const QString &name) const;
      int         items();
      QStringList getKeys() { return m_itemHash.keys(); }
  
      QString     asString();
  
  private:
      QHash<QString, QVariant> m_itemHash;
  };
  
  }   // End namespace datamodels
  }   // End namespace components
  }   // End namespace osdev