Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
help to create a circuit simulator-like interface
mochi last edited by
I'm new to QT and I'm trying to create a gui for some command line kernel that I have in c++.
I need to create some drag and drops for icons similar to what we see in those circuit composer/circuit simulators.
here is an example of an interface that looks exactly like what I want to do, it uses
So if we break it down to a list, the features I need are:
1- Add straight lines and remove them
2- add some single input gates/just some colored squares (drag and drop)
3- a separator
4- multiple input gates
Being fairly new, I would appreciate if someone can link me to the appropriate QT resources and tell the easiest approach to achieve this.
I'm assuming I need to create a Qframe, just add the + button inside. But, On mouse click action for the +, how do I draw a line in the qframe?
How do Make the drag and drop guided to specific area? I have only seen tutorials for drag and drop to a big rectangular area but not something that drops the items in specific places like the circuit composer I showed above.
Also How do I handle drawing the colored rectangles that I will drag from the toolbox on the black lines?
I apologize for the noob question, Hope someone can guide me a bit...
Thanks in advance
ODБOï last edited by
gde23 last edited by
Take a look at the "Diagram Scene Example" in Qt Creator.
Its an example creating a basic flowchart editor.
There are some objects that can be drag and drop moved around and that can be connected with arrows that automatically snap to the objects.
That is already relatively close to gates and wires.
mochi last edited by mochi
Sorry for the late reply, I was expecting to get an e-mail notification but I received nothing, so I checked the forum manually and found your answers.
@LeLev , thanks a lot for you link, but starting from such a big project for a newbie is a bit complicated, still thanks for the link.
@gde23 , I have been been trying the diagram scene as you suggested for the last couple of days, it fits perfectly what I'm trying to achieve. Thanks a lot for telling me where to start!