Obtain pre-built qt qtcreator binary files and use instantly without buildingcompiling
A path with spaces in it or that is very long may cause problems later, so avoid doing that. Let's do a minimal install. If you want more components you can select them. I expanded Qt 5. The only other item I selected was under Tools, where Qt Creator 4. Next read and accept the license agreement. Then pick the Start menu shortcuts you want. The default is typically fine. Installation is now ready, so select Next. At this point it will download all the selected components.
This will take a while depending on the speed of your Internet connection. After downloads are completed it will start installing.
Qt Creator will launch and show the Welcome screen. Qt Creator should auto-detect the Qt install and compiler and create a "kit" for desktop development. We can now test the installation by creating a simple project.
Let's start with one for widgets: Pick Application and Qt Widgets Application: Pick the kit only one option is available then Next. You can specify some more information. Pick the defaults unless you want to use something else. Pick no project management.
You will now see the created skeleton application. You can look at the source code if desired: Click the hammer icon at lower left to build it. You can click on Compiler Output if you want to see it. The project should successfully build. You can now click on the green triangle icon to run it. After doing so, it should launch and you will see a window named MainWindow come up. You might also want to try a QML application. Build and run it as before. If the above steps worked you are all set up to develop with Qt on the desktop.
You can now create your own applications from scratch or start with one of the many examples or tutorials available within Qt Creator. Under the Start menu you will see a Qt section with entries for Qt Creator, as well as Assistant, Designer and Linguist in case you want to run these tools on their own.
There is also an entry for a command prompt for Qt, which will have qmake and other tools in the path so you can work from the command line if desired. If you want to go back and add or remove more Qt components, run "Uninstall Qt" which is the maintenance tool we used earlier.
If you want to test an Alpha release of Qt, these are typically only provided as source code. You may also want to build Qt from a development version in the git repository , which only provides source code, or with a specific patch or other change that you require.
Let's walk through the process for doing this on a Linux desktop system showing in detail the commands used to perform all the steps. We will be building Qt natively to run on the desktop rather than as a cross-compiled version for developing code for an embedded target system.
For this example will use bit Ubuntu desktop Linux version Ubuntu is one of the most popular desktop Linux distributions and this is the most recent LTS long term support release. If you are using another Linux distribution, the build process will be similar but some of the specific commands will be different.
We will build Qt version 5. Other versions of Qt will follow a similar process. I find the easiest way to download Qt version is to browse to the download server and navigate to the appropriate directory. In our case we want to select http: You will see several files there that offer the release in different archive formats. Some of the other formats like 7z are smaller because they use an archive format with better compression, but use less-commonly available archiving tools that you may not have installed on your system.
The file is megabytes in size. The Qt download site will attempt to use a download mirror server that is geographically close to you, so download speed should be quite good, usually limited only by the speed of your Internet connection.
If you want to verify that the download was not corrupted, you can generate an MD5 checksum of the file after you download it:. The next step is to extract the files from the source archive. If you downloaded the tar. Qt is dependent on a number of tools and libraries. Others are optional and Qt will make use of them if present and disable certain features if absent. This will occur when Qt is configured. Figuring out all of the correct dependencies to build Qt is often the hardest part of the build process.
While the dependencies are typically all available as standard packages for your Linux distribution, it can take some time to identify and install all of the packages that are needed, especially on a clean system where you have never built Qt before.
On Ubuntu Linux the command line tool to install packages is apt-get. On a different version of Ubuntu, some of the package names will likely differ.
The next step is configuring Qt. This will identify the options of Qt that will be enabled and create the make files needed to build it.
It is initiated by running the configure shell script. While configure has many options which you can display by running configure -h , we will just use the defaults:. Here is an abbreviated version of the output I saw on my system:. At this point configure should indicate if any required dependencies are missing. A typical error message is:. You will also want to check that the Qt options you desire are enabled. A critical one that I check for is the QPA back ends that are enabled.
If you are missing dependencies, you will need to identify the Ubuntu packages which provide them, install the packages, and then run configure again. This can be an iterative process the first time you build Qt.
Most systems today have multiple CPU cores, so you will want to take advantage of using them. You can pass the -j option to make specifying how many jobs to run in parallel. One rule of thumb is to use the number of cores less one, which tends to make good use of the available cores while still allowing the system to be usable for interactive work.
So for a 4 core system we might use:. This will take some time, anywhere from under an hour on a fast machine to many hours on a low-end computer. By default we are building all Qt modules, including some large ones like QtWebEngine, as well as all the Qt examples and demos. I've found this can happen when building QtWebEngine, as it has some large files that require a significant amount of memory to compile. It is possible that the build can fail at this point due to some missing dependencies.
If so, you will need to identify the missing packages, install them, and then continue building. You may want to use another location. If so, you can specify it using the -prefix command line option to configure.
We haven't yet built the documentation, which will be available from Qt Assistant. We can build and install it as follows:.