代码:

    // 设置border-image
    this->setStyleSheet("border-image: url(:/icon/camera.jpg)");



    // 设置QWidget阴影
    //    QGraphicsDropShadowEffect *effect = new QGraphicsDropShadowEffect(this);
    //    effect->setOffset(3, 3);
    //    effect->setBlurRadius(5);
    //    effect->setColor(Qt::gray);
    //    this->setGraphicsEffect(effect);

只设置border-image效果:

【Qt】求助:QGraphicsDropShadowEffect和styleSheet无法同时生效。


只设置阴影效果:

【Qt】求助:QGraphicsDropShadowEffect和styleSheet无法同时生效。


期望显示图片同时显示Widget的 阴影。请高手指点。

相关文章:

  • 2022-12-23
  • 2021-04-06
  • 2021-12-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-24
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-12
  • 2022-02-25
  • 2021-06-14
  • 2021-10-21
相关资源
相似解决方案