当前位置:网站首页>Qt添加资源文件,为QAction添加图标,建立信号槽函数并实现
Qt添加资源文件,为QAction添加图标,建立信号槽函数并实现
2022-07-07 22:20:00 【妙为】
Qt系列文章目录
前言
在工具栏上添加图标
一、实现步骤
1.添加资源
2.定义变量
3.加入图标
trajectories_action_ = new QAction("trajectories");
trajectories_action_->setIcon(QIcon(":images/Add.ico"));
trajectories_action_->setCheckable(true);
tools_bar_->addAction(trajectories_action_);
4.建立信号槽
- 添加时间响应槽函数
void FastViewWidgetLayout::onTrajection()
{
qDebug() << "事件响应函数";
}
边栏推荐
- STM32F1與STM32CubeIDE編程實例-旋轉編碼器驅動
- If an exception is thrown in the constructor, the best way is to prevent memory leakage?
- 如果在构造函数中抛出异常,最好的做法是防止内存泄漏?
- 深潜Kotlin协程(二十二):Flow的处理
- Basic learning of SQL Server -- creating databases and tables with the mouse
- DNS 系列(一):为什么更新了 DNS 记录不生效?
- [basis of recommendation system] sampling and construction of positive and negative samples
- paddle入门-使用LeNet在MNIST实现图像分类方法二
- Jouer sonar
- Emotional post station 010: things that contemporary college students should understand
猜你喜欢
[the most detailed in history] statistical description of overdue days in credit
SQL knowledge summary 004: Postgres terminal command summary
某马旅游网站开发(对servlet的优化)
How does the markdown editor of CSDN input mathematical formulas--- Latex syntax summary
Two small problems in creating user registration interface
QT creator add JSON based Wizard
[question de programmation] [scratch niveau 2] oiseaux volants en décembre 2019
paddle一个由三个卷积层组成的网络完成cifar10数据集的图像分类任务
Stm32f1 and stm32cubeide programming example - rotary encoder drive
STM32F1与STM32CubeIDE编程实例-旋转编码器驱动
随机推荐
【编程题】【Scratch二级】2019.03 绘制方形螺旋
The difference between get and post
[programming problem] [scratch Level 2] December 2019 flying birds
2022-07-07:原本数组中都是大于0、小于等于k的数字,是一个单调不减的数组, 其中可能有相等的数字,总体趋势是递增的。 但是其中有些位置的数被替换成了0,我们需要求出所有的把0替换的方案数量:
Les mots ont été écrits, la fonction est vraiment puissante!
Robomaster visual tutorial (11) summary
The standby database has been delayed. Check that the MRP is wait_ for_ Log, apply after restarting MRP_ Log but wait again later_ for_ log
Seven years' experience of a test engineer -- to you who walk alone all the way (don't give up)
limit 与offset的用法(转载)
快速上手使用本地测试工具postman
new和delete的底层原理以及模板
爬虫实战(八):爬表情包
SQL connection problem after downloading (2)
Reading notes 004: Wang Yangming's quotations
RPA云电脑,让RPA开箱即用算力无限?
Single machine high concurrency model design
华为交换机S5735S-L24T4S-QA2无法telnet远程访问
QT and OpenGL: load 3D models using the open asset import library (assimp)
Fully automated processing of monthly card shortage data and output of card shortage personnel information
Is 35 really a career crisis? No, my skills are accumulating, and the more I eat, the better