PDA

View Full Version : integration help



chap19150
21st July 2006, 17:31
i have an integration problem. There is a pre existing standalone program that I need to put a gui
on top of. Its only one function that I need to use. The gui displays images that the program sends it.


#include <Magick++.h>
using namespace Magick;

void loadImage() {
Image image;

image.read("image.gif");
image.write("output.gif");
}

int main() {
loadImage();

return 0;
}


this program already has its own makefile which is attached. How do I integrate my
gui with this program

jacek
21st July 2006, 19:59
What should that GUI do?

chap19150
21st July 2006, 20:44
What should that GUI do?

the gui displays images sent to it by the main program

jacek
21st July 2006, 20:54
the gui displays images sent to it by the main program
You can use QLabel to display images, to load the image you need QPixmap and QProcess to run that program.

chap19150
21st July 2006, 21:05
You can use QLabel to display images, to load the image you need QPixmap and QProcess to run that program.

I guess I wasn't clear enough in my explaination. I already have a qui that can handle this.
but I need this on one executable so I can call a specific function, so QProcess wouldn't
work in my situation. I attached the makefile because I figure I would have to combine the
make files somehow.

jacek
21st July 2006, 21:17
I guess I wasn't clear enough in my explaination. I already have a qui that can handle this. but I need this on one executable so I can call a specific function,
In that case you have to integrate main() routine of the non-GUI program with the GUI and link together all object files from both projects. Another solution is to turn non-GUI program into library.


I attached the makefile because I figure I would have to combine the make files somehow.
I guess that this Makefile is for the non-GUI program. Qt Makefiles are bit complicated, so it will be easier for you to use qmake or CMake.

chap19150
24th July 2006, 16:30
In that case you have to integrate main() routine of the non-GUI program with the GUI and link together all object files from both projects.

Do you have any ideas of how I would go about doing this?

jacek
24th July 2006, 17:00
Do you have any ideas of how I would go about doing this?
Just take the code from main() and put in Appropriate Place(tm) in the GUI program. There is no generic solution, everything depends on the way your programs work.