functions_plus.py 文件源码

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

项目:functions-plus 作者: ax330d 项目源码 文件源码
def build_tree(self, function_tree, root):
        '''Build Qt Widget tree.'''

        if not function_tree:
            return

        if isinstance(function_tree, FunctionData):
            flags = int(function_tree.flags)
            addr = function_tree.addr

            self.cols.set_data(addr, flags)

            for index in xrange(0, len(self.cols.names)):
                if index > 0:
                    root.setText(index, self.cols.col(index))
                if flags & idc.FUNC_THUNK:
                    root.setBackground(index, QtGui.QColor("violet"))
                    root.setBackground(index, QtGui.QColor("violet"))
                if flags & idc.FUNC_LIB:
                    root.setBackground(index, QtGui.QColor("cyan"))
                    root.setBackground(index, QtGui.QColor("cyan"))
            return

        for name, tree in sorted(function_tree.iteritems()):
            func_item = QtWidgets.QTreeWidgetItem(root)
            if not isinstance(tree, FunctionData):
                word = 'items'
                tree_keys_len = len(tree.keys())
                if tree_keys_len % 10 == 1:
                    word = 'item'
                name = '{} ({} {})'.format(name, tree_keys_len, word)
            func_item.setText(0, name)
            self.build_tree(tree, func_item)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号