[Interest] Poor retina support for QGraphicsView on macOS?

Patrick Stinson patrickkidd at gmail.com
Sat Oct 7 05:11:17 CEST 2017


Hello!

I am seeing the antialiasing is still quite grainy using a QGraphicsView on mac. Is it possible to increase the device pixel ratio, or something similar?

See attached screenshots, expanding to full rez before viewing. Note smoothness of retina button pixmaps at left VS jagged lines in middle.

I am using a QOpenGLWidget for the viewport (though this doesn’t seem to matter):

view.setViewport(QOpenGLWidget())
I am painting QPainterPaths like this:

def paint(self, painter, option, widget):
    painter.save()
    painter.setPen(self.pen)
    painter.setBrush(self.brush)
    painter.drawPath(self.path)
    painter.restore()
with the following render hints:

view.setRenderHints(QPainter.Antialiasing|QPainter.HighQualityAntialiasing|QPainter.SmoothPixmapTransform|QPainter.TextAntialiasing)
and the following attribute set on the QApplication:

app.setAttribute(Qt.AA_UseHighDpiPixmaps, True)
Thanks!
-P






-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20171006/7a36ee31/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 30f213eb-834c-4ab3-a4ab-6a039b98412d.jpg
Type: image/jpeg
Size: 85622 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20171006/7a36ee31/attachment.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: c489c21f-ab9d-45d5-a132-2b413ffee963.jpg
Type: image/jpeg
Size: 187902 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20171006/7a36ee31/attachment-0001.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1403 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20171006/7a36ee31/attachment.bin>


More information about the Interest mailing list