您当前的位置: 首页 >  qt

令狐掌门

暂无认证

  • 2浏览

    0关注

    513博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

Qt实现窗口四周阴影

令狐掌门 发布时间:2021-06-22 21:54:22 ,浏览量:2

  在某些时候,产品要求阴影窗口,例如下面的效果 在这里插入图片描述   当窗口在白色的背景下,四周就会有阴影。实现方法其实也不难,Qt已经支持的了这种效果,主要是应用QGraphicsDropShadowEffect类,该效果在Qt4.6就已经支持了,Qt助手的解释如下:   A drop shadow effect renders the source with a drop shadow. The color of the drop shadow can be modified using the setColor() function. The drop shadow offset can be modified using the setOffset() function and the blur radius of the drop shadow can be changed with the setBlurRadius() function.   By default, the drop shadow is a semi-transparent dark gray (QColor(63, 63, 63, 180)) shadow, blurred with a radius of 1 at an offset of 8 pixels towards the lower right. The drop shadow offset is specified in device coordinates.   下面给出具体代码以及实现。

关注
打赏
1652240117
查看更多评论
立即登录/注册

微信扫码登录

0.1355s