当前位置: 首页 > 网络知识

Qt 窗体淡入淡出

时间:2026-01-29 09:27:13

在开始界面构造函数中添加

1 QPropertyAnimation *animation = new QPropertyAnimation(this, "windowOpacity"); 2 animation>setDuration(1000); 3 animation>setStartValue(0); 4 animation>setEndValue(1); 5 animation>start();

在要结束的界面的方法中添加

1 //界面动画,改变透明度的方式消失1 0渐变 2 QPropertyAnimation *animation = new QPropertyAnimation(this, "windowOpacity"); 3 animation>setDuration(1000); 4 animation>setStartValue(1); 5 animation>setEndValue(0); 6 animation>start(); 7 connect(animation, SIGNAL(finished()), this, SLOT(close()));



上一篇:Qt 解决报错registered using qRegisterMetaType()
下一篇:三菱 FX3U 系列 PLC 的外围接线
Qt
  • 英特尔与 Vertiv 合作开发液冷 AI 处理器
  • 英特尔第五代 Xeon CPU 来了:详细信息和行业反应
  • 由于云计算放缓引发扩张担忧,甲骨文股价暴跌
  • Web开发状况报告详细介绍可组合架构的优点
  • 如何使用 PowerShell 的 Get-Date Cmdlet 创建时间戳
  • 美光在数据中心需求增长后给出了强有力的预测
  • 2027服务器市场价值将接近1960亿美元
  • 生成式人工智能的下一步是什么?
  • 分享在外部存储上安装Ubuntu的5种方法技巧
  • 全球数据中心发展的关键考虑因素
  • 英特尔与 Vertiv 合作开发液冷 AI 处理器

    英特尔第五代 Xeon CPU 来了:详细信息和行业反应

    由于云计算放缓引发扩张担忧,甲骨文股价暴跌

    Web开发状况报告详细介绍可组合架构的优点

    如何使用 PowerShell 的 Get-Date Cmdlet 创建时间戳

    美光在数据中心需求增长后给出了强有力的预测

    2027服务器市场价值将接近1960亿美元

    生成式人工智能的下一步是什么?

    分享在外部存储上安装Ubuntu的5种方法技巧

    全球数据中心发展的关键考虑因素