当前位置:网站首页>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 !!
边栏推荐
- A method of sequentially loading Unity Resources
- CSRF vulnerability analysis
- Picture zoom Center
- 关于npm install 报错问题 error 1
- Medical image segmentation
- Summary of performance knowledge points
- Crawling data encounters single point login problem
- Nuc11 cheetah Canyon setting U disk startup
- 人体骨骼点检测:自顶向下(部分理论)
- 三年Android开发,2022疫情期间八家大厂的Android面试经历和真题整理
猜你喜欢
When visual studio code starts, it prompts "the code installation seems to be corrupt. Please reinstall." Solution to displaying "unsupported" information in the title bar
Hongke shares | plate by plate ar application in Beijing Winter Olympics
一种用于夜间和无袖测量血压手臂可穿戴设备【翻译】
Helm deploy etcd cluster
Solve DoS attack production cases
Implementation of AVL tree
巨杉数据库首批入选金融信创解决方案!
Breadth first traversal of graph
C#/VB. Net to add text / image watermarks to PDF documents
Online notes
随机推荐
Helm deploy etcd cluster
Some recruitment markets in Shanghai refuse to recruit patients with covid-19 positive
Reproduce ThinkPHP 2 X Arbitrary Code Execution Vulnerability
Epoll () whether it involves wait queue analysis
Reptiles have a good time. Are you full? These three bottom lines must not be touched!
Xu Xiang's wife Ying Ying responded to the "stock review": she wrote it!
Method of accessing mobile phone storage location permission under non root condition
Stm32+esp8266+mqtt protocol connects onenet IOT platform
Example of implementing web server with stm32+enc28j60+uip protocol stack
Stm32+hc05 serial port Bluetooth design simple Bluetooth speaker
巨杉数据库首批入选金融信创解决方案!
RedisSystemException:WRONGTYPE Operation against a key holding the wrong kind of value
基于ppg和fft神经网络的光学血压估计【翻译】
AcWing 3537.树查找 完全二叉树
Unity资源顺序加载的一个方法
Test 123
[sword finger offer] 60 Points of N dice
SQL injection Foundation
Test 1234
华为0基金会——图片整理