当前位置:网站首页>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 !!
边栏推荐
- Cobra quick start - designed for command line programs
- 图之广度优先遍历
- Installation and management procedures
- echart简单组件封装
- Video based full link Intelligent Cloud? This article explains in detail what Alibaba cloud video cloud "intelligent media production" is
- 一种用于夜间和无袖测量血压手臂可穿戴设备【翻译】
- 44 colleges and universities were selected! Publicity of distributed intelligent computing project list
- CSRF漏洞分析
- Hongke shares | plate by plate ar application in Beijing Winter Olympics
- POJ 2208 six lengths of tetrahedron are known, and the volume is calculated
猜你喜欢

Method of accessing mobile phone storage location permission under non root condition

287. Find duplicates

Use cpolar to build a business website (1)

美庐生物IPO被终止:年营收3.85亿 陈林为实控人

Jushan database was among the first batch of financial information innovation solutions!

Docker安装Redis

Grafana 9.0 is officially released! It's the strongest!

【LeetCode第 300 场周赛】

Visual Studio Code启动时提示“Code安装似乎损坏。请重新安装。”、标题栏显示“不受支持”信息的解决办法

The role of applet in industrial Internet
随机推荐
Online notes
This article discusses the memory layout of objects in the JVM, as well as the principle and application of memory alignment and compression pointer
Openmv4 learning notes 1 --- one click download, background knowledge of image processing, lab brightness contrast
[depth first search] Ji suanke: Square
Self supervised heterogeneous graph neural network with CO comparative learning
美庐生物IPO被终止:年营收3.85亿 陈林为实控人
基于蝴蝶种类识别
Implementation of AVL tree
If you have any problems, you can contact me. A rookie ~
QPushButton绑定快捷键的注意事项
epoll()无论涉及wait队列分析
CSRF漏洞分析
Reptiles have a good time. Are you full? These three bottom lines must not be touched!
Cobra quick start - designed for command line programs
Splay
First, look at K, an ugly number
44 colleges and universities were selected! Publicity of distributed intelligent computing project list
POJ 2208 six lengths of tetrahedron are known, and the volume is calculated
Use map function and split function to type multiple elements in one line
【论文笔记】TransUNet: Transformers Make StrongEncoders for Medical Image Segmentation