- document.setHtml(text)
- color = palette.highlight().color() \
- if option.state & QStyle.State_Selected \
- else palette.base().color()
- painter.save()
- # voodoo: if not highlighted, filling the rect
- # with the base color makes no difference
- painter.fillRect(option.rect, color)
- painter.translate(option.rect.x(), option.rect.y())
- document.drawContents(painter)
- painter.restore()
+ print "ELSE BRANCH"
+ # not sure this will ever work. this delegate
+ # doesn't know about my QObject strategy.
+ QItemDelegate.paint(self, painter, option, index)
+
+class ElemNodeDelegate(QAbstractItemDelegate):
+ def paint(self, painter, option, index):
+ print "ELEM DELEG CALLED"
+ paint(self, painter, option, index)
+
+ def sizeHint(self, option, index):
+ sizeHint(self, option, index)
+
+class TextNodeDelegate(QAbstractItemDelegate):
+ def paint(self, painter, option, index):
+ print "TEXT DELEG CALLED"
+ paint(self, painter, option, index)
+
+ def sizeHint(self, option, index):
+ sizeHint(self, option, index)
+
+class CommentNodeDelegate(QAbstractItemDelegate):
+ def paint(self, painter, option, index):
+ print "TEXT DELEG CALLED"
+ paint(self, painter, option, index)