当前位置:网站首页>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();
边栏推荐
- 适合没口才的人做,加入中视频伙伴计划收益是真香,一个视频拿3份收益
- One of the data Lake series | you must love to read the history of minimalist data platforms, from data warehouse, data lake to Lake warehouse
- Don't want to knock the code? Here comes the chance
- Leetcode(69)——x 的平方根
- SQLAchemy 常用操作
- phpcms实现订单直接支付宝支付功能
- Research Report on the development trend and competitive strategy of the global CCTV robot industry
- JVM performance tuning and practical basic theory part II
- Research Report on the development trend and competitive strategy of the global high temperature label industry
- 光環效應——誰說頭上有光的就算英雄
猜你喜欢

Fundamentals of C language

Details of appium key knowledge

首届技术播客月开播在即

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

sqlilabs less-8
![[leetcode 324] 摆动排序 II 思维+排序](/img/cb/26d89e1a1f548b75a5ef9f29eebeee.png)
[leetcode 324] 摆动排序 II 思维+排序

JVM performance tuning and practical basic theory part II

【商业终端仿真解决方案】上海道宁为您带来Georgia介绍、试用、教程
![[zero basic IOT pwn] reproduce Netgear wnap320 rce](/img/f7/d683df1d4b1b032164a529d3d94615.png)
[zero basic IOT pwn] reproduce Netgear wnap320 rce

Play with mongodb - build a mongodb cluster
随机推荐
Use the right scene, get twice the result with half the effort! Full introduction to the window query function and usage scenarios of tdengine
建立自己的网站(14)
JVM performance tuning and practical basic theory part II
sqlilabs less-8
Is it reasonable and safe for securities companies to open accounts for 10000 free securities? How to say
期末琐碎知识点再整理
Reorganize the trivial knowledge points at the end of the term
光环效应——谁说头上有光的就算英雄
Salesforce、约翰霍普金斯、哥大 | ProGen2: 探索蛋白语言模型的边界
Halo effect - who says that those with light on their heads are heroes
Basic knowledge of C language
MIT团队使用图神经网络,加速无定形聚合物电解质筛选,促进下一代锂电池技术开发
"National defense seven sons" funding soared, with Tsinghua reaching 36.2 billion yuan, ranking second with 10.1 billion yuan. The 2022 budget of national colleges and universities was made public
如何看待国企纷纷卸载微软Office改用金山WPS?
博文推荐 | 深入研究 Pulsar 中的消息分块
微服务开发步骤(nacos)
对于编程思想和能力有重大提升的书有哪些?
微服务大行其道的今天,Service Mesh是怎样一种存在?
[repair version] imitating the template of I love watching movies website / template of ocean CMS film and television system
Open source internship experience sharing: openeuler software package reinforcement test