def index_at_event(self, event):
        """Get the index under the position of the given MouseEvent

        This implementation takes the indentation into account.

        :param event: the mouse event
        :type event: :class:`QtGui.QMouseEvent`
        :returns: the index
        :rtype: :class:`QtCore.QModelIndex`
        :raises: None
        """
        # find index at mouse position
        globalpos = event.globalPos()
        viewport = self.viewport()
        pos = viewport.mapFromGlobal(globalpos)
        i = self.indexAt(pos)
        n = self.get_total_indentation(i)
        if pos.x() > n:
            return i
        else:
            return QtCore.QModelIndex()
def index_at_event ( self , event ) : globalpos = event . globalPos ( ) viewport = self . viewport ( ) pos = viewport . mapFromGlobal ( globalpos ) i = self . indexAt ( pos ) n = self . get_total_indentation ( i ) if pos . x ( ) > n : return i else : return QtCore . QModelIndex ( )
Get the index under the position of the given MouseEvent

        This implementation takes the indentation into account.

        :param event: the mouse event
        :type event: :class:`QtGui.QMouseEvent`
        :returns: the index
        :rtype: :class:`QtCore.QModelIndex`
        :raises: None