当前位置:网站首页>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 !!
边栏推荐
- CSRF漏洞分析
- 根据PPG估算血压利用频谱谱-时间深度神经网络【翻】
- Openmv4 learning notes 1 --- one click download, background knowledge of image processing, lab brightness contrast
- Some understandings of tree LSTM and DGL code implementation
- Breadth first traversal of graph
- Penetration test information collection - basic enterprise information
- [depth first search] Ji suanke: find numbers
- 【中山大学】考研初试复试资料分享
- Summary of performance knowledge points
- atcoder它A Mountaineer
猜你喜欢
Noninvasive and cuff free blood pressure measurement for telemedicine [translation]
A wearable arm device for night and sleeveless blood pressure measurement [translation]
抽象类与抽象方法
Oracle advanced (IV) table connection explanation
Openmv4 learning notes 1 --- one click download, background knowledge of image processing, lab brightness contrast
Introduction to the use of SAP Fiori application index tool and SAP Fiori tools
MySQL查询请求的执行过程——底层原理
多线程基础:线程基本概念与线程的创建
Implementation of AVL tree
【论文笔记】TransUNet: Transformers Make StrongEncoders for Medical Image Segmentation
随机推荐
使用map函数、split函数一行键入多个元素
44所高校入选!分布式智能计算项目名单公示
Hongke shares | plate by plate ar application in Beijing Winter Olympics
Summary of performance knowledge points
Specify flume introduction, installation and configuration
[depth first search] Ji suanke: find numbers
POJ 2208 已知边四面体六个长度,计算体积
Jushan database was among the first batch of financial information innovation solutions!
Medical image segmentation
Blue Bridge Cup real question: one question with clear code, master three codes
Collection of penetration test information -- use with nmap and other tools
AcWing 3537.树查找 完全二叉树
三年Android开发,2022疫情期间八家大厂的Android面试经历和真题整理
青龙面板最近的库
node の SQLite
DOM Brief
Breadth first traversal of graph
Reptiles have a good time. Are you full? These three bottom lines must not be touched!
Test 123
Afnetworking framework_ Upload file or image server