当前位置:网站首页>A variety of Qt development methods, which do you choose?
A variety of Qt development methods, which do you choose?
2022-06-12 17:05:00 【yinchengkai】
qt Is it worth learning ?
There's really a lot to learn about embedded systems , We may say that if we don't write the interface, we don't need to learn qt 了 ? I don't agree with .
Qt The implementation of the system mainly adopts p-impl methods , Implementation interface and implementation separation , It has a good message circulation mechanism , Some objects are related to threads , It also has the help of moc Generate reflection meta information , This design method is still very applicable today .
qt The kernel part is completely interface independent , You can put it away Qt GUI Part to learn and use Qt. When you learn completely qt And the idea behind it , You'll find that writing elegant code is a very simple thing , It can be applied to all the processes after you .
So what kind of Qt The development method is better or easy to get started ?
QT do UI The interface is usually simple to use C++ Hard coding , Can be used directly QWidget Parts , Instead of adopting QT Designer do UI Interface , It's not the use of QML+Javascript, It's flexible, but it's a lot of code , Usually used QT Development , There are three ways :
Use QT GUI frame , Hard coding alone
Use QT Designer do UI Interface , Be similar to MFC Drag the control as well , And then use C++ Write logic .
use QML do UI,JavaScript Write logic ,C++ Writing backstage , Mixed programming in three languages .
that Qt How many common development methods are there ? In general, it is divided into the following 2 Kind of
The first one is : pure QtCreator The way ,QtCreator code +MinGW or MSVC Or other compilers .
The second kind :VS+Qt library , hold Qt As an interface library in VS Call in .VS code +MSVC compile .

Use VS+Qt The right way to open
If the development of the program just windows Run up , No cross platform , I don't care if I need to use it Qt Creator open , So it is recommended that you use VS+Qt Way to develop .
In this case, you need to install VS、Qt Software , And in VS Install in QT plug-in unit , Configure environment variables and so on , Specific installation and configuration tutorial, you can refer to the online , Give it a try , This article focuses on methods .

Install and reopen VS, There are more than one in the menu bar QT VS Tools, Click on QT Options You can do the next step

VS Speed and debugging function are all over the world Qt Creator, It's great to develop .
Use Qt Creator How to open it
QtCreator+MSVC
Need to install VS( We mainly use its compiler )、Qt Creator Software ,MSVC Debugger installation , adopt windows SDK Tool installation debugger . To configure Qt Creator Compilers and debuggers
open Qt Creator, choice “ Tools ”->“ Options ”, Re selection “Kits”->“ compiler ”, You can see Qt Has been automatically detected MSVC Compiler .

At the same time “Kits”->“Debuggers” Next , The debugger has also been automatically detected .

And then we choose “Kits”->“ Build Suite ”, And then choose Desktop Qt 5.12.0 MSVC2017 64bit,
To configure C/C++ All compilers are :Microsoft Visual C++ Compiler 15.0(x86_amd64);
Configure the debugger to :Auto-detected CDB at D:\Windows Kits\10\Debuggers\x64\cdb.exe.

Qt Creator+MinGW
install Qt creator after , Use it directly Qt Creator code , Use native MinGW compile , This is the simplest , Without any outside help .
At the same time, the installation steps are the simplest , You can do the development after the installation , There's not too much configuration .

Recommended QtCreator+MSVC The way , In terms of speed and cross platform , Debugging function is slightly weak , In addition, there is no engineering conversion problem in this way , Can better support cross platform development .
Conclusion
If cross platform needs to be considered , Then it's best not to use VS+Qt This way, , Project conversion path 、 library 、 There's a lot of trouble with configuration ;
MSVC In the compilation speed and running speed are all explosion MinGW, It is not recommended to use MinGW compile , Let's experience it .
‧‧‧‧‧‧‧‧‧‧‧‧‧‧‧‧ END ‧‧‧‧‧‧‧‧‧‧‧‧‧‧‧‧
边栏推荐
- Go的变量
- 1723. 完成所有工作的最短时间
- The R language uses the pyramid function of epidisplay package to visualize the pyramid graph and the pyramid graph based on the existing summary data (table data)
- 890. find and replace mode / Sword finger offer II 080 Combination with k elements
- Advanced Qt development: a preliminary study QT + OpenGL
- 记录使用yolov5进行旋转目标的检测
- Différence entre le mode grand et le mode petit
- 大端模式和小端模式的區別
- latex表格 在线生成
- R language calculates data Table specifies the mean value of a numeric variable when the value of one grouped variable is fixed and another grouped variable
猜你喜欢

Male god goddess voting source code v5.5.21 voting source code

写技术博客的意义

To understand Devops, you must read these ten books!

goland变成中文版了怎么修改回英文版

Double write consistency problem

两位新晋Committer的“升级攻略”
![[MySQL] internal connection, external connection and self connection (detailed explanation)](/img/3f/9b88c2f27455f2ddd73808fbb44f8e.jpg)
[MySQL] internal connection, external connection and self connection (detailed explanation)

邱盛昌:OPPO商业化数据体系建设实战

Sudo of uabntu

How to use the official documents of pytorch and torchvision
随机推荐
Picture online collection and delivery system source code
R语言使用plot函数可视化数据散点图,使用font.axis参数指定坐标轴刻度标签的字体类型为斜体字体(italic)
uabntu的sudo
rolabelImg的安装使用
Difference between big end mode and small end mode
写技术博客的意义
R语言使用ggplot2可视化dataframe数据中特定数据列的密度图(曲线)、并使用xlim参数指定X轴的范围
Double write consistency problem
(四)Golang运算符
Programmers broke the news: 3 job hopping in 4 years, and the salary has tripled! Netizen: the fist is hard
Microsoft Office MSDT Code Execution Vulnerability (cve-2022-30190) vulnerability recurrence
ShardingJDBC 分库分表详解
Unit sshd. service could not be found
(五)输出和输出
Making nearly $90billion, Buffett's latest heavy stock exposure
Qiushengchang: Practice of oppo commercial data system construction
mysql语句
并发三色标记法
Google browser debugging skills
Swin transformer code explanation