-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcharacteristicsmodel.h
More file actions
46 lines (41 loc) · 1.61 KB
/
characteristicsmodel.h
File metadata and controls
46 lines (41 loc) · 1.61 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef IMAGECHARACTERISTICSMODEL_H
#define IMAGECHARACTERISTICSMODEL_H
#include "stdafx.h"
#include "characteristicsitem.h"
#include "imageitem.h"
#include <QList>
#include <QVariant>
#include <QAbstractItemModel>
#include <QModelIndex>
class CharacteristicsModel : public QAbstractItemModel
{
public:
CharacteristicsModel();
CharacteristicsModel(const QList<QList<QVariant> > &headers, QObject* parent = 0);
~CharacteristicsModel();
//minimum model members
QVariant data(const QModelIndex &index, int role) const;
// Qt::ItemFlags flags(const QModelIndex &index) const;
QVariant headerData(int section, Qt::Orientation orientation,
int role = Qt::DisplayRole) const;
QModelIndex index(int row, int column,
const QModelIndex &parent = QModelIndex()) const;
QModelIndex parent(const QModelIndex &index) const;
int rowCount(const QModelIndex &parent = QModelIndex()) const;
int columnCount(const QModelIndex &parent = QModelIndex()) const;
//additional functions
void appendItem(CharacteristicsItem* item);
void appendItems(QList<CharacteristicsItem*> items);
void clear();
void setCurrentItem(ImageItem *item=0);
ImageItem* getCurrentItem();
void setCharacteristic(int row, QVariant data);
void resetModel();
private:
//void setupModelData(const QStringList &lines, TreeItem *parent);
CharacteristicsItem* _root;
QList<QList<QVariant> > _items;
ImageItem* _currentItem;
QList<CharacteristicsItem*> _getDefaultItems();
};
#endif // IMAGECHARACTERISTICSMODEL_H