comparison FeedEntryItemDelegate.py @ 218:699d8f1cebd4

unify imports, especially Qt imports. Use consistent super syntax
author Dirk Olmes <dirk@xanthippe.ping.de>
date Sun, 27 Apr 2014 06:04:57 +0200
parents bb3c851b18b1
children 94a902de5266
comparison
equal deleted inserted replaced
217:bb3c851b18b1 218:699d8f1cebd4
1 # -*- coding: utf-8 -*- 1 # -*- coding: utf-8 -*-
2 from PyQt4 import QtGui 2 from PyQt4.QtGui import QFont, QStyledItemDelegate
3 from PyQt4.QtGui import QFont
4 3
5 class FeedEntryItemDelegate(QtGui.QStyledItemDelegate): 4 class FeedEntryItemDelegate(QStyledItemDelegate):
6 def __init__(self): 5 def __init__(self):
7 QtGui.QStyledItemDelegate.__init__(self, None) 6 super(FeedEntryItemDelegate, self).__init__(None)
8 7
9 def paint(self, painter, style, index): 8 def paint(self, painter, style, index):
10 feedEntryTableModel = index.model() 9 feedEntryTableModel = index.model()
11 row = index.row() 10 row = index.row()
12 # this makes assumptions about the type and the properties of the model but there's no 11 # this makes assumptions about the type and the properties of the model but there's no
14 entry = feedEntryTableModel.feedEntries[row] 13 entry = feedEntryTableModel.feedEntries[row]
15 if entry.read: 14 if entry.read:
16 style.font.setWeight(QFont.Normal) 15 style.font.setWeight(QFont.Normal)
17 else: 16 else:
18 style.font.setWeight(QFont.Bold) 17 style.font.setWeight(QFont.Bold)
19 QtGui.QStyledItemDelegate.paint(self, painter, style, index) 18 super(FeedEntryItemDelegate, self).paint(painter, style, index)