Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.1.0 RC1, 5.1.0
-
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(); }