How do I enable HiDPI (Retina) support in a Qt4 OpenGL application?
Asked Answered
Q

2

3

I am using a QGraphicsScene with a QGraphicsView, as described in this document. I intend to eventually overlay Qt widgets on top of my OpenGL rendered scene.

When I launch a dummy application modeled after the tutorial above, the rendered view is heavily pixelated-- HiDPI isn't working at all. Per this document, I've manually added:

<key>NSHighResolutionCapable</key>
<string>True</string> 

to the application's Info.plist file, still with no effect. (It seems this is supposed to default to true anyway, so maybe that's not surprising).

Beyond the above, I haven't found what's needed to get HiDPI working. I am not using QtCreator, and my Qt install is macports' qt4-mac. What am I missing?

Questor answered 1/6, 2014 at 22:24 Comment(0)
Q
1

Qt5 enables HiDPI for the OpenGL context, but not for widgets and QGraphicsItems.

According to this bug, support for rendering widgets and QGraphicsItems on a QGLWidget in HiDPI is not yet supported; they will render at standard res and be resized.

QGraphicsView will render in HiDPI if it has an ordinary QWidget to back it. If it is possible to achieve the desired effect using QGraphicsItems without OpenGL, this may be preferable until HiDPI support is improved.

Questor answered 5/6, 2014 at 22:46 Comment(0)
I
0

I just found the solution: run your program with --graphicssystem native. Or if you can alter the sources you can use QApplication::setGraphicsSystem("native");.

Indefeasible answered 28/3, 2015 at 21:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.