当前位置:网站首页>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 !!
边栏推荐
- C#/VB. Net to add text / image watermarks to PDF documents
- epoll()无论涉及wait队列分析
- AIRIOT物联网平台赋能集装箱行业构建【焊接工位信息监控系统】
- 【论文笔记】TransUNet: Transformers Make StrongEncoders for Medical Image Segmentation
- node の SQLite
- SQL injection Foundation
- SQL injection - access injection, access offset injection
- Stm32+mfrc522 completes IC card number reading, password modification, data reading and writing
- 渲大师携手向日葵,远控赋能云渲染及GPU算力服务
- 涂鸦智能在香港双重主板上市:市值112亿港元 年营收3亿美元
猜你喜欢

Shangsilicon Valley JUC high concurrency programming learning notes (3) multi thread lock

手写一个的在线聊天系统(原理篇1)

This article discusses the memory layout of objects in the JVM, as well as the principle and application of memory alignment and compression pointer

抽象类与抽象方法

用于远程医疗的无创、无袖带血压测量【翻译】

About NPM install error 1

图之广度优先遍历

On AAE

44 colleges and universities were selected! Publicity of distributed intelligent computing project list
![[Sun Yat sen University] information sharing of postgraduate entrance examination and re examination](/img/a8/41e62a7a8d0a2e901e06c751c30291.jpg)
[Sun Yat sen University] information sharing of postgraduate entrance examination and re examination
随机推荐
线代笔记....
Penetration test information collection - CDN bypass
Blue Bridge Cup real question: one question with clear code, master three codes
巨杉数据库首批入选金融信创解决方案!
如何提高网站权重
epoll()无论涉及wait队列分析
基于ppg和fft神经网络的光学血压估计【翻译】
RedisSystemException:WRONGTYPE Operation against a key holding the wrong kind of value
Test 123
美庐生物IPO被终止:年营收3.85亿 陈林为实控人
Celery best practices
Video based full link Intelligent Cloud? This article explains in detail what Alibaba cloud video cloud "intelligent media production" is
测试行业的小伙伴,有问题可以找我哈。菜鸟一枚~
Method of accessing mobile phone storage location permission under non root condition
From 2022 to 2024, the list of cifar azrieli global scholars was announced, and 18 young scholars joined 6 research projects
Jushan database was among the first batch of financial information innovation solutions!
Atcoder a mountaineer
MySQL查询请求的执行过程——底层原理
RedisSystemException:WRONGTYPE Operation against a key holding the wrong kind of value
人体骨骼点检测:自顶向下(部分理论)