当前位置:网站首页>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(); //路径
边栏推荐
- Basic use of ArcGIS 1
- VS2019配置opencv
- C# 托管与非托管
- 微信小程序学习笔记1
- LeetCode三数之和问题
- [MySQL] detailed explanation of redo log, undo log and binlog (4)
- Zipkin installation and use
- Force deduction brush questions, sum of three numbers
- Order based evaluation index (especially for recommendation system and multi label learning)
- antUI中a-modal 拖拽功能制作
猜你喜欢
微信小程序学习笔记1
ZXing简化版,转载
V-permission add permission
【线上死锁分析】由index_merge引发的死锁事件
After attaching to the process, the breakpoint displays "currently will not hit the breakpoint, and no symbols have been loaded for this document"
面试题目大赏
tabbarController的使用
Neural network and deep learning-6-support vector machine 1-pytorch
Cat installation and use
Paper notes: knowledge map kgat (unfinished temporary storage)
随机推荐
性格测试系统v1.0
LeetCode三数之和问题
OnTap 9 file system limitations
[online problem] timeout waiting for connection from pool problem troubleshooting
Sliding window, double pointer, monotone queue, monotone stack
[MySQL] detailed explanation of MySQL lock (III)
Ext4 file system opens dir_ After nlink feature, link_ Use link after count exceeds 65000_ Count=1 means the quantity is unknown
js中树与数组的相互转化(树的子节点若为空隐藏children字段)
VS2019配置opencv
微信小程序开发
Elastic APM installation and use
面试题目大赏
nodejs中mysql的使用
Calling DLL to start thread
Use of OpenCV class
The provincial government held a teleconference on safety precautions against high temperature weather across the province
v-for动态设置img的src
csdn空格用什么表示
电机转速模糊pid控制
Under a directory of ext3 file system, subfolders cannot be created, but files can be created