PDA

View Full Version : build a gui ontop of a console application



aegis
24th March 2007, 13:20
hi, i have made a simple console application{using c++ and oop}...

i want to build a gui ontop of it...My gui gui will be extremely simple.

i.e two buttons {in QDialog} that will activate 2 functions of the application...

The question is how to do this...
I will remove every element of the console interface and i will connect the buttons to the functions ,but i dont want to

throw away all my design....

I know my question is too general, but i really cant be more specific...

thanks for your time,

N.A

wysota
24th March 2007, 13:50
It depends if you want to integrate the gui with the console application (meaning - compile it as a single binary) or if you want them to be separate applications (so that the gui part calls the console app to do its job).

In the first case, wrap the console code into functions/classes and call them in your gui. In the second case, use QProcess to spawn and control the backend (console app) from the frontend (gui app).

aegis
25th March 2007, 10:47
yes i want to compile it as a single binary....



In the first case, wrap the console code into functions/classes and call them in your gui.

the problem is that i have a complex class hierarchy {about 10 classes}....So i just delete the code refering to the console ,and mix my classes with the gui classes?

For the second case you suggested, it sounds interesting, is there any example i could look for?

thanks for your time,
NA

wysota
25th March 2007, 12:16
the problem is that i have a complex class hierarchy {about 10 classes}....So i just delete the code refering to the console ,and mix my classes with the gui classes?
Yes, something like that.


For the second case you suggested, it sounds interesting, is there any example i could look for?

For instance k3b, KDevelop...