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

QGraphicsDropShadowEffect does not look right in 5.0.1 when setting a QGLWidget as viewport of a QGraphicsView

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Done
    • Affects Version/s: 5.1.0 RC1, 5.1.0
    • Fix Version/s: 5.1.1
    • Component/s: GUI: OpenGL
    • Labels:
      None
    • Environment:
      Windows 7, (ANGLE/Desktop OpenGL).
      Linux XCB/Noveau
    • Commits:
      032d2c9e8eaa98ba191d5f90fa7509ebdf846ed1

      Description

      Run the following code. Because QGLWidget is set as viewport to QGraphicsView, shadow is not drawn correctly.
      When tested with Qt5.0.1 built with configure option -opengl desktop, this warning is present:
      QWindowsGLContext::getProcAddress: Unable to resolve 'glShaderBinary'

      When using Qt5.0.1_mingw binary installer this warning is present when runnint the app:
      QGLShader::link: "(45,20): warning X3206: implicit truncation of vector type

      In Qt4, shadow is drawn correctly and no warnings present. Attach is the images of how it looks in Qt5 and Qt4 and also the test image.

      #include "mainwindow.h"
      #include <QApplication>
      #include <QtWidgets>
      #include <QGLWidget>
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
      
          QGraphicsView *view = new QGraphicsView();
          view->setGeometry(0, 0, 150, 150);
      
          QGraphicsScene *scene = new QGraphicsScene(view);
          view->setScene(scene);
          QGLWidget* glwidget = new QGLWidget();
          view->setViewport(glwidget);
      
          QGraphicsPixmapItem *iconDeveloper = new QGraphicsPixmapItem(QPixmap(":/Icons/qt-logo.png"), 0);
          QGraphicsDropShadowEffect *shadowDeveloper = new QGraphicsDropShadowEffect();
          shadowDeveloper->setOffset(QPointF(6, 6));
          iconDeveloper->setGraphicsEffect(shadowDeveloper);
          scene->addItem(iconDeveloper);
          view->show();
          return a.exec();
      }
      

        Attachments

        1. Qt4.jpg
          Qt4.jpg
          11 kB
        2. Qt5.jpg
          Qt5.jpg
          12 kB
        3. qtbug_29945_brute_force.patch
          0.5 kB
        4. qtbug29945.jpg
          qtbug29945.jpg
          12 kB
        5. qtbug29945.tar
          10 kB
        6. qt-logo.png
          qt-logo.png
          4 kB
        For Gerrit Dashboard: QTBUG-29945
        # Subject Branch Project Status CR V

          Activity

            People

            • Assignee:
              sletta Gunnar Sletta
              Reporter:
              qtcomsupport Qt Support
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes