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

Widgets with setGraphicsEffect embedded as QGraphicsProxyWidget are misrendered

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.8.0
    • Widgets: GraphicsView
    • None

    Description

      The following code fails to render the label correctly (it is not visible for me.. for larger apps, there are also render artefacts, like flickering). This happens with any embedded widget that has an effect installed on the QWidget directly, rather than on its proxy widget (which happens with existing widgets, that weren't developed with QGraphicsView in mind - use-case par excellence for QGraphicsProxyWidget).

          #include <QGraphicsProxyWidget>
          #include <QGraphicsOpacityEffect>
          #include <QGraphicsView>
          #include <QGraphicsScene>
          #include <QApplication>
          #include <QLabel>
      
          int main(int argc, char **argv) {
            QApplication qapp(argc, argv);
        
            QLabel *label = new QLabel("hello folks");
            QGraphicsOpacityEffect *eff = new QGraphicsOpacityEffect();
            eff->setOpacity(0.5);
            label->setGraphicsEffect(eff);
            label->show();
      
            QGraphicsView qgv;
            QGraphicsScene qgs;
            qgv.setScene(&qgs);
            qgs.addWidget(label);
            qgv.show();
            return qapp.exec();
          }
      

      The problem has existed since at least the Qt4.8 days.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            litb Johannes Schaub
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes