Changeset 814b5175e85d…
Parent b7ce64bf3caf…
by
Changes to one file · Browse files at 814b5175e85d Showing diff from parent b7ce64bf3caf Diff from another changeset...
@@ -12,33 +12,6 @@
from tortoisehg.hgqt import qtlib
-class HtmlModel(QAbstractListModel):
-
- def __init__(self, strings):
- QAbstractTableModel.__init__(self)
- self.strings = strings
-
- def rowCount(self, parent):
- if not parent.isValid():
- return len(self.strings)
- return 0
-
- def data(self, index, role):
- if not index.isValid() or role != Qt.DisplayRole:
- return QVariant()
- if index.row() < 0 or index.row() >= len(self.strings):
- return QVariant()
- return QVariant(self.strings[index.row()])
-
- def headerData(self, col, orientation, role):
- if col != 0 or role != Qt.DisplayRole or orientation != Qt.Horizontal:
- return QVariant()
- else:
- return QVariant("Multiline Rich-Text List")
-
- def flags(self, index):
- return Qt.ItemIsSelectable | Qt.ItemIsEnabled
-
class HtmlListView(QListView):
def __init__(self, model):
QListView.__init__(self)
@@ -85,6 +58,33 @@ QApplication.clipboard().setText(selectionText, mode)
+class HtmlModel(QAbstractListModel):
+ def __init__(self, strings):
+ QAbstractTableModel.__init__(self)
+ self.strings = strings
+
+ def rowCount(self, parent):
+ if not parent.isValid():
+ return len(self.strings)
+ return 0
+
+ def data(self, index, role):
+ if not index.isValid() or role != Qt.DisplayRole:
+ return QVariant()
+ if index.row() < 0 or index.row() >= len(self.strings):
+ return QVariant()
+ return QVariant(self.strings[index.row()])
+
+ def headerData(self, col, orientation, role):
+ if col != 0 or role != Qt.DisplayRole or orientation != Qt.Horizontal:
+ return QVariant()
+ else:
+ return QVariant("Multiline Rich-Text List")
+
+ def flags(self, index):
+ return Qt.ItemIsSelectable | Qt.ItemIsEnabled
+
+
class HTMLDelegate(QStyledItemDelegate):
def __init__(self, parent=0, cols=None):
QStyledItemDelegate.__init__(self, parent)
|
Loading...