Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Visualise a data structure (Tree) in a QGraphicsScene

Visualise a data structure (Tree) in a QGraphicsScene

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 2.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    issam
    wrote on last edited by
    #1

    Hi all!

    I am developing a small application in witch I have to construct a tree of data then transform it to a graphic (root node, vertices and edges) using the GraphicsView framework.

    any idea, how to do that ?

    thanks in advance.

    http://www.iissam.com/

    1 Reply Last reply
    0
    • A Offline
      A Offline
      Asperamanca
      wrote on last edited by
      #2

      GraphicsView doesn't offer any ready-made items for a tree.

      You can try inserting a QTreeView or QTreeWidget as a QGraphicsProxyWidget into the scene.
      Pros: Use of an existing widget
      Cons: Performance. Probably some pitfalls when using QGraphicsProxyWidget that I don't know about.

      You can compose everything yourself, using Lines, Rectangles and Text.
      Pros: High performance, looking exactly the way you want
      Cons: A lot of work

      1 Reply Last reply
      0
      • I Offline
        I Offline
        issam
        wrote on last edited by
        #3

        Hi,
        Well it's not exactly a tree, It's an oriented graph : "the reachability graph of a Petri Net":http://en.wikipedia.org/wiki/File:Reachability_graph_for_petri_net.png !

        I begin by drawing a Petri Net in a QGraphicsScene then building the graph !

        please any help !

        http://www.iissam.com/

        1 Reply Last reply
        0
        • A Offline
          A Offline
          Asperamanca
          wrote on last edited by
          #4

          Take a look at the ElasticNodes and the DiagramScene samples (under graphicsview). Between the two, you should find pretty much everything you need.

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved