DAG(有向无环图)-QAbstractItemModel [英] DAG (Directed acyclic graph) - QAbstractItemModel

查看:132
本文介绍了DAG(有向无环图)-QAbstractItemModel的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我打算在pyqt中创建一个节点图. qt提供了用于1D,2D和Tree数据的抽象模型,但是抽象类似乎因节点图而崩溃.

尤其是QAbstractModel中的父"函数返回单个父对象的QModelIndex.在DAG中,我可能会有多个父母.

我发现的一个资源是此博客文章:

http://invalidmagic.wordpress.com /2009/12/10/qgraphicsscene-us-as-a-qabstractitemmodel/

它提供了一些有用的信息,但我似乎无法确定该模型如何表示多亲的概念.

我正在寻找有关如何在Qt中实现DAG模型的示例和建议.

解决方案

此线程名为

One resource I found was this blog post:

http://invalidmagic.wordpress.com/2009/12/10/qgraphicsscene-used-as-a-qabstractitemmodel/

It provides some useful information, but I can't seem figure how the model represents the concept of multiple parents.

I'm looking for examples and suggestions for how to implement a DAG model in Qt.

解决方案

This thread entitled QTreeView display of graph (multiple parents of item) is an interesting resource that you can consider (It also addresses using QAbstractItemModel for the case).

这篇关于DAG(有向无环图)-QAbstractItemModel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆