当前位置:网站首页>QT capture interface is displayed as picture or label
QT capture interface is displayed as picture or label
2022-07-01 14:41:00 【Big and strong】
In software development , Some special functions are realized , Need to intercept ui Interface image of , For example, we are implementing some animations , Direct control ui Interfaces or controls cannot be implemented , Even if it can be achieved, it will be greatly discounted , Like a page turning effect 、 Rotation effect and so on .
Above questions , stay qwidget have access to grab() The function intercepts the interface or control as QPixmap object , Then save it as a picture ,label Display and realize the animation you want .
The code is as follows :
QLabel *mLabel = new QLabel(parent);
mLabel->resize(QSize(yourWidget->width(),yourWidget->height()));
mLabel->setPixmap(yourWidget->grab()); // Capture the current interface and draw it to label On
mLabel->setAttribute(Qt::WA_DeleteOnClose); // Set properties ( Delete... On close )
mLabel->show();
mLabel->raise();
边栏推荐
- 【R语言数据科学】:机器学习常见评估指标
- 首届技术播客月开播在即
- 深度合作 | 涛思数据携手长虹佳华为中国区客户提供 TDengine 强大企业级产品与完善服务保障
- Use the right scene, get twice the result with half the effort! Full introduction to the window query function and usage scenarios of tdengine
- When the main process architecture game, to prevent calls everywhere to reduce coupling, how to open the interface to others to call?
- sqlilabs less9
- MIT团队使用图神经网络,加速无定形聚合物电解质筛选,促进下一代锂电池技术开发
- C 语言基础
- tensorflow2-savedmodel convert to pb(frozen_graph)
- 【牛客网刷题系列 之 Verilog快速入门】~ 使用函数实现数据大小端转换
猜你喜欢

Semiconductor foundation of binary realization principle

Opencv interpolation mode
![[R language data science]: common evaluation indicators of machine learning](/img/c8/dbfb041fa72799fae1892fe8ac0050.png)
[R language data science]: common evaluation indicators of machine learning

Don't want to knock the code? Here comes the chance

Word2vec yyds dry goods inventory

建立自己的网站(14)

Build your own website (21)

Chapter 4 of getting started with MySQL: creation, modification and deletion of data tables

Use the right scene, get twice the result with half the effort! Full introduction to the window query function and usage scenarios of tdengine

sqlilabs less13
随机推荐
sqlilabs less13
sqlilabs less-11~12
Research Report on the development trend and competitive strategy of the global facial wrinkle removal and beauty instrument industry
Why did you win the first Taosi culture award of 20000 RMB if you are neither a top R & D expert nor a sales Daniel?
C 语言基础
How to view the state-owned enterprises have unloaded Microsoft office and switched to Kingsoft WPS?
MIT team used graph neural network to accelerate the screening of amorphous polymer electrolytes and promote the development of next-generation lithium battery technology
SQLAchemy 常用操作
一波三折,终于找到src漏洞挖掘的方法了【建议收藏】
Using CMD to repair and recover virus infected files
Research Report on the development trend and competitive strategy of the global pipeline robot inspection camera industry
Basic knowledge of C language
30 Devops interview questions and answers
Build your own website (21)
互联网医院系统源码 医院小程序源码 智慧医院源码 在线问诊系统源码
Reorganize the trivial knowledge points at the end of the term
WebSocket(简单体验版)
C learning notes (5) class and inheritance
Websocket (simple experience version)
What problems should be considered for outdoor LED display?