comparison FeedEntryItemDelegate.py @ 55:0f9b3e57cff0

pull out FeedEntryItemDelegate into its own file
author Dirk Olmes <dirk@xanthippe.ping.de>
date Tue, 18 May 2010 03:17:06 +0200
parents
children babe14449162
comparison
equal deleted inserted replaced
54:b535bce50626 55:0f9b3e57cff0
1
2 from PyQt4 import QtGui
3 from PyQt4.QtGui import QFont
4
5 class FeedEntryItemDelegate(QtGui.QStyledItemDelegate):
6 def __init__(self):
7 QtGui.QStyledItemDelegate.__init__(self, None)
8
9 def paint(self, painter, style, index):
10 row = index.row()
11 entry = self.entries[row]
12 if entry.read:
13 style.font.setWeight(QFont.Normal)
14 else:
15 style.font.setWeight(QFont.Bold)
16 QtGui.QStyledItemDelegate.paint(self, painter, style, index)