当前位置:网站首页>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(); //路径
边栏推荐
猜你喜欢
Mysql事务
【Mysql】认识Mysql重要架构(一)
Ext4 file system opens dir_ After nlink feature, link_ Use link after count exceeds 65000_ Count=1 means the quantity is unknown
会议OA项目(三)---我的会议(会议排座、送审)
Exception handling mechanism II
Paper notes: knowledge map kgat (unfinished temporary storage)
使用openLayer画箭头
Jmeter配置元件之CSV数据文件设置
(2006, MySQL server has gone away) problem handling
Windows backs up the database locally by command
随机推荐
C# 托管与非托管
OpenCV 表格识别之表格提取(二)
Ext4 file system opens dir_ After nlink feature, link_ Use link after count exceeds 65000_ Count=1 means the quantity is unknown
Jmeter配置元件之CSV数据文件设置
mysql5.7.25主从复制(单向)
如何添加一个PDB
音视频知识
JS output diamond on the console
wap端微信h5支付,用于非微信浏览器
Malloc failed to allocate space and did not return null
调用DLL开启线程的问题
【Mysql】认识Mysql重要架构(一)
ZXing简化版,转载
Mysql事务
nodejs服务后台执行(forever)
js中树与数组的相互转化(树的子节点若为空隐藏children字段)
青少年软件编程等级考试标准解读_二级
Zipkin installation and use
Bloom filter
Use of off heap memory