当前位置:网站首页>Precautions for binding shortcut keys of QPushButton
Precautions for binding shortcut keys of QPushButton
2022-07-06 18:52:00 【HL_ Aeolus】
In a daily development , You need to add a shortcut key operation for the button , Pressing a key on the designated keyboard is equivalent to clicking this button with the mouse , This is the function of shortcut keys
There is a phenomenon that when the order of adding shortcut keys is like this , Invalid shortcut key
First bind the shortcut keys , Then set the button text , Invalid
QKeySequence keyCut(Qt::Key_Return);
btnStart->setShortcut(keyCut);
btnStart->setText(" Start ");
Set the text first , Then bind the shortcut keys , It works
btnStart->setText(" Start ");
QKeySequence keyCut(Qt::Key_Return);
btnStart->setShortcut(keyCut);
Then I try again to comment out the code that sets the text , Then bind the shortcut key , Run the program , Press enter , I rely on , The program crashed
//btnStart->setText(" Start ");
QKeySequence keyCut(Qt::Key_Return);
btnStart->setShortcut(keyCut);
The above is a small detail I found in a daily development , I don't know if it's my version Qt5.7.1 Reasons for too low , At present, I haven't tried the higher version Qt Whether there is the same phenomenon , Welcome to leave a message for discussion !!
边栏推荐
- DOM Brief
- 基于蝴蝶种类识别
- 文档编辑之markdown语法(typora)
- [depth first search] Ji suanke: a joke of replacement
- Huawei 0 foundation - image sorting
- Blue Bridge Cup real question: one question with clear code, master three codes
- atcoder它A Mountaineer
- Markdown syntax for document editing (typera)
- Docker installation redis
- Some understandings of tree LSTM and DGL code implementation
猜你喜欢
Use cpolar to build a business website (1)
Visual Studio Code启动时提示“Code安装似乎损坏。请重新安装。”、标题栏显示“不受支持”信息的解决办法
Penetration test information collection - CDN bypass
多线程基础:线程基本概念与线程的创建
44所高校入选!分布式智能计算项目名单公示
Jushan database was among the first batch of financial information innovation solutions!
Estimate blood pressure according to PPG using spectral spectrum time depth neural network [turn]
基于蝴蝶种类识别
Introduction to the use of SAP Fiori application index tool and SAP Fiori tools
【中山大学】考研初试复试资料分享
随机推荐
celery最佳实践
JDBC驱动器、C3P0、Druid和JDBCTemplate相关依赖jar包
【中山大学】考研初试复试资料分享
使用cpolar建立一个商业网站(1)
test about BinaryTree
Execution process of MySQL query request - underlying principle
From 2022 to 2024, the list of cifar azrieli global scholars was announced, and 18 young scholars joined 6 research projects
抽象类与抽象方法
同宇新材冲刺深交所:年营收9.47亿 张驰与苏世国为实控人
视频化全链路智能上云?一文详解什么是阿里云视频云「智能媒体生产」
Helm deploy etcd cluster
ORACLE进阶(四)表连接讲解
[depth first search] Ji suanke: a joke of replacement
AFNetworking框架_上传文件或图像server
echart简单组件封装
UFIDA OA vulnerability learning - ncfindweb directory traversal vulnerability
Understanding disentangling in β- VAE paper reading notes
Penetration test information collection - WAF identification
Implementation of AVL tree
Example of implementing web server with stm32+enc28j60+uip protocol stack