Merge branch 'tomaz-css' into Qt

Tomaz' code does a much better job of shading the dive list!

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2013-05-02 17:01:35 -07:00
commit ff2ce39970
10 changed files with 106 additions and 16 deletions

View file

@ -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);