Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
QGraphicsItem design question
Joel Bodenmann last edited by
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
My question: Should I make the Component class inherit from the
QGraphicsItemclass 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.