当前位置:网站首页>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漏洞分析
- Interpreting cloud native technology
- Specify flume introduction, installation and configuration
- epoll()无论涉及wait队列分析
- Self supervised heterogeneous graph neural network with CO comparative learning
- 星诺奇科技IPO被终止:曾拟募资3.5亿元 年营收3.67亿
- This article discusses the memory layout of objects in the JVM, as well as the principle and application of memory alignment and compression pointer
- CSRF vulnerability analysis
- 人体骨骼点检测:自顶向下(部分理论)
- Some understandings of tree LSTM and DGL code implementation
猜你喜欢
随机推荐
用友OA漏洞学习——NCFindWeb 目录遍历漏洞
Some understandings of tree LSTM and DGL code implementation
Stm32+mfrc522 completes IC card number reading, password modification, data reading and writing
2022/02/12
Introduction to the use of SAP Fiori application index tool and SAP Fiori tools
287. Find duplicates
UFIDA OA vulnerability learning - ncfindweb directory traversal vulnerability
裕太微冲刺科创板:拟募资13亿 华为与小米基金是股东
QLabel 跑马灯文字显示
线代笔记....
[depth first search] Ji suanke: find numbers
Solve DoS attack production cases
徐翔妻子应莹回应“股评”:自己写的!
Blue Bridge Cup real question: one question with clear code, master three codes
AcWing 3537. Tree lookup complete binary tree
Nuc11 cheetah Canyon setting U disk startup
Jdbc driver, c3p0, druid and jdbctemplate dependent jar packages
Picture zoom Center
Optical blood pressure estimation based on PPG and FFT neural network [translation]
[matlab] Simulink the input and output variables of the same module cannot have the same name