comparison data/model/ModelDataTableModel.cpp @ 1254:cbdd534f517a piper

Avoid assigning model resolution of 0 to models coming from plugins that report weirdly high output rates (symptom: data did not show up in edit layer data dialog, as the row/frame conversion failed)
author Chris Cannam
date Sat, 05 Nov 2016 10:40:22 +0000
parents 2f49be7d4264
children ec9e65fcf749
comparison
equal deleted inserted replaced
1250:c2d66e3c83d0 1254:cbdd534f517a
45 ModelDataTableModel::data(const QModelIndex &index, int role) const 45 ModelDataTableModel::data(const QModelIndex &index, int role) const
46 { 46 {
47 if (!m_model) return QVariant(); 47 if (!m_model) return QVariant();
48 if (role != Qt::EditRole && role != Qt::DisplayRole) return QVariant(); 48 if (role != Qt::EditRole && role != Qt::DisplayRole) return QVariant();
49 if (!index.isValid()) return QVariant(); 49 if (!index.isValid()) return QVariant();
50 return m_model->getData(getUnsorted(index.row()), index.column(), role); 50 QVariant d = m_model->getData(getUnsorted(index.row()), index.column(), role);
51 return d;
51 } 52 }
52 53
53 bool 54 bool
54 ModelDataTableModel::setData(const QModelIndex &index, const QVariant &value, int role) 55 ModelDataTableModel::setData(const QModelIndex &index, const QVariant &value, int role)
55 { 56 {