Used by the view to determine data to present

        See :qtdoc:`QAbstractItemModel<QAbstractItemModel.data>`, 
        and :qtdoc:`subclassing<qabstractitemmodel.subclassing>`

def data(self, index, role):
        """Used by the view to determine data to present

        See :qtdoc:`QAbstractItemModel<QAbstractItemModel.data>`, 
        and :qtdoc:`subclassing<qabstractitemmodel.subclassing>`
        """
        if role == QtCore.Qt.DisplayRole or role == QtCore.Qt.EditRole:
            test = self._testmodel.test(index.row())
            col = index.column()
            if col == 0:
                item = test.userTag()
            elif col == 1:
                item = test.stimType()
            elif col == 2:
                item = test.repCount()
            elif col == 3:
                item = test.traceCount()
            elif col == 4:
                item = test.traceCount()*test.loopCount()*test.repCount()
            elif col == 5:
                item = test.samplerate()

            return item
        elif role == QtCore.Qt.UserRole:  #return the whole python object
            test = self._testmodel.test(index.row())
            return QStimulusModel(test)
        elif role == QtCore.Qt.UserRole + 1:  #return the whole python object
            test = self._testmodel.test(index.row())
            return test
        elif role == CursorRole:
            col = index.column()
            if not index.isValid():
                return QtGui.QCursor(QtCore.Qt.ArrowCursor)
            elif col == 0:
                return QtGui.QCursor(QtCore.Qt.IBeamCursor)
            else:
                return cursors.openHand()