Mercurial > hg > Feedworm
diff FeedEntryItemDelegate.py @ 150:babe14449162
the entries for the selected feeds had to be set onto the item delegate so had access to the selected feed entry. Keep the list in one place only (the model) and access it from the item delegate.
author | Dirk Olmes <dirk@xanthippe.ping.de> |
---|---|
date | Sat, 27 Aug 2011 06:43:28 +0200 |
parents | 0f9b3e57cff0 |
children | bb3c851b18b1 |
line wrap: on
line diff
--- a/FeedEntryItemDelegate.py Fri Aug 26 06:14:42 2011 +0200 +++ b/FeedEntryItemDelegate.py Sat Aug 27 06:43:28 2011 +0200 @@ -5,10 +5,13 @@ class FeedEntryItemDelegate(QtGui.QStyledItemDelegate): def __init__(self): QtGui.QStyledItemDelegate.__init__(self, None) - + def paint(self, painter, style, index): + feedEntryTableModel = index.model() row = index.row() - entry = self.entries[row] + # this makes assumptions about the type and the properties of the model but there's no + # way to get to the feedEntry using proper Qt API + entry = feedEntryTableModel.feedEntries[row] if entry.read: style.font.setWeight(QFont.Normal) else: