categoriesmodel.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:x-mario-center 作者: fossasia 项目源码 文件源码
def data(self, index, role):
        if not index.isValid():
            return None
        cat = self._categories[index.row()]
        role = self.COLUMNS[role]
        if role == "_name":
            return unicode(cat.name, "utf8", "ignore")
        elif role == "_iconname":
            # funny, but it appears like Qt does not have something
            # to lookup the icon path in QIcon
            icons = Gtk.IconTheme.get_default()
            info = icons.lookup_icon(cat.iconname, 48, 0)
            if info:
                return info.get_filename()
            return ""
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号