I am new here. I am a beginner in Qt but i am an intermediate level programmer in c++. I had written a program previously in C++ and STL(No code is platform dependent and whole program is broken into around ten .cpp/.h files). Now if I develop A Gui in qt,can I link it to my old program or should I rewrite everything? For instance I use file IO using fstream. But in Qt I see there is QFile so is it possible to link it. The program is pretty lengthy. So it will be very hard to rewrite everything. Gui is not mandatory for me but I thought it would be good for presentation.It is for my Project so please reply soon.Please give me some examples or sites to refer to if possible. Thank you in Advance... Manish
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
You can write a Qt GUI for your program:
One option is to create a separate program with GUI that starts your program as a subprocess, using QProcess
. The GUI program will send command line parameters and you can communicate with it.
Another option is to rewrite the main of your program so that it is another function. You can get your GUI program to call the function.
There is no need to use QFile
or other parts of Qt unless you want to rewrite that part of your program or use a feature of Qt.