当前位置:网站首页>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(); //路径
边栏推荐
猜你喜欢
随机推荐
暑假第四周
Sliding window, double pointer, monotone queue, monotone stack
2020-12-29
微信小程序学习笔记2
asp.net 使用redis缓存(二)
小程序纪录
PMM(Percona Monitoring and Management )安装记录
Audio and video knowledge
keepalived 实现mysql自动故障切换
使用openLayer画箭头
Jmeter配置元件之CSV数据文件设置
【Mysql数据库】mysql基本操作集锦-看得会的基础(增删改查)
Selection and practice of distributed tracking system
OnTap 9 file system limitations
自定义密码输入框,无圆角
MySql5.7.25源码安装记录
Personality test system V1.0
2022 chemical automation control instrument operation certificate test question simulation test platform operation
Redis principle and use - Basic Features
登录模块用例编写








