[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: playground/games/kmj
From: Wolfgang Rohdewald <wolfgang () rohdewald ! de>
Date: 2009-02-28 21:05:06
Message-ID: 1235855106.115903.21559.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 933408 by wrohdewald:
remove unused richttextlineedit
M +0 -53 genericdelegates.py
D richtextlineedit.py
--- trunk/playground/games/kmj/genericdelegates.py #933407:933408
@@ -10,7 +10,6 @@
# the GNU General Public License for more details.
from PyQt4 import QtCore, QtGui
-import richtextlineedit
class GenericDelegate(QtGui.QItemDelegate):
@@ -149,55 +148,3 @@
def setModelData(self, editor, model, index):
model.setData(index, QVariant(editor.text()))
-
-class RichTextColumnDelegate(QtGui.QItemDelegate):
-
- def __init__(self, parent=None):
- super(RichTextColumnDelegate, self).__init__(parent)
-
-
- def paint(self, painter, option, index):
- text = index.model().data(index, QtCore.Qt.DisplayRole).toString()
- palette = QtGui.QApplication.palette()
- document = QTextDocument()
- document.setDefaultFont(option.font)
- if option.state & QStyle.State_Selected:
- document.setHtml(QString("<font color=%1>%2</font>") \
- .arg(palette.highlightedText().color().name()) \
- .arg(text))
- else:
- document.setHtml(text)
- painter.save()
- color = palette.highlight().color() \
- if option.state & QStyle.State_Selected \
- else QColor(index.model().data(index,
- QtCore.Qt.BackgroundColorRole))
- painter.fillRect(option.rect, color)
- painter.translate(option.rect.x(), option.rect.y())
- document.drawContents(painter)
- painter.restore()
-
-
- def sizeHint(self, option, index):
- text = index.model().data(index).toString()
- document = QtGui.QTextDocument()
- document.setDefaultFont(option.font)
- document.setHtml(text)
- return QtCore.QSize(document.idealWidth() + 5,
- option.fontMetrics.height())
-
-
- def createEditor(self, parent, option, index):
- lineedit = richtextlineedit.RichTextLineEdit(parent)
- return lineedit
-
-
- def setEditorData(self, editor, index):
- value = index.model().data(index, QtCore.Qt.DisplayRole).toString()
- editor.setHtml(value)
-
-
- def setModelData(self, editor, model, index):
- model.setData(index, QtCore.QVariant(editor.toSimpleHtml()))
-
-
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic