summaryrefslogtreecommitdiffstats
path: root/qt-ui/models.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui/models.cpp')
-rw-r--r--qt-ui/models.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp
index 373770404..eb4d8974b 100644
--- a/qt-ui/models.cpp
+++ b/qt-ui/models.cpp
@@ -490,12 +490,18 @@ QVariant DiveItem::data(int column, int role) const
case LOCATION:
retVal = QString(dive->location);
break;
- case RATING:
- retVal = dive->rating;
- break;
}
break;
}
+
+ if(role == STAR_ROLE){
+ retVal = dive->rating;
+ }
+
+ if(role == DIVE_ROLE){
+ retVal = QVariant::fromValue<void*>(dive);
+ }
+
return retVal;
}
@@ -601,9 +607,6 @@ QVariant DiveTripModel::data(const QModelIndex& index, int role) const
if (!index.isValid())
return QVariant();
- if (role == Qt::BackgroundRole)
- return QBrush(QColor(index.row() % 2 ? Qt::white : QColor(Qt::lightGray).lighter(120)));
-
TreeItemDT* item = static_cast<TreeItemDT*>(index.internalPointer());
return item->data(index.column(), role);