def rowCount(self, parent=QModelIndex()):
        if parent.isValid():
            return 0
        else:
            if self.cards.isOpen():
                return self.cards.getCardsCount()
            else:
                return 0