diff 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
line wrap: on
line diff
--- a/FeedEntryItemDelegate.py	Wed May 28 02:47:40 2014 +0200
+++ b/FeedEntryItemDelegate.py	Sat May 31 04:23:53 2014 +0200
@@ -6,11 +6,7 @@
         super(FeedEntryItemDelegate, self).__init__(None)
 
     def paint(self, painter, style, index):
-        feedEntryTableModel = index.model()
-        row = index.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]
+        entry = index.internalPointer()
         if entry.read:
             style.font.setWeight(QFont.Normal)
         else: