PDA

View Full Version : Best practice question for 2 applications



scott_hollen
29th October 2011, 13:33
Good morning, all --

I've got a best practice question...I have a non-Qt application that I want to call from my Qt app and I'm wondering what are people's recommendations on the best way to do this in order to, effectively, only have 1 application for deployment reasons...Should I integrate all the code from my non-Qt app into my Qt one, or should I just link in the executable? This is all new ground for me...

Thanks!


scott

amleto
29th October 2011, 20:48
You cant link binaries. You can only link static or shared libs... you should make a library from the functionality in the non-Qt app that you want to share, and include/link it in your new app.

Santosh Reddy
30th October 2011, 00:18
you can create a sub project (.pro file) for the non-Qt app, then include it from the Qt App, this way all the code can be managed from a single main project. Also you can configure the sub project not to use Qt library. It means you will manage the non-Qt project with qmake and not use any Qt libs

scott_hollen
30th October 2011, 00:39
Thanks for both these answers! Not quite what I expected, but that's why I asked!

@amleto -- I had originally been thinking about linking in the binary but thanks for pointing out that that won't work...As I said, I'm plowing new territory and the only experience I have is with linking C routines years and years and years ago so I don't remember what I can and can't do...I'd thought about the library approach and while I may not know the details of how to make that happen it seems obvious from a rational point of view...

@Santosh -- the sub-project is pure C++ so configuring it to not use Qt libraries is a pretty logical approach...I'll do some searching to figure out how to pull this off...


Creative answers and I appreciate it! Time's running short for me and all help has been appreciated...



scott