Set the given index as root index of the combobox

        :param index: the new root index
        :type index: QtCore.QModelIndex
        :returns: None
        :rtype: None
        :raises: None

def set_root(self, index):
        """Set the given index as root index of the combobox

        :param index: the new root index
        :type index: QtCore.QModelIndex
        :returns: None
        :rtype: None
        :raises: None
        """
        if not index.isValid():
            self.setCurrentIndex(-1)
            return
        if self.model() != index.model():
            self.setModel(index.model())
        self.setRootModelIndex(index)
        if self.model().rowCount(index):
            self.setCurrentIndex(0)
        else:
            self.setCurrentIndex(-1)