Showing posts with label porting. Show all posts
Showing posts with label porting. Show all posts

Thursday, April 25, 2013

Several Qt Solutions already ported to Qt 5.x

If it happens that you were already relying on some of the Qt Solutions to develop/extend your own applications (I for instance currently use QtSingleApplication to allow the user to run just one instance of my application) and you're porting your application to Qt 5.x you may notice that  the Qt Solution component(s) you're using must be also ported...

Porting applications to Qt 5.x but keeping Qt 4.x compatible

I think most of you are aware that existing applications developed for Qt 4.x must be ported to be used with Qt 5.x (if not, this is worth reading). The main visible changes to do to existing C++ code are:
  1. modify your C++ files (.h and/or .cpp) so
    • #include <QtGui> changes into #include <QtWidgets>
  2. add QT += widgets towards the end of the project file (.pro)
By making such changes your code now be built using Qt 5.x But wait a minute... By making such changes your code cannot be built using Qt 4.x anymore... If you want to be able to build your applications with each of Qt versions, here's a simple trick