Download Qt for Linux Open Source Version
Go to https://www.qt.io/download-open-source/ and click on Download Now, make sure that you are downloading the Qt installer for Linux.
A file with the name qt-unified-linux-x-online.run will be downloaded, then add exec permission
chmod +x qt-unified-linux-x-online.run
Remember to change 'x' for the actual version of the installer. Then run the installer
./qt-unified-linux-x-online.run
Download Qt for Windows Open Source Version
Go to https://www.qt.io/download-open-source/. The following screenshot shows the download page on Windows:
What you should do now depends on which IDE you're going to use. If you're going to use Qt Creator, which is included in the installer program, just click on Download Now and run the executable.
If you're going to use Qt in Visual Studio, normally the Download Now button should also work. Make sure the file downloaded is called qt-opensource-windows-x86-msvc2015_64-x.x.x.exe or qt-opensource-windows-x86-msvc2015_32-x.x.x.exe (where x.x.x is the version of Qt, for example 5.7.0). If that's not the case, click on View All Downloads and select one of the first four options under Windows Host.
If you're going to use Qt in Code::Blocks, click on View All Downloads and select Qt x.x.x for Windows 32-bit (MinGW x.x.x, 1.2 GB) under Windows Host.
Once you've downloaded the appropriate installer file, run the executable and follow the instructions below. Note that you need to be an administrator to install Qt. If you're not an administrator, you can find several alternative solutions here.
Install Qt in any operative system
Once you've downloaded Qt and opened the installer program, the installation procedure is the same for all operative systems, although the screenshots might look a bit different. The screenshots provided here are from Linux.
Login with a existing Qt account or create a new one:
Select a path to install the Qt libraries and tools
Select the library version and the features you want
After downloading and the installation is finished, go to the Qt installation directory and launch Qt Creator or run it directly from the command line.