Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-47982

Graphics Effects don't work properly when are set both to widget and its children

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.5.0
    • Widgets: GraphicsView
    • None
    • Windows 7 64-bit
      Debian testing amd64

    Description

      Children widgets disappear when QGraphicsEffect is set to parent and children have already own graphics effect (except the first child). Under Qt 4.8.6 it works fine.

      Example code:

      #include "mainwindow.h"
      
      MainWindow::MainWindow(QWidget *parent) :
          QMainWindow(parent)
      {
         this->resize(120, 115);
      
          QFrame *frm = new QFrame(this);
          frm->setGeometry(this->geometry());
      
          QPushButton *btn1 = new QPushButton("Btn1", frm);
          btn1->setGeometry(10, 10, 100, 25);
      
          QPushButton *btn2 = new QPushButton("Btn2", frm);
          btn2->setGeometry(10, 45, 100, 25);
      
          QPushButton *btn3 = new QPushButton("Btn3", frm);
          btn3->setGeometry(10, 80, 100, 25);
      
          {
              QGraphicsDropShadowEffect *effect = new QGraphicsDropShadowEffect(btn1);
              effect->setBlurRadius(30);
              effect->setColor(Qt::black);
              effect->setOffset(0,0);
              btn1->setGraphicsEffect(effect);
          }
      
          {
              QGraphicsDropShadowEffect *effect = new QGraphicsDropShadowEffect(btn3);
              effect->setBlurRadius(30);
              effect->setColor(Qt::black);
              effect->setOffset(0,0);
              btn3->setGraphicsEffect(effect);
          }
      
          {
              QGraphicsBlurEffect *effect = new QGraphicsBlurEffect(frm);
              effect->setBlurRadius(2);
              frm->setGraphicsEffect(effect);
          }
      
      }
      
      MainWindow::~MainWindow()
      {
      
      }

      Screenshots in attachment.

      Attachments

        1. qt4.8.6.png
          qt4.8.6.png
          12 kB
        2. qt5.5.0.png
          qt5.5.0.png
          8 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            bibr Andreas Aardal Hanssen
            lukasz1235 Łukasz Matczak
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes