当前位置:网站首页>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 ‧‧‧‧‧‧‧‧‧‧‧‧‧‧‧‧
边栏推荐
- 2080 virtual machine login command
- [MySQL] internal connection, external connection and self connection (detailed explanation)
- Some minor problems and solutions encountered when using ubantu
- MySQL事务简介、事务隔离级别
- Loading shellcode in C and go languages
- Leetcode 2190. The number that appears most frequently in the array immediately after the key (yes, once)
- 1723. 完成所有工作的最短时间
- 大端模式和小端模式的區別
- (三)Golang - 数据类型
- R language uses ggplot2 to visualize the density graph (curve) of specific data columns in dataframe data, and uses Xlim parameter to specify the range of X axis
猜你喜欢

ShardingJDBC 分库分表详解

JVM内存模型与本地内存

Recommend 6 open source projects of yyds

pytorch和torchvision官方文档使用方法

Microsoft Office MSDT Code Execution Vulnerability (cve-2022-30190) vulnerability recurrence

5、Embedding

Fiddler抓包几种常用功能介绍(停止抓包、清空会话窗内容、过滤请求、解码、设置断点......)

CVPR 2022 | meta learning performance in image regression task

Leetcode 2190. The number that appears most frequently in the array immediately after the key (yes, once)

Extract the new Chinese cross modal benchmark zero from 5billion pictures and texts, and Qihoo 360's new pre training framework surpasses many SOTAS
随机推荐
Record the use of yolov5 to detect rotating targets
Play kubernetes every 5 minutes summary
借助SpotBugs将程序错误扼杀在摇篮中
怎么在公司里面做好测试工作(做好测试工作)
博士申请 | 新加坡国立大学Xinchao Wang老师招收图神经网络方向博士/博后
大端模式和小端模式的区别
Atlas conflict Remote Code Execution Vulnerability (cve-2022-26134) vulnerability recurrence
Latex table online generation
Is the securities account opened by qiniu safe? Is it legal?
Sudo of uabntu
布局管理中的sizePolicy的策略问题
2022-2028 global press dehydrator industry research and trend analysis report
JS using RSA encryption and decryption
js 使用Rsa 加密 解密
CAS optimistic lock
使用ubantu时,遇见的一些小毛病和解决方法
Qt开发高级进阶:初探qt + opengl
2080虚拟机登录命令
2080 virtual machine login command
R语言使用epiDisplay包的tabpct函数生成二维列联表并使用马赛克图可视化列联表(二维列联表、边际频数、以及按行、按列的比例)、自定义设置cex.axis参数改变轴标签数值的大小