当前位置:网站首页>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
);边栏推荐
- 一些企业数据平台建设的思考
- FormData对象的使用, var formdata=new FormData()
- Namespace conflict problem
- Many "double first-class" universities have launched the research guarantee and prediction name!
- Pointers and arrays (7)
- Third class exercise
- First class exercise
- JS instantiation method
- Swiftui layout - size (bottom)
- 使用Weka与Excel进行简单的数据分析
猜你喜欢

Cv:: mat conversion to qimage error

35道MySQL面试必问题图解,这样也太好理解了吧

It's so hot that solar power can't take off? Hello, head

How to make the characters in the photos laugh? HMS core video editing service one click smile function makes people smile more naturally

C language related programming exercises

How to use the C language library function getchar ()

Digital transformation security issues occur frequently, and Shanshi Netcom helps build a digital government

The 35 required questions in MySQL interview are illustrated, which is too easy to understand

一些企业数据平台建设的思考

2022 safety officer-a certificate operation certificate examination question bank simulated examination platform operation
随机推荐
Penguin side: why not recommend using select *?
How to use the C language library function getchar ()
@DS('slave') 多数据源兼容事务问题解决方案
多线程顺序运行有几种方法?
Focus on differentiated product design, intelligent technology efficiency improvement and literacy education around new citizen Finance
C # read INI file and key value pair operation
Third class exercise
如何在 Core Data 中进行批量操作
OKR and grad
Swiftui 4.0's new navigation system
Reptile: from introduction to imprisonment (I) -- Concept
用 Table 在 SwiftUI 下创建表格
Redis-Redis在Jedis中的使用
十、时间戳
Redis-持久化
9、 Uni popup usage popup effect at the bottom of the drop-down box
ScottPlot入门教程:获取和显示鼠标处的数值
The third pre class exercise
如何让照片中的人物笑起来?HMS Core视频编辑服务一键微笑功能,让人物笑容更自然
[ecmascript6] async and await