Planner: fix editing the dive planner points table

The edit starts with the current value, but our data() function didn't
return that in the edit role.

Thanks Tomaz for explaining this to me.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2014-06-03 11:44:05 -07:00
parent 1bcb38dc49
commit 2cfa7fead0

View file

@ -361,7 +361,7 @@ int DivePlannerPointsModel::columnCount(const QModelIndex &parent) const
QVariant DivePlannerPointsModel::data(const QModelIndex &index, int role) const
{
divedatapoint p = divepoints.at(index.row());
if (role == Qt::DisplayRole) {
if (role == Qt::DisplayRole || role == Qt::EditRole) {
switch (index.column()) {
case CCSETPOINT:
return (double)p.po2 / 1000;