首页 > 其他 > 详细

qt qml fuzzyPanel 毛玻璃效果

时间:2015-02-05 18:15:47      阅读:1300      评论:0      收藏:0      [点我收藏+]

毛玻璃效果,用qml来写代码真是简短,大爱qml:)

【下载地址】http://download.csdn.net/detail/surfsky/8426641

【核心代码】

 1 Rectangle{
 2     clip: true
 3 
 4     // 属性
 5     property Item target  // 模糊源
 6 
 7     // 毛玻璃效果
 8     FastBlur {
 9         id: blur
10         source: parent.target
11         width: source.width;
12         height: source.height
13         radius: 64
14     }
15 
16     // 设置模糊组件的位置
17     onXChanged: setBlurPosition();
18     onYChanged: setBlurPosition();
19     Component.onCompleted: setBlurPosition();
20     function setBlurPosition(){
21         blur.x = target.x - x;
22         blur.y = target.y - y;
23     }
24 }

【调用方法】

1     FuzzyPanel{
2         id: panel
3         width: 200;
4         height: 200;
5         x: 200
6         y: 200
7         target: panelBg
8     }

【效果图】

技术分享 技术分享

qt qml fuzzyPanel 毛玻璃效果

原文:http://www.cnblogs.com/surfsky/p/4275346.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!