GUI for electric circuit simulator. General conceptions
Egor_MIPT last edited by
I am a beginner in QT development (as well as in programming). I would like to develop an application that simulates the work of electric circuits. The general idea:
I have panel with elements (resistor, capacitor ect.). I drag and drop element to the frame and link it by wires. After that I give an input signal and simulate an output signal.
I have no problems with simulations, all Python codes are written, but I have problems with understanding of some GUI features realization. I would be grateful if you advice me some solutions.
- What widget should I use for "work field", where I put my elements?
- How to create an object (image of electric element), which I can place at work field?
- How to make wires (In my case it's only horizontal lines with auxiliary length defined by user when he place it on work field)
- Is it possible to realize this interface using only QtDesigner?
Thank you for attention, I would glad to get your advice.
Hi and welcome to devnet,
For one to three, please take a look at the Graphics View framework.
For number four, no you won't be able to do everything with Designer. Place the main components, yes, but you will have various custom items that you will have to code by hand.
Denni 0 Banned last edited by
Okay @SGaist is correct about the Designer but I would go another step further -- not only would you not want to use the Designer but you should not use it. The designer is meant to create a flexible (dynamic language) Gui and unless you need this using the Designer to make GUIs is completely unnecessary and frankly not friendly. There are many issues with using Designer code for your GUI and the biggest is -- its black-box untouchable code -- which in any project should be extremely limited if not avoided altogether whenever possible.
That being said I strongly suggest you learn to create this via normal Python-Qt its just as easy and whole lot friendlier when you go and try to implement functionality associated with that GUI. If you want extensive help with this I conduct a free-online lab-classroom that you can join. Otherwise we can help you here with specific questions about specific elements but it easiest for us if you provide a MRE (Minimal Reproducible Example) when asking your questions then we can take that tweak it as needed to help you implement what you are wanting to implement.