Install Latest Qt

Print Friendly, PDF & Email

How to install the latest Qt?

怎样安装最新版的 Qt?

It is similar to install Qt on different platforms. Qt is famous for being cross-platform, which is a blessing for developers: with minor changes, we can use out code on different platforms. In comparison, MFC uses C++, however, being very primitive and offers poor performance due to lack of improvements in the recent 20 years. C# offered by Microsoft is a powerful UI tool, however it can not be moved to Linux or Mac.
在不同的平台上安装 Qt 是很接近的。Qt 因其非凡的跨平台能力而出名,使得开发者只需简单修改代码就能够让软件在不同的平台上发布。
与用 C++ 开发的 MFC 对比,Qt 比 MFC 更加容易使用,MFC 早已经被时代所淘汰。微软的 C# 非常好用,但是无法做到跨平台,只能在 Windows 上使用。

But installing Qt can be more complex than installing Visual Studio, here I give the guidance of installing Qt on Windows. It is similar on different platforms. I will also give tip on Linux at the end of the blog.
但是安装 Qt 看上去比安装 VS 要复杂,所以我这里以 Windows 系统为例,给出安装 Qt 的教程。对于 Linux 平台,我在最后也会给出建议。

Step 1 – Download Installer on Qt Official Web

在 Qt 官网下载安装包

Choose Version

选择下载版本

Just go directly to the official download site: https://www.qt.io/download.
直接前往上述下载地址。

Choose "Go Open Source". (As it is free of charge.)
选择开源版本(因为这是免费的)
1-1

Sign in or Sign up

登录或者注册

Sign up according to the requirements (If you already have a Qt account, just sign in). Having signed up for Qt, you need to confirm at your e-mail.
按照要求注册(如有账号,直接登录即可)。注册后需要在邮箱确认。
1-2

Start Downloading

开始下载

The website may not recognise you immediately, so when you try to download, you may need to log in again.
下载时,网站可能需要你重新登录。

When you see what is below in the picture, you have succeeded downloading the installer.
看到下图状态,说明已经成功下载安装包了。
1-3

Step 2 – Run Installer

运行安装程序

Wait a little while.
等待一小会。
2-1

Log in

登录

2-2

Open Source Obligation

同意开源要求

Your Qt programmes must go open-source.
使用社区版(开源版)编写的程序必须开源。
2-3

Contribute or not

是否将信息传给 Qt

This is not important.
这不重要。
2-4

Choose Path

选择下载路径

Mind that you need to choose "Custom installation".
注意需要选择自定义安装。
2-5

Choose Components

选择组件

Here I install Qt 6.1.2 (which is the latest version of Qt now, remember not to download preview version which can contain numerous bugs) and Qt 5.15.2 (which is the last version of Qt 6). The reason behind downloading two versions is that Qt 6 is new and we can have some newer features; Qt 5 is currently widely used so we may not build those projects on Qt 6 due to compatibility problems. Kits here I choose both MSVC and MinGW. You can choose Qt Debug Information Files if you are not squeezed in storage (which is as large as 10G). Qt Creator is by default chosen so no more action is needed. Other components just follow what I have ticked.
这里我安装的是 6.1.2(最新版本,但是注意不要下载 preview 版本,这回又很多 bug) 和 5.15.2 版本(Qt 5 的最后一个版本,因为以前的很多项目使用 Qt 5 编写,使用 Qt 6 来编译可能会存在较大的兼容问题)。编译器我选择 MSVC 和 MinGW,你也可以选择 Qt Debug Information Files 如果你的电脑有足够的空间(这会很大,有 10G)。Qt Creator 自动选择过了,无须额外操作。其他的组件只需跟着我选的来即可。

2-6
2-7
2-8

Here I choose components for Windows, and there can be minor differences on different platforms.
这里是 Windows 版本的组件,其他平台会有区别。

Licence Agreement

同意 Qt 开源协议

2-9

Choose Name

设置软件名称

Just set it as "Qt".
设置为 “Qt” 即可。
2-10

Step 3- Wait

等待

That can be a long time. If there are error window, do not panic, choose Retry.
这个过程比较耗时,如果有跳出错误框,点击重试即可。
3-1

At this time, you can go to my open-source Qt programme Fractal Designer at GitHub: https://github.com/Teddy-van-Jerry/Fractal_Designer. Don’t forget to star or fork. Download or clone the project.
在等待的时候,你可以访问我的 GitHub 项目 Fractal Designer,将其下载或者克隆。对了,千万别忘记给 star 或者 fork

Step 4 – Configure Projects and Basic Knowledge

配置项目和基础知识

Choose kit

选择 kit

Choose Qt 6.1.2 MSVC and MinGW version. My Fractal Designer is built with Qt 6 so do not use Qt 5.15.2. But don’t worry, this can be changed later.
选择 Qt 6.1.2 MSVC 和 MinGW 版。我的这个项目是用 Qt 6 写的,所以不要使用 Qt 5。(不过这些设置都是可以之后修改的。)
4-1

Complile and Run

  • Ctrl + B: Compile / 编译
  • Ctrl + R: Run / 运行
  • Ctrl + S: Save / 保存

Wow, amazing! Such a beautiful app is generated!
太不可思议了,这么美妙的软件就生成了!
4-2

Why not visit the homepage of Fractal Designer to discover more? Tip: the banner picture is randomly chosen from pictures created by Fractal Designer.
为什么不访问 Fractal Designer 的网站发现更多呢?提示:网站的封面图每次不一样,但都是通过 Fractal Designer 设计出来的。

Fractal Designer: https://frd.teddy-van-jerry.org
FRD Homepage

By default, the compiled files are in another folder. But in configuration, you can change that by disable shadow building. You can not run the exe file directly due to lack of dll. This time you need to use windeployqt, which I will cover later in another blog.
默认来说,编译文件都在另一个与源码同级的文件夹内,不过可以在配置里取消 shadow building 使生成在源码文件夹内。注意,你找到的 exe 文件不能直接运行因为缺少 dll 文件。处理的办法 windeployqt 我将在其他博客中讲到。

Tips for Linux Users

Linux 用户建议

Choose Components

选择组件

Choose GCC kit instead.
与 Windows 的区别是选择 GCC 编译器。
Qt for Linux

Run Installer

运行安装包

Give the permission to the installer. You can use the command line.
给安装包运行的权限。(你可以用命令行)

Linux Permission

Run the installer. (There were repetitions due to I did not give it permission.) Discard all the warnings.
再运行 installer(上面有重复是因为一开始没有给权限)。忽略所有警告。
Run installer


Chinese and English are written by Teddy van Jerry.
中文与英文均由 Teddy van Jerry 撰写。

1 Response

  1. qxjmlqcdt ffmmc pnyxnrz pqdl jjktalccgmxzkoj

Leave a Reply

Your email address will not be published.