当前位置:网站首页>Qt development tips
Qt development tips
2022-07-28 14:52:00 【Love the west wind】
One 、 Set console output
Because some third-party libraries or libraries of others are used , There will be tests output on the console , You can open the console ;
The method is as follows :
1.xxx.pro file increase :CONFIG += console
2. choice Run、 Check Run in terminal

3. recompile ;
Two 、Qt Use cout Output more detailed debugging information
Use The file where the global macro outputs debugging information 、 Line number 、 Function where
#define qDebug() qDebug() <<"["<< __FILE__ <<__FUNCTION__<< __LINE__<<"]"<<":"
3、 ... and 、 Shield warning
Shield some useless warnings , however , It is still recommended to keep the warning , Convenient debugging .
CONFIG += warn_offFour 、 Detect the program version
#ifdef QT_NO_DEBUG
qDebug() << "release mode";
#else
qDebug() << "debug mode";
#endif
5、 ... and 、 Set the software version number
stay .pro Add the following code to the file and set the version number to 1.0.0.0
VERSION = 1.0.0.06、 ... and 、 Chinese scrambling
In the class with Chinese , Add... To the header file declaration
#pragma execution_character_set("utf-8")7、 ... and 、 Generate executable files exe Icon
Method :
pro Add RC_ICONS=logo.ico
Be careful : here png Can't be used directly ,
You can use this website to transfer directly , Free of charge ;
Simple version image transfer ico Icon :https://www.butterpig.top/ico
effect :

8、 ... and 、Qt Remove the title bar from The biggest and the smallest close Help button, etc
Remove the close button
setWindowFlags(windowFlags()&~Qt::WindowCloseButtonHint);
Remove the close and help buttons
setWindowFlags(windowFlags()&~Qt::WindowCloseButtonHint&~Qt::WindowContextHelpButtonHint);What you want to remove can be added at once
//WindowFlags Include :
Qt::FrameWindowHint:// Windows without borders
Qt::WindowStaysOnTopHint:// Always in the top window
Qt::CustomizeWindowHint:// Custom window title bar , The following logo must be used with this logo to be valid , Otherwise, the window will have a default title bar
Qt::WindowTitleHint: Show window title bar
Qt::WindowSystemMenuHint:// Display system menu
Qt::WindowMinimizeButtonHint:// Show minimize button
Qt::WindowMaximizeButtonHint:// Show maximize button
Qt::WindowMinMaxButtonsHint:// Show minimize button and maximize button
Qt::WindowCloseButtonHint:// Show close button To display :
setWindowFlags(Qt::CustomizeWindowHint
| Qt::WindowTitleHint
| Qt::WindowMinimizeButtonHint
| Qt::WindowMaximizeButtonHint
| Qt::WindowCloseButtonHint
);边栏推荐
- Why can the anonymous functions of JQ access the methods inside
- Chi square distribution and gamma function
- [线程安全问题] 多线程到底可能会带来哪些风险?
- 九、uni-popup用法 下拉框底部弹窗效果
- Redis-配置文件讲解
- The second pre class exercise
- 【LeetCode】 贴纸拼词(动态规划)
- Tdengine helps Siemens' lightweight digital solutions
- 8、 Picker usage drop-down box selection effect
- Why is it reverse to convert from other formats to BMP
猜你喜欢

C语言中浮点数据类型(你学废了吗)

面试官:ThreadLocal使用场景有哪些?内存泄露问题如何避免?

OKR与GRAD
C# 读取ini文件、键值对操作
Excel VBA 开发过程中遇到的一些问题,解决方案,持续更新

十、时间戳
![[线程安全问题] 多线程到底可能会带来哪些风险?](/img/79/112ab7e586b0bceb296dfddb2728be.png)
[线程安全问题] 多线程到底可能会带来哪些风险?

The method of implementing simple student achievement management system with C language

8、 Picker usage drop-down box selection effect
![[ecmascript6] other new interface features](/img/da/377f93d83b6722bf250d270e4eea28.png)
[ecmascript6] other new interface features
随机推荐
如何在 Core Data 中进行批量操作
十、时间戳
如何只降3D相机不降UI相机的分辨率
Many "double first-class" universities have launched the research guarantee and prediction name!
一些企业数据平台建设的思考
基于 MinIO 对象存储保障 Rancher 数据
Unittest executes runtestcase prompt <_ io. Textiowrapper name= '< stderr>' mode=W encoding=UTF-8 > solution
Focus on differentiated product design, intelligent technology efficiency improvement and literacy education around new citizen Finance
Node文件操作
Swiftui layout - size (top)
Use of formdata object, VAR formdata=new formdata()
On July 29, apachecon | apachepulsar's exploration and practice in vivo will be broadcast soon
ScottPlot入门教程:获取和显示鼠标处的数值
FormData对象的使用, var formdata=new FormData()
为 @CloudStorage 添加了类 @Published 的能力
Redis configuration file explanation
ssh服务
2022 melting welding and thermal cutting examination questions and online simulation examination
Error reason for converting string to long type: to convert to long type, it must be int, double, float type [easy to understand]
Various pitfalls encountered in UI development