链接啦:https://download.qt.io/archive/qt/5.9/5.9.1/
windows平台就下载: qt-opensource-windows-x86-5.9.1.exe

正常会调用迅雷下载啦

这里由于,已经安装了vs2019,结合视频,就只安装一部分

和

和

打开自带的示例,build 看看:Welcome ——》Example
可以点第一个Bars Example,再点左边的项目,勾选红框中的,建立独立的build 文件夹


点击Run,出现画面如下,鼠标右键点-拖动,三维画面可以动啦

安装了其他选项,出现感叹号时:

是说Qt找不到 VC 链接,需要安装8.0或者10.0的 SDK

安装后,重新启动Qt Creator,Tools – Options 可以看到感叹号转为显示器图标

修改中英文界面:Tools – Options – Enviorment – Interface里的language选项
注意:temp目录不能是中文
报错:无法运行“rc.exe”

安装目录下:MaintenaceTool.exe有卸载选项
新建工程初期主要选择第一个,

设置目录:

QmainWindow:菜单栏、选项

如下:

黑体加粗字为当前活动项目,
mainwindow.ui是界面文件,使用XML语言描述。
在 .pro文件中,GUI应用需要添加,Qt版本大于4需要添加widgets
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
先拖动Label,修改属性,填内容
Ctrl+S 保存后,点击运行:

单击mainwindow.ui文件,可以看到XML语言文本内容:
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>MainWindow</string>
</property>
<widget class="QWidget" name="centralWidget">
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>70</x>
<y>70</y>
<width>291</width>
<height>31</height>
</rect>
</property>
<property name="font">
<font>
<family>黑体</family>
<pointsize>14</pointsize>
</font>
</property>
<property name="text">
<string>假如时光倒流,我能做什么</string>
</property>
</widget>
<widget class="QLabel" name="label_2">
<property name="geometry">
<rect>
<x>141</x>
<y>130</y>
<width>151</width>
<height>20</height>
</rect>
</property>
<property name="font">
<font>
<family>Times New Roman</family>
<pointsize>16</pointsize>
</font>
</property>
<property name="text">
<string>Hello World!</string>
</property>
</widget>
</widget>
<widget class="QMenuBar" name="menuBar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>23</height>
</rect>
</property>
<widget class="QMenu" name="menu">
<property name="title">
<string>先进算法升级器</string>
</property>
</widget>
<addaction name="menu"/>
</widget>
<widget class="QToolBar" name="mainToolBar">
<attribute name="toolBarArea">
<enum>TopToolBarArea</enum>
</attribute>
<attribute name="toolBarBreak">
<bool>false</bool>
</attribute>
</widget>
<widget class="QStatusBar" name="statusBar"/>
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources/>
<connections/>
</ui>
目录变红说明 文件夹不存在
下载 qt-vsaddin文件安装,
这里是使用的VS 2019,所以搜索下载安装:qt-vsaddin-msvc2019
搭建环境参考:链接跳转
结合自己的安装目录,选择到bin目录中的qmake.exe文件:

点击下面红框的Qt选择相应的版本,Qt5.7之前的版本不建议使用,很多功能都没有,现在最新的是5.15,可以选择5.14,低于该版本的可能没有VS2019对应的Qt.
先配下环境:

有图有真相:

右击工程(不是解决方案)名称,Qt的子菜单中,点击Create basic .Pro file

点击显示所有文件后,可以看到:


再安装qt-vsaddin-msvc2019-2.5.1.vsix,链接如下:
https://download.qt.io/archive/vsaddin/2.5.1/
安装后,编译器出现感叹号解决
指定好 C/C++ builder后,打开example,Run测试下(需要点configure project—配置工程,指定下编译器):

#include "QtWidgetsApplication1.h"
#include <QtWidgets/QApplication>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QtWidgetsApplication1 w;
w.show();
return a.exec();
}
widget:窗口小部件、小器具、装饰品
