--- /dev/null
+from PyQt4 import *
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+import sys
+
+
+class RecModel(QAbstractListModel):
+ def __init__(self, mlist):
+ QAbstractListModel.__init__(self)
+
+
+ self._items = mlist
+
+
+ def rowCount(self, parent = QModelIndex()):
+ return len(self._items)
+
+
+
+ def data(self, index, role = Qt.DisplayRole):
+ if role == Qt.DisplayRole:
+ return QVariant(self._items[index.row()].getSenderName())
+ elif role == Qt.DecorationRole:
+
+ #img = QImage()
+ #arr = QByteArray(self._items[index.row()].getImageData())
+ #img.loadFromData(arr)
+
+ return QVariant(self._items[index.row()].img)
+ else:
+ return QVariant()