Details
-
Bug
-
Resolution: Fixed
-
P3: Somewhat important
-
5.9.3, 5.10.0
-
None
-
73698cb3401b9445ba0ad6b0a6cc3e125e50a745
Description
Setting a QGraphicsEffect on a QGraphicsItem in a QGraphicsScene causes that item to be rendered with target device pixel ratio ignored.
#include <QGraphicsScene> #include <QGraphicsView> #include <QGraphicsItem> #include <QGraphicsDropShadowEffect> #include <QPainter> #include <QApplication> #include <QtGlobal> int main(int argc, char *argv[]) { // large scale factor to make the difference clear qputenv("QT_SCALE_FACTOR", QByteArray("2")); QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); QApplication a(argc, argv); QGraphicsScene scene; QGraphicsView view(&scene); view.setRenderHints(QPainter::Antialiasing); // item with a drop shadow effect QGraphicsItem *item = scene.addEllipse(0, 0, 60, 60, QPen(Qt::NoPen), QBrush(Qt::red)); item->setGraphicsEffect(new QGraphicsDropShadowEffect()); // item without scene.addEllipse(100, 0, 60, 60, QPen(Qt::NoPen), QBrush(Qt::red)); view.show(); return a.exec(); }
Attachments
Issue Links
- is duplicated by
-
QTBUG-74963 QGraphicsOpacityEffect blurs items on highdpi
- Closed