当前位置:网站首页>QT随手笔记(六)——更新界面、截图、文件对话框
QT随手笔记(六)——更新界面、截图、文件对话框
2022-07-26 09:28:00 【飞扬123_123】
一、更新界面
update();//不及时
qApp->processEvents();//及时更新
二、截图并保存
QScreen * screen = QGuiApplication::primaryScreen();
QPixmap p = screen->grabWindow(ui.CO_chart->winId());
QImage image = p.toImage();
QString name = path + "123.png";
image.save(name);
三、文件对话框,获取文件名及路径
QString OpenFile;//文件路径+文件名
QString OpenFilePath;//文件路径
//打开文件夹中的文件
OpenFile = QFileDialog::getOpenFileName(this,
"",
"",
"(*.txt);;All(*.*)");
//显示路径
QFileInfo OpenFileInfo;
OpenFileInfo = QFileInfo(OpenFile);
OpenFilePath = OpenFileInfo.path(); //路径
边栏推荐
- Order based evaluation index (especially for recommendation system and multi label learning)
- Basic use of ArcGIS 4
- tabbarController的使用
- LeetCode三数之和问题
- 简单行人重识别代码到88%准确率 郑哲东 准备工作
- 多层嵌套后的 Fragment 懒加载实现
- OnTap 9 file system limitations
- Redis principle and usage - installation and distributed configuration
- uni-app学习总结
- Redis principle and use - Basic Features
猜你喜欢

您的登录IP不在管理员配置的登录掩码范围内

mysql5.7.25主从复制(单向)

Selection and practice of distributed tracking system

Basic use of Arc GIS 2

【Mysql】一条SQL语句是怎么执行的(二)

Your login IP is not within the login mask configured by the administrator

Source code analysis of object wait notify notifyAll

uni-app学习总结

Windows下Redis哨兵模式搭建

Basic use of ArcGIS 1
随机推荐
C managed and unmanaged
ZXing简化版,转载
volatile 靠的是MESI协议解决可见性问题?(下)
Malloc failed to allocate space and did not return null
省政府召开全省高温天气安全防范工作电视电话会议
【Flutter -- 布局】Align、Center、Padding 使用详解
JS output diamond on the console
Exception handling mechanism II
OnTap 9 file system limitations
Windows backs up the database locally by command
Ext4 file system opens dir_ After nlink feature, link_ Use link after count exceeds 65000_ Count=1 means the quantity is unknown
asp.net 使用redis缓存(二)
docker配置mysql集群
sublime 安装插件
Zxing simplified version, reprinted
Use of OpenCV class
Implementation of fragment lazy loading after multi-layer nesting
[online problem] timeout waiting for connection from pool problem troubleshooting
v-for动态设置img的src
PMM(Percona Monitoring and Management )安装记录