Game Programming using Qt 5 Beginner's Guide
上QQ阅读APP看书,第一时间看更新

Time for action – Installing Qt using an online installer

All Qt resources, including the installers, are available at https://qt.io. To obtain the open source version of Qt, go to https://www.qt.io/download-open-source/. The page suggests the online installer for your current operating system by default, as shown in the following screenshot. Click on the Download Now button to download the online installer, or click on View All Downloads to select a different download option:

When the download is complete run the installer, as shown:

Click on Next to begin the installation process. If you are using a proxy server, click on Settings and adjust your proxy configuration. Then, either log into your Qt Account or click on Skip, if you don't have one.

Click on Next again, and after a while of waiting as the downloader checks remote repositories, you'll be asked for the installation path. Ensure that you choose a path where you have write access and enough free space. It's best to put Qt into your personal directory, unless you ran the installer as the system administrator user. Clicking on Next again will present you with the choice of components that you wish to install, as shown in the following screenshot. You will be given different choices depending on your platform:

Before we continue, you need to choose which Qt version you want to install. We recommend that you use the most recent stable version, that is, the first item under the Qt section. Ignore the Preview section, as it contains prerelease packages that may be unstable. If you want to be fully consistent with the book, you can choose Qt 5.9.0, but it's not required. The installer also allows you to install multiple Qt versions at once.

Expand the section corresponding to the Qt version you want to install, and choose whichever platforms you need. Select at least one desktop platform to be able to build and run desktop applications. When in Windows, you have to make additional choices for the desktop builds. Select the 32-bit or 64-bit version and choose the compiler you want to be working with. If you have a Microsoft C++ compiler (provided with Visual Studio or Visual C++ Build Tools), you can select the build corresponding to the installed MSVC version. If you don't have a Microsoft compiler or you simply don't want to use it, choose the MinGW build and select the corresponding MinGW version in the Tools section of the package tree.

If you want to build Android applications, choose the option corresponding to the desired Android platform. In Windows, you can select a UWP build to create Universal Windows Platform applications.

The installer will always install Qt Creator—the IDE (integrated development environment) optimized for creating Qt applications. You may also select Qt add-ons that you want to use.

After choosing the required components and clicking on Next again, you will have to accept the licensing terms for Qt by marking an appropriate choice, as shown in the following screenshot:

After you click on Install, the installer will begin downloading and installing the required packages. Once this is done, your Qt installation will be ready. At the end of the process, you will be given an option to launch Qt Creator: