I wrote a simple text manipulation program in C, on my Linux machine and crosscompiled it for my Windows target audience using MingW64. To make it more accessible I want to create a simple GUI for it using Qt.
I settled on Qt because it is portable, well supported, has great documentation, I'm already using it (KDE) and will serve me as an excuse to start learning C++.
I was wondering what would be the best way to integrate the GUI into my existing program. Should I change my program into a library and link it into the GUI. Should I keep the CLI part? I'd like to but how difficult would it be to integrate.
I'm thinking the easiest way, specially considering the crosscompilation (I'm assuming Qt has a very complicated, unique way to do this) would be to compile my existing program as a library, exposing only certain general functions to communicate with the GUI which would collect and validate input, and produce feedback. I can simply gather input on the GUI code, pass it to a "collector" function that will populate my program's structures and validate the input.
This would be a very runabout way to do it though, and I'd be wasting opportunities to take advantage of the GUI to streamline my code.