#include "widget.h"
#include "ui_widget.h"
#include <QGraphicsDropShadowEffect>
Widget::Widget(QWidget *parent) :
QWidget(parent),
ui(new Ui::Widget)
{
ui->setupUi(this);
setWindowFlags(Qt::FramelessWindowHint);
setAttribute(Qt::WA_TranslucentBackground);
// auto shadowEffect = new QGraphicsDropShadowEffect(this);
// shadowEffect->setOffset(0,0);
// shadowEffect->setColor(Qt::black);
// //shadowEffect->setColor(QColor(0, 0, 0, 100));
// shadowEffect->setBlurRadius(12);
// ui->frmBg->setGraphicsEffect(shadowEffect);
this->setStyleSheet("background-color: rgb(255, 255, 255);");
QGraphicsDropShadowEffect *shadow_effect = new QGraphicsDropShadowEffect(this);
shadow_effect->setBlurRadius(15);//用于设定阴影的模糊度
shadow_effect->setColor(QColor(0, 0, 0, 150));
shadow_effect->setOffset(1.0);//哪个方向产生阴影效果
ui->frmBg->setGraphicsEffect(shadow_effect);
}
Widget::~Widget()
{
delete ui;
}
qt 纯代码实现界面阴影效果 总结
需积分: 50 188 浏览量
2018-07-30
18:47:19
上传
评论
收藏 8KB RAR 举报
雪狼牙
- 粉丝: 181
- 资源: 14
最新资源
- 装修通用报价参考,基础施工项目+水电工程项目+瓦木项目,超级详细
- 三菱PLC例程源码Medocsequencegenerator
- 三菱PLC例程源码M1320磨头进出FX1s控制步进电机,有注释
- STRASSEN矩阵乘法算法(改进分治法·C语言)
- 前端.xmind前端.xmind前端.xmind前端.xmind前端.xmind
- 三菱PLC例程源码LOW-E玻璃镀膜线程序(三菱QPLC的)一万步带注释
- 三菱PLC例程源码LCD设备蚀刻机程序
- 三菱PLC例程源码LCD设备蚀刻机
- 全面前端开发指南:从基础到深入
- pvk2pfx 32位 Pvk2Pfx (Pvk2Pfx.exe) 是一种命令行工具,可将 .spc、.cer 和 .pvk 文
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈