def populateTree(self, projects):
        logger.debug('TaskTreeModel.populateTree() is started')
        self.setColumnCount(3)
        self.setHorizontalHeaderLabels(
            ['Name', 'Type', 'Dependencies']
        )

        # item_prototype = TaskItem()
        # self.setItemPrototype(item_prototype)
        # root_item = TaskItem(0, 3)
        # root_item.setColumnCount(3)
        # self.appendRow(root_item)

        for project in projects:
            project_item = TaskItem(0, 3)
            project_item.parent = None
            project_item.setColumnCount(3)
            project_item.setText(project.name)
            project_item.task = project
            project_item.user = self.user
            project_item.user_tasks_only = self.user_tasks_only

            # set the font
            # project_item.setText(0, entity.name)
            # project_item.setText(1, entity.entity_type)
            # name_item = QtGui.QStandardItem()
            # name_item.setText(project.name)
            # entity_type_item = QtGui.QStandardItem()
            # entity_type_item.setText(project.entity_type)
            # project_item.appendColumn([name_item, entity_type_item])

            # Set Font
            # project_item.setText(project.name)
            my_font = project_item.font()
            my_font.setBold(True)
            project_item.setFont(my_font)

            self.appendRow(project_item)
            # root_item.appendRow(project_item)

        logger.debug('TaskTreeModel.populateTree() is finished')
populates tree with user projects
dataset/ETHPy150Open eoyilmaz/anima/anima/ui/models.py/TaskTreeModel.populateTree