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. QGraphicsItem design question

QGraphicsItem design question

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 428 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.
  • Joel BodenmannJ Offline
    Joel BodenmannJ Offline
    Joel Bodenmann
    wrote on last edited by
    #1

    I am working on something that can be described as a "schematic editor". One can place blocks with in- and outputs and connect them.

    I have a class named Component. This class inherits from nothing, it's a basic C++ class. The Component class contains a list of the in- and outputs, information about the date of creation, the author and so on. Now I need to represent this component in a QGraphicsScene.
    My question: Should I make the Component class inherit from the QGraphicsItem class or should I make a separate class, ComponentGraphic, and keep a pointer to that class in my actual Component class? I fear that keeping everything in one class will make it become huge and unmanagable. Having two separate classes can difficult to keep in sync. What's your or the general recommendation?

    Thanks for the help in advance.

    Industrial process automation software: https://simulton.com
    Embedded Graphics & GUI library: https://ugfx.io

    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