I have been trying to understand a program that was developed specifically to the lab I’m working at. It’s made using C++ and Qt5.7. This program communicates with an arduino and an API, so it has multiple classes and complicated coding. I’m only a beginner in c++ and I’ve been given the responsibility of changing this program GUI in a way that makes it look more professional, compact and easy to use. To do that, I need to move things around.
I was thinking of creating pop up windows with some of the functionalities of the program, as in separating the mainwindow.ui into three other forms (mainwindow.ui, form1.ui and form2.ui, for example) and creating buttons (from actions) that when clicked opens either form1 or form2.
The big problem is that currently most of the code is in the mainwindow.cpp. So to change the location of one button I must have into consideration that there are classes in mainwindow that are communicating with this button and with the arduino, and that if I take it out of there, some other thing on mainwindow might need it and the program won’t work.
Is there any way to use these classes and change the location of the button without needing to change the location of the code? Like referencing it in some way?
I tried simply changing one button to form1.ui followed by moving its code to form1.cpp and form1.h (and changing the classes names) but it looked extremelly messy and didn’t work. I thought maybe I could figure out what I needed to move but once I realized some of it was arduino code, I’m not sure I can keep going on that direction.