Migration to Qt5   Leave a comment


So far I’ve been using Qt 4.8 on both Linux and Windows 7. The compiler used on Windows 7 was Microsoft Visual Studio C++ version 10.0 which came with Visual Studio 2010 Express. The Microsoft compiler had poor support for C++11 features which meant I had to code my fractal software such that it would successfully compile on Linux and Windows.

Fed up with not being able to use C++11 fully on Windows led me to upgrade to Visual Studio 2015 Community. Since Windows 8, 8.1 and 10 have been released since I first released my software for Windows I went the whole hog and upgraded to Windows 10, upgraded to Qt5 built for 32-bit and Qt5 built for 64-bit using Visual Studio 2015 and upgraded QtCreator to version 4.0.0.

Over on Linux Mint the shift to Qt5 was easy, all I had to do was install the Qt5-default package:

Selecting Qt5

Selecting Qt5

If need be I can easily switch back to Qt4 by uninstalling Qt5-default and installing Qt4-default instead.

Building SaturnQt using Qt5 required just one change to its NetBeans project:

Select project properties

Select project properties


Add QtWidgets

Add QtWidgets

The location of Qt classes has been rearranged so QtWidgets is required for Qt5 but not for Qt4.

The project built without any problems and when SaturnQt was started some differences in appearance were evident, first the main window and the settings window for the Qt5 build:

Main window using Qt5

Main window using Qt5


Settings window using Qt5

Settings window using Qt5

and these are main and settings windows for the Qt4 build:

Main window using Qt4

Main window using Qt4


Settings window using Qt4

Settings window using Qt4

There are some obvious differences:

  • The window background colour is lighter using Qt5.
  • The height of the iterations box is the same as the zoom selection combobox using Qt5, they are not when using Qt4.
  • The list cursor is blue instead of green using Qt5.

There are other minor differences. In short Qt5 doesn’t match the MATE theme I’m currently using with Linux Mint. It should be possible to solve this issue and when I do I’ll post it on this blog.

Back to Windows. The project file for SaturnQt already had a check for Qt5 and automatically adds QtWidgets. QtCreator was then configured to use the 32-bit build of Qt 5.6 and to use the Visual Studio C++ version 14.0 compiler. The first build failed as std::max requires the inclusion of <algorithm> which is not required for Linux it has been added to the source code causing no issues for the Linux build. In addition there were a large number of warnings, I’ll cover these when I compare g++, clang++ and the Microsoft compiler in an other post.

Running the project successfully started SaturnQt on Windows 10:

Main window on Windows 10

Main window on Windows 10


Settings window on Windows 10.

Settings window on Windows 10.

I haven’t yet built a 64-bit version for Windows 10 as I need 64-bit libraries for MPIR and MPFR (for multi-precision arithmetic) and the QtCreator project file needs to be modified to support 64-bit builds. There will be a post on building 64-bit versions of my software for Windows in due course.

Qt5 versions of my software will not be available until I’ve finished the next versions and sorted out the release packages which will be affected by the transition to Qt5.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: