view FeedEntryItemDelegate.py @ 251:3ce39af93e77 pyqt5

Update to PyQt5
author Dirk Olmes <dirk@xanthippe.ping.de>
date Sun, 22 Oct 2017 03:40:44 +0200
parents 94a902de5266
children
line wrap: on
line source

# -*- coding: utf-8 -*-
from PyQt5.QtGui import QFont
from PyQt5.QtWidgets import QStyledItemDelegate

class FeedEntryItemDelegate(QStyledItemDelegate):
    def __init__(self):
        super(FeedEntryItemDelegate, self).__init__(None)

    def paint(self, painter, style, index):
        entry = index.internalPointer()
        if entry.read:
            style.font.setWeight(QFont.Normal)
        else:
            style.font.setWeight(QFont.Bold)
        super(FeedEntryItemDelegate, self).paint(painter, style, index)