Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.9, 1.9.1, and 1.9.2

repoview: styling and selection!

Combine two approaches to get both styling and selection.
Ingenious approch to get the selection highlighting from
http://stackoverflow.com/questions/2959850/how-to-make-item-view-render-rich-html-text-in-pyqt

Changeset fec1b1a1bc98

Parent 6bba8bd1044f

by George Marrows

Changes to one file · Browse files at fec1b1a1bc98 Showing diff from parent 6bba8bd1044f Diff from another changeset...

 
73
74
75
76
77
78
 
 
 
 
 
 
79
 
 
 
 
 
80
81
82
 
90
91
92
 
93
94
95
 
73
74
75
 
 
 
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
 
98
99
100
101
102
103
104
@@ -73,10 +73,18 @@
    # This approach taken from   # http://stackoverflow.com/questions/2959850/how-to-make-item-view-render-rich-html-text-in-pyqt - def paint(self, painter, option, index): - if index.column() <> 3: # FIXME hardcoded - QStyledItemDelegate.paint(self, painter, option, index) + def __init__(self, parent = None): + super(HgItemDelegate, self).__init__(parent) + + def paint(self, painter, styleOption, index): + if index.column() <> 3: # FIXME + QStyledItemDelegate.paint(self, painter, styleOption, index)   return + option = QStyleOptionViewItemV4(styleOption) + #option.text = "blah" + + self.parent().style().drawControl(QStyle.CE_ItemViewItem, option, painter) +   model = index.model()   record = model.data(index, Qt.DisplayRole)   doc = QTextDocument(self) @@ -90,6 +98,7 @@
  dl = doc.documentLayout()   dl.draw(painter, ctx)   painter.restore() +   """   This was in the original example but perhaps not needed by thg?   def sizeHint(self, option, index):