def onShortcutUnindentWithBackspace(self):
        """Backspace pressed, unindent
        """
        assert self._qpart.textBeforeCursor().endswith(self.text())

        charsToRemove = len(self._qpart.textBeforeCursor()) % len(self.text())
        if charsToRemove == 0:
            charsToRemove = len(self.text())

        cursor = self._qpart.textCursor()
        cursor.setPosition(cursor.position() - charsToRemove, QTextCursor.KeepAnchor)
        cursor.removeSelectedText()
def remove_backend(self, backend_id):
        """ Removes a backend from the treeview, and selects the first (to show
        something in the configuration panel

        @param backend_id: the id of the backend to remove
        """
        if backend_id in self.backendid_to_iter:
            self.liststore.remove(self.backendid_to_iter[backend_id])
            del self.backendid_to_iter[backend_id]
            self.select_backend()