mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Added Support for the Trips and Dives on the DiveList model.
Now the list and dives will work in the same way that the GTK version does. The code got changed heavly because the old one was just looking at the dives and didn't worked like a tree. small adaptations on the list view and model delegates because of the changes done on this model. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
This commit is contained in:
parent
0be521bb25
commit
764a863082
4 changed files with 285 additions and 217 deletions
|
@ -14,10 +14,16 @@ void StarWidgetsDelegate::paint(QPainter* painter, const QStyleOptionViewItem& o
|
|||
return;
|
||||
}
|
||||
|
||||
int rating = index.model()->data(index, Qt::DisplayRole).toInt();
|
||||
QVariant value = index.model()->data(index, Qt::DisplayRole);
|
||||
|
||||
if (option.state & QStyle::State_Selected)
|
||||
painter->fillRect(option.rect, option.palette.highlight());
|
||||
if (!value.isValid()){
|
||||
return;
|
||||
}
|
||||
|
||||
int rating = value.toInt();
|
||||
|
||||
if(option.state & QStyle::State_Selected)
|
||||
painter->fillRect(option.rect, option.palette.highlight());
|
||||
|
||||
painter->save();
|
||||
painter->setRenderHint(QPainter::Antialiasing, true);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue