Re: [Interest] Poor retina support for QGraphicsView on macOS?

2017-10-08 Thread Patrick Stinson
Very cool. This worked well for the OpenGL viewport.

Thank you Jean-Michaël and Christian for your two solutions for this problem.

> On Oct 7, 2017, at 4:20 PM, Jean-Michaël Celerier 
>  wrote:
> 
> > Can you suggest a sample size,
> 
> 8 or 16 maybe ? I find 4 to be a bit pixelated.
> 
> > or perhaps give a code example?
> 
> QOpenGLWidget* w = new QOpenGLWidget;;
> 
> auto fmt = QSurfaceFormat::getDefaultFormat();
> fmt.setSamples(16);
> 
> w->setFormat(fmt);
> view.setViewport(w);
> 
> 
> 
> ---
> Jean-Michaël Celerier
> http://www.jcelerier.name 
> On Sat, Oct 7, 2017 at 7:36 PM, Patrick Stinson  > wrote:
> Interesting. Can you suggest a sample size, or perhaps give a code example? 
> I’m sure how this works. Thanks!
> 
> On Oct 7, 2017, at 10:01 AM, Jean-Michaël Celerier 
> > 
> wrote:
> 
>> > Don't do that and the anti-aliasing will work.
>> 
>> Or alternatively enable GL antialiasing for instance by using 
>> QSurfaceFormat::setSamples 
>> (http://doc.qt.io/qt-5/qsurfaceformat.html#setSamples 
>> ) and passing the 
>> format to your GL viewport. However this ends up being quite slow on retina 
>> display in my experience.
>> 
>> 
>> 
>> ---
>> Jean-Michaël Celerier
>> http://www.jcelerier.name 
>> On Sat, Oct 7, 2017 at 10:09 AM, Christian Gagneraud > > wrote:
>> On 7 October 2017 at 16:11, Patrick Stinson > > wrote:
>> >
>> > 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):
>> 
>> I vaguely remember that anti-aliasing doesn't work with an OpenGL view
>> (that was on a Linux machine).
>> 
>> > view.setViewport(QOpenGLWidget())
>> 
>> Don't do that and the anti-aliasing will work.
>> 
>> Chris
>> 
>> 
>> 
>> >
>> > 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
>> >
>> >
>> >
>> >
>> >
>> > ___
>> > Interest mailing list
>> > Interest@qt-project.org 
>> > http://lists.qt-project.org/mailman/listinfo/interest 
>> > 
>> >
>> ___
>> Interest mailing list
>> Interest@qt-project.org 
>> http://lists.qt-project.org/mailman/listinfo/interest 
>> 
>> 
> 



smime.p7s
Description: S/MIME cryptographic signature
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Poor retina support for QGraphicsView on macOS?

2017-10-07 Thread Jean-Michaël Celerier
> Can you suggest a sample size,

8 or 16 maybe ? I find 4 to be a bit pixelated.

> or perhaps give a code example?

QOpenGLWidget* w = new QOpenGLWidget;;

auto fmt = QSurfaceFormat::getDefaultFormat();
fmt.setSamples(16);

w->setFormat(fmt);
view.setViewport(w);



---
Jean-Michaël Celerier
http://www.jcelerier.name

On Sat, Oct 7, 2017 at 7:36 PM, Patrick Stinson 
wrote:

> Interesting. Can you suggest a sample size, or perhaps give a code
> example? I’m sure how this works. Thanks!
>
> On Oct 7, 2017, at 10:01 AM, Jean-Michaël Celerier <
> jeanmichael.celer...@gmail.com> wrote:
>
> > Don't do that and the anti-aliasing will work.
>
> Or alternatively enable GL antialiasing for instance by using
> QSurfaceFormat::setSamples (http://doc.qt.io/qt-5/
> qsurfaceformat.html#setSamples) and passing the format to your GL
> viewport. However this ends up being quite slow on retina display in my
> experience.
>
>
>
> ---
> Jean-Michaël Celerier
> http://www.jcelerier.name
>
> On Sat, Oct 7, 2017 at 10:09 AM, Christian Gagneraud 
> wrote:
>
>> On 7 October 2017 at 16:11, Patrick Stinson 
>> wrote:
>> >
>> > 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):
>>
>> I vaguely remember that anti-aliasing doesn't work with an OpenGL view
>> (that was on a Linux machine).
>>
>> > view.setViewport(QOpenGLWidget())
>>
>> Don't do that and the anti-aliasing will work.
>>
>> Chris
>>
>>
>>
>> >
>> > 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.HighQuali
>> tyAntialiasing|QPainter.SmoothPixmapTransform|QPainter.TextAntialiasing)
>> >
>> > and the following attribute set on the QApplication:
>> >
>> > app.setAttribute(Qt.AA_UseHighDpiPixmaps, True)
>> >
>> > Thanks!
>> > -P
>> >
>> >
>> >
>> >
>> >
>> > ___
>> > Interest mailing list
>> > Interest@qt-project.org
>> > http://lists.qt-project.org/mailman/listinfo/interest
>> >
>> ___
>> Interest mailing list
>> Interest@qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/interest
>>
>
>
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Poor retina support for QGraphicsView on macOS?

2017-10-07 Thread Patrick Stinson
Interesting. Can you suggest a sample size, or perhaps give a code example? I’m 
sure how this works. Thanks!

> On Oct 7, 2017, at 10:01 AM, Jean-Michaël Celerier 
>  wrote:
> 
> > Don't do that and the anti-aliasing will work.
> 
> Or alternatively enable GL antialiasing for instance by using 
> QSurfaceFormat::setSamples 
> (http://doc.qt.io/qt-5/qsurfaceformat.html#setSamples) and passing the format 
> to your GL viewport. However this ends up being quite slow on retina display 
> in my experience.
> 
> 
> 
> ---
> Jean-Michaël Celerier
> http://www.jcelerier.name
> 
>> On Sat, Oct 7, 2017 at 10:09 AM, Christian Gagneraud  
>> wrote:
>> On 7 October 2017 at 16:11, Patrick Stinson  wrote:
>> >
>> > 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):
>> 
>> I vaguely remember that anti-aliasing doesn't work with an OpenGL view
>> (that was on a Linux machine).
>> 
>> > view.setViewport(QOpenGLWidget())
>> 
>> Don't do that and the anti-aliasing will work.
>> 
>> Chris
>> 
>> 
>> 
>> >
>> > 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
>> >
>> >
>> >
>> >
>> >
>> > ___
>> > Interest mailing list
>> > Interest@qt-project.org
>> > http://lists.qt-project.org/mailman/listinfo/interest
>> >
>> ___
>> Interest mailing list
>> Interest@qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/interest
> 
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Poor retina support for QGraphicsView on macOS?

2017-10-07 Thread Patrick Stinson
That is correct, this did fix the antialiasing issue at the expense of 
performance. I suppose it is a trade off.

> On Oct 7, 2017, at 1:09 AM, Christian Gagneraud  wrote:
> 
>> On 7 October 2017 at 16:11, Patrick Stinson  wrote:
>> 
>> 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):
> 
> I vaguely remember that anti-aliasing doesn't work with an OpenGL view
> (that was on a Linux machine).
> 
>> view.setViewport(QOpenGLWidget())
> 
> Don't do that and the anti-aliasing will work.
> 
> Chris
> 
> 
> 
>> 
>> 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
>> 
>> 
>> 
>> 
>> 
>> ___
>> Interest mailing list
>> Interest@qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/interest
>> 
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Poor retina support for QGraphicsView on macOS?

2017-10-07 Thread Jean-Michaël Celerier
> Don't do that and the anti-aliasing will work.

Or alternatively enable GL antialiasing for instance by using
QSurfaceFormat::setSamples (
http://doc.qt.io/qt-5/qsurfaceformat.html#setSamples) and passing the
format to your GL viewport. However this ends up being quite slow on retina
display in my experience.



---
Jean-Michaël Celerier
http://www.jcelerier.name

On Sat, Oct 7, 2017 at 10:09 AM, Christian Gagneraud 
wrote:

> On 7 October 2017 at 16:11, Patrick Stinson  wrote:
> >
> > 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):
>
> I vaguely remember that anti-aliasing doesn't work with an OpenGL view
> (that was on a Linux machine).
>
> > view.setViewport(QOpenGLWidget())
>
> Don't do that and the anti-aliasing will work.
>
> Chris
>
>
>
> >
> > 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
> >
> >
> >
> >
> >
> > ___
> > Interest mailing list
> > Interest@qt-project.org
> > http://lists.qt-project.org/mailman/listinfo/interest
> >
> ___
> Interest mailing list
> Interest@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Poor retina support for QGraphicsView on macOS?

2017-10-07 Thread Christian Gagneraud
On 7 October 2017 at 16:11, Patrick Stinson  wrote:
>
> 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):

I vaguely remember that anti-aliasing doesn't work with an OpenGL view
(that was on a Linux machine).

> view.setViewport(QOpenGLWidget())

Don't do that and the anti-aliasing will work.

Chris



>
> 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
>
>
>
>
>
> ___
> Interest mailing list
> Interest@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest