Used by the view to determine data to present

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

def data(self, index, role=QtCore.Qt.UserRole, mode=BuildMode):
        """Used by the view to determine data to present

        See :qtdoc:`QAbstractItemModel<QAbstractItemModel.data>`, 
        and :qtdoc:`subclassing<qabstractitemmodel.subclassing>`
        """
        if role == CursorRole:
            if index.isValid():
                if mode == BuildMode:
                    return cursors.openHand()
                elif mode == AutoParamMode:
                    return cursors.pointyHand()
                else:
                    raise ValueError("Invalid stimulus edit mode")
            else:
                return QtGui.QCursor(QtCore.Qt.ArrowCursor)

        if not index.isValid():
            return None
        if role == QtCore.Qt.DisplayRole:
            component = self._stim.component(index.row(),index.column())
            return component.__class__.__name__
        elif role == QtCore.Qt.SizeHintRole:
            component = self._stim.component(index.row(),index.column())
            return component.duration() #* PIXELS_PER_MS * 1000
        elif role == QtCore.Qt.UserRole or role == QtCore.Qt.UserRole+1:  #return the whole python object
            if self._stim.columnCountForRow(index.row()) > index.column():
                component = self._stim.component(index.row(),index.column())
                if role == QtCore.Qt.UserRole:
                    component = wrapComponent(component)
            else:
                component = None
            return component