Mercurial > hg > Feedworm
comparison FeedEntryItemDelegate.py @ 228:94a902de5266
use GenericTableModel instead of FeedEntryTableModel
author | Dirk Olmes <dirk@xanthippe.ping.de> |
---|---|
date | Sat, 31 May 2014 04:23:53 +0200 |
parents | 699d8f1cebd4 |
children | 3ce39af93e77 |
comparison
equal
deleted
inserted
replaced
227:6ce0e081094a | 228:94a902de5266 |
---|---|
4 class FeedEntryItemDelegate(QStyledItemDelegate): | 4 class FeedEntryItemDelegate(QStyledItemDelegate): |
5 def __init__(self): | 5 def __init__(self): |
6 super(FeedEntryItemDelegate, self).__init__(None) | 6 super(FeedEntryItemDelegate, self).__init__(None) |
7 | 7 |
8 def paint(self, painter, style, index): | 8 def paint(self, painter, style, index): |
9 feedEntryTableModel = index.model() | 9 entry = index.internalPointer() |
10 row = index.row() | |
11 # this makes assumptions about the type and the properties of the model but there's no | |
12 # way to get to the feedEntry using proper Qt API | |
13 entry = feedEntryTableModel.feedEntries[row] | |
14 if entry.read: | 10 if entry.read: |
15 style.font.setWeight(QFont.Normal) | 11 style.font.setWeight(QFont.Normal) |
16 else: | 12 else: |
17 style.font.setWeight(QFont.Bold) | 13 style.font.setWeight(QFont.Bold) |
18 super(FeedEntryItemDelegate, self).paint(painter, style, index) | 14 super(FeedEntryItemDelegate, self).paint(painter, style, index) |