We have a big dirty application written in C ++ and Qt4, a lot of library dependencies, hundreds of classes and the lack of a consistent structure. Usually it starts as a graphical application that interacts interactively, but sometimes it starts in manual mode from another program that passes command line parameters and communicates with it using dbus. The GUI still shows, but no human or trained monkey can click anything. "Relaxen und watch das blinkenlights" In the interactive or automatic mode, when the application starts, image files are recorded.
My work in the next few weeks is to add the "no gui" function, so that the application can run in hands-off mode and write its own image files without even having to display its graphical interface. Internally, the images to be recorded are created using QImage and other objects other than the Qt GUI, but they have other objects that include the Qt GUI classes. After several attempts to figure out the clutter, I can't find a way to unravel things like an image-creating application without fully launching the GUI. At one time, I was hoping I could just set xxx.visible = false; for all xxx that are GUI objects, but this is impractical or possible (AFIK).
Are there any general strategies for adding this no-gui function to this application? Some technique that does not require a deep reorganization of the class hierarchy?
source share