2 from PyQt4.QtCore import *
3 from PyQt4.QtGui import *
7 class SentModel(QAbstractListModel):
8 def __init__(self, mlist):
9 QAbstractListModel.__init__(self)
15 def rowCount(self, parent = QModelIndex()):
16 return len(self._items)
20 def data(self, index, role = Qt.DisplayRole):
21 if role == Qt.DisplayRole:
22 return QVariant(self._items[index.row()].getRecName())
23 elif role == Qt.DecorationRole:
26 #arr = QByteArray(self._items[index.row()].getImageData())
27 #img.loadFromData(arr)
29 return QVariant(self._items[index.row()].img)