0

I Have a question about c++ and graphical user interface.

I'm working for a company and I've implemented a c++ code contaning 6-7 different .cpp file. They all contains only basic c++ stuff (pointers,vectors strings etc.)(It does not required any database access or something like that, I only read a file and make some analysis on it). Finally I almost come to end of my project but today my boss said to me that I need to create a simple GUI for my project which I never did before by c++.Therefore, through a couple hours, I've search on the web and I decided to use qt for creating required GUI. Now here is my question, to do that Do I have to write my all codes from the beginning or could I integrate my code into QT ?

4
  • 2
    If you modularize code properly, it should be pretty seamless to integrate. Commented Jun 22, 2014 at 20:52
  • 2
    Qt doesn't require you to rewrite your code, you can just use it to create the UI part and use your code as you would without Qt (the better the interface separation, the easier the GUI-zation) Commented Jun 22, 2014 at 20:52
  • Qt is just a libary for making GUI. In the easiest case, it will be enough to call some extra functions and make it popup an window or whatever is needed. It gets more complicated if you need to react on button presses and such things. Ofc not really professional, but it works. If you need a solid GUI, you can't learn that in a matter of hours/days. Tell your boss that :) Commented Jun 22, 2014 at 20:55
  • Thanks for all replies. I guess he doesnt want a complex one. So what I understood from your answers is that I can integrate my project after finishing it with qt without trouble. Commented Jun 22, 2014 at 20:56

2 Answers 2

1

Qt integrates well with existing C++ code, even with STL containers and streams. You probably have to change your build system a little bit, because of some tools (MOC = Meta Object Compiler) you need to compile Qt classes. But this isn't usually a huge problem, because this special QObject classes are only used for the GUI part of your application.

Sign up to request clarification or add additional context in comments.

Comments

0

You will need some interfacing/conversion/adaption between standard types and Qt types. But in general you should be able to integrate your existing code into a Qt application.

It will be easier to integrate the existing code into a Qt project than integrating Qt code into your existing project.

Which compiler do you use? You should stick to a compiler that is supported by Qt by a pre-built package.

2 Comments

I'm using VS2013 ultimate
With Qt 5.3 VS2013 is supported. Download a VS2013 package and start a new Qt project (using VS plus VS-integration or using Qt creator). Than add your existing files to th project and include them as usual. You should find all necessaary informaion in Qt documentation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.