SmartSinePy, and an example of GUI development with PySide6
Source code at: https://github.com/SyedTahmidMahbub/SmartSinePy
Quite a very long time ago, I had posted a Windows tool called Smart Sine to generate a sine table. See: https://tahmidmc.blogspot.com/2012/10/smart-sine-software-to-generate-sine.html
This was very useful for pre-generating the sine-table instead of in the main program itself, often useful to save space (and not have to perform trig operations) especially on 8-bit microcontrollers.
I was recently looking into developing quick GUIs for some test bench automation and was primarily looking for something where I could position and size GUI elements visually (a WYSIWYG editor, basically) and decided to dig into QT Designer and PySide6. I don't mind defining properties and event handlers programmatically (in fact I do prefer it) but what I really don't want to do is have to add every GUI element in code and define its location and size - this is where the QT Designer's visual editing really comes in helpful! Reminds me a lot of the Visual Studio GUI editor back in Visual Basic development days.
This provided a good opportunity to redo Smart Sine and have an example project for developing the GUI application. A few aspects explored on the GUI side of things:
- Creating the layout in QT Designer
- Getting inputs from a table
- Working with GUI widget signals (events such as button pressed or slider value changed)
- Updating text in labels and a text browser (textbox)
- Generating a plot with matplotlib and embedded it on the GUI
0 comments:
Post a Comment