- Published on : 30 August 2016 at 12:30 UTC
- Lionel Eppe
Foreword : QT is a framework used by C++ developers who originally was free, open-source and developed by Nokia.
Currently, this framework was acquired by Digia and since this acquisition, 2 versions are now available: an open-source version and a commercial version.
That means it is possible that you will find links to different domains (qt.nokia.com and qt-project.org), but the new official website is qt.io and the open-source version is always available on the page "Download Qt Open Source" their site.
Note that QT SDK is the former name of the program that allowed you to install everything and Digia now provided QT Creator (the integrated development program : IDE) and QT OpenSource (source code / libraries).
Currently, when you download and install QT 5.x.x, everything is installed and configured automatically.
However, if you want to develop with QT 4, you must install these two packages separately and configure them to be able to compile, debug, ... with QT Creator.
- Why develop with QT 4 while QT 5 is available ?
- Configuration used
- Install the compiler : mingw32
- Install Qt OpenSource 4.8.6
- Install Qt Creator 3.6.1
- Configure Qt Creator to be able to compile and debug with Qt Creator 3.6.1
- Test the configuration
Especially in order to develop its own stable web browser.
Indeed, if you want to develop a web browser using the QT framework, there are two possibilities :
Nevertheless, after several unsuccessful attempts to run a web browser (using the examples provided with QT 5) which was based on Qt WebEngine, we finally decided to install Qt4 in order to start developing our own web browser for personal use.
Among the stability problems that we had with these examples, there was this black window problem that occurred constantly and has also been found by other users.
With QtWebKit available in version QT4, we were able to add some of the features we wanted.
But finally, this personal web browser has not emerged because we have solve our problem by creating a Firefox extension instead of creating a full web browser for our personal use.
Nevertheless, QtWebKit is very convenient and can be used without problems to create your own web browser.
If you are interested by the creation of a Firefox extension :
- Look to the add-on SDK (Jetpack) which is a stable API and fully supported by most versions of Firefox. (This is the recommended choice by Mozilla and the one we chose)
- or WebExtensions : which is the API of the future to create Firefox extensions. Nevertheless, it is experimental. This means that your extension may stop working happen overnight.
Finally, note that the XUL (whose Mozilla speaks in his article "Construire une extension". English version of this article no longer exist) is deprecated and will end up to disappear. So, don't use this possibility.
Source : wiki.mozilla.org
In this tutorial, we will use and install :
- Qt OpenSource 4.8.6 (32 bits / x86) for Windows which allows to use the mingw32 compiler v4.8.2. So, your program will use dll of QT4.
- Qt Creator 3.6.1 x86 for Windows which allows to create programs in QT.
- Packages redistribuables Visual C++ for Visual Studio 2013 (vcredist_x86.exe) : required to install Qt Creator 3.6.1 x86.
- mingw32 i686-4.8.2 v3 rev3 which is the compiler that we can use to compile our program based on the dll and sources of Qt OpenSource 4.8.6.
- gdb 7.7.0 32 bit (included in mingw32) which is the debugger that will be used through Qt Creator.
Note that these versions have not been randomly selected.
- Qt OpenSource 4.8.6 is the latest version of the existing source code and dll of QT4
- Qt Creator 3.6.1 is compatible with Qt OpenSource 4.8.6
- dll 2013 of Microsoft those that Digia or Nokia used to compile the installer of Qt Creator 3.6.1
- mingw32 i686-4.8.2 v3 rev3 : is the exact version of the mingw32 compiler that Qt OpenSource 4.8.6 will ask you when trying to install it.
- gdb 7.7.0 32 bits is the debugger present in the mingw32... file you have downloaded.
To install mingw32, it's very simple.
Just unzip the downloaded file using WinRAR (paid) or 7-Zip (free) to obtain this structure : mingw32\bin\...
Launch the "qt-opensource-windows-x86-mingw482-4.8.6-1.exe" file and click Next.
As previously reported, Qt OpenSource 4.8.6 asks you where you unzipped files of mingw32 i686-4.8.2 v3 rev3.
In our case : C:\mingw32
Qt OpenSource installs the dll and sources of Qt 4.8.6, including sources of webkit (as you can see on the picture).
Uncheck the boxes and click Finish.
To install Qt Creator 3.6.1, you must first install "Visual C++ Redistributable Packages for Visual Studio 2013".
It takes less than a minute.
Then, run the file "qt-creator-opensource-windows-x86-3.6.1.exe" to install Qt Creator 3.6.1.
The installation begins.
Check the "Launch Qt Creator" box and click Finish.