Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Subclassing QGraphicsProxyWidget vs. QGraphicsWidget vs. QGraphicsItem to create custom graphic objects
Qt 6.12 LTS is out! See what's new in the release blog

Subclassing QGraphicsProxyWidget vs. QGraphicsWidget vs. QGraphicsItem to create custom graphic objects

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 2.5k Views 1 Watching
  • 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    Hi,

    I am trying to implement a node editor GUI similar to the ones you can find in Blender, Houdini or Nuke, using the QGraphicsScene and QGraphicsView classes.

    • A node is represented by a rectangle shape (QGraphicsPathItem/QGraphicsRectangleItem/QFrame or QDialog in a QGraphicsWidget or QGraphicsProxyWidget, etc..).
    • The node has several connectors representing an input or an output.
    • Outputs can be connected to inputs (QGraphicsPathItem/QGraphicsLineItem).

    Something that could look similar to this (but a lot simpler for now):
    !http://upload.wikimedia.org/wikipedia/commons/3/31/Blender3D_CreatingABumpMapCompositeNodes-2.49.png(Blender node graph screenshot)!

    I am confused about the various ways to achieve this. Many of the Qt Graphicsview examples directly subclass the QDialog class and add them to the scene with scene->addWidget(myNode). In the "Basic Graphics Layouts Example":http://qt-project.org/doc/qt-5.0/qtwidgets/graphicsview-basicgraphicslayouts.html--, a QGraphicsWidget is used instead. Yet some other examples directly subclass the QGraphicsProxyWidget class to create the node, in which they create a QDialog or a QFrame which they set as the proxy widget with setWidget(nodeWidget).

    I'm confused!
    1- What do you think would be the best way to go? Any advantages/disadvantages?
    2- What is the difference between subclassing the QGraphicsWidget class and subclassing the QGraphicsProxyWidget class?
    3- Any other suggestions?

    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
    • Unsolved