-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathtablemodel.cpp
42 lines (33 loc) · 931 Bytes
/
tablemodel.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
#include "jlcxx/functions.hpp"
#include <QDebug>
#include <QQmlListProperty>
#include "tablemodel.hpp"
namespace qmlwrap
{
TableModel::TableModel(jl_value_t* data, QObject* parent) : QAbstractTableModel(parent)
{
m_data = new ModelData(data, this);
// QObject::connect(m_data, &ModelData::countChanged, this, &TableModel::countChanged);
// QObject::connect(m_data, &ModelData::rolesChanged, this, &TableModel::rolesChanged);
// QObject::connect(m_data, &ModelData::dataChanged, this, &TableModel::onDataChanged);
}
TableModel::~TableModel()
{
}
int TableModel::rowCount(const QModelIndex&) const
{
return m_data->rowcount();
}
int TableModel::columnCount(const QModelIndex&) const
{
return m_data->colcount();
}
QVariant TableModel::data(const QModelIndex& index, int role) const
{
return m_data->data(index, role);
}
ModelData* TableModel::get_model_data() const
{
return m_data;
}
} // namespace qmlwrap