Important: Please read the Qt Code of Conduct -

help to create a circuit simulator-like interface

  • Hi,

    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

  • hi
    This is done with qt

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

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

Log in to reply