-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdetailviewermodel.cpp
48 lines (37 loc) · 1.15 KB
/
detailviewermodel.cpp
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
47
48
#include "include/ui/detailviewermodel.h"
DetailViewerModel::DetailViewerModel(TableStrategyModel* tableStrategyModel, QObject *parent):QAbstractItemModel(parent){
this->tableStrategyModel = tableStrategyModel;
this->columns = 4;
this->rows = 3;
}
DetailViewerModel::~DetailViewerModel()
{
}
QModelIndex DetailViewerModel::index(int row, int column, const QModelIndex &parent) const
{
if (!hasIndex(row, column, parent))
return QModelIndex();
return createIndex(row, column, nullptr);
}
QVariant DetailViewerModel::headerData(int section, Qt::Orientation orientation, int role){
return QString::fromStdString("");
}
QModelIndex DetailViewerModel::parent(const QModelIndex &child) const{
return QModelIndex();
}
int DetailViewerModel::columnCount(const QModelIndex &parent) const
{
return this->columns;
}
int DetailViewerModel::rowCount(const QModelIndex &parent) const
{
return this->rows;
}
QVariant DetailViewerModel::data(const QModelIndex &index, int role) const
{
int row = index.row();
int col = index.column();
return "Viewer";
}
void DetailViewerModel::clicked_event(const QModelIndex & index){
}