Qt:给QWidget添加shadow效果

Qt:给QWidget添加shadow效果
@import url(http://www.cppblog.com/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css);
    Widget::Widget(QWidget *parent) : QWidget(parent),
    ui(new Ui::Widget), data(new WidgetPrivate) {
    ui->setupUi(this);

    QGraphicsBlurEffect *effect = new QGraphicsBlurEffect(this);
    effect->setBlurRadius(1.5);

    QGraphicsDropShadowEffect *shadowEffect = new QGraphicsDropShadowEffect(this);
    shadowEffect->setBlurRadius(5);
    shadowEffect->setXOffset(2);
    shadowEffect->setYOffset(2);

    ui->checkBox->setGraphicsEffect(shadowEffect);
}
    
    

你可能感兴趣的:(Qt:给QWidget添加shadow效果)