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

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.1.1
    • 5.1.0 RC1, 5.1.0
    • GUI: OpenGL
    • None
    • Windows 7, (ANGLE/Desktop OpenGL).
      Linux XCB/Noveau
    • 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. qt-logo.png
          qt-logo.png
          4 kB
        4. qtbug29945.jpg
          qtbug29945.jpg
          12 kB
        5. qtbug29945.tar
          10 kB
        6. qtbug_29945_brute_force.patch
          0.5 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            sletta Gunnar Sletta
            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