当前位置:网站首页>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 !!
边栏推荐
- Certains marchés de l'emploi de Shanghai refusent d'embaucher des personnes qui se rétablissent positives à Xinguan
- Introduction and case analysis of Prophet model
- 人体骨骼点检测:自顶向下(部分理论)
- Crawling data encounters single point login problem
- 同宇新材冲刺深交所:年营收9.47亿 张驰与苏世国为实控人
- 用于远程医疗的无创、无袖带血压测量【翻译】
- Describe the process of key exchange
- 二叉搜索树
- AFNetworking框架_上传文件或图像server
- Introduction to the use of SAP Fiori application index tool and SAP Fiori tools
猜你喜欢
MySQL查询请求的执行过程——底层原理
Some understandings of tree LSTM and DGL code implementation
AUTOCAD——中心线绘制、CAD默认线宽是多少?可以修改吗?
None of the strongest kings in the monitoring industry!
Online notes
如何提高网站权重
Visual Studio Code启动时提示“Code安装似乎损坏。请重新安装。”、标题栏显示“不受支持”信息的解决办法
The role of applet in industrial Internet
Medical image segmentation
Docker安装Redis
随机推荐
bonecp使用数据源
On AAE
青龙面板最近的库
epoll()无论涉及wait队列分析
Penetration test information collection - site architecture and construction
44 colleges and universities were selected! Publicity of distributed intelligent computing project list
Splay
基于ppg和fft神经网络的光学血压估计【翻译】
视频化全链路智能上云?一文详解什么是阿里云视频云「智能媒体生产」
[matlab] Simulink the input and output variables of the same module cannot have the same name
Online notes
CSRF vulnerability analysis
Penetration test information collection - App information
美庐生物IPO被终止:年营收3.85亿 陈林为实控人
【LeetCode第 300 场周赛】
2022.2.12
同宇新材冲刺深交所:年营收9.47亿 张驰与苏世国为实控人
星诺奇科技IPO被终止:曾拟募资3.5亿元 年营收3.67亿
Stm32+mfrc522 completes IC card number reading, password modification, data reading and writing
Cobra quick start - designed for command line programs