Details
-
Bug
-
Resolution: Done
-
Not Evaluated
-
5.0.1
-
None
-
5a46251de36e568513bca70b82a1d6cc9c9cb0f3
Description
I know that QQuickView supports High-DPI well now.
However, once I embed QQuickView(maybe QWindow?) into QWidget, hight-DPI support is broken.
Here's sample code:
#include <QApplication> #include <QTemporaryFile> #include <QQuickView> #include <QWidget> int main(int argc, char *argv[]) { QApplication app(argc, argv); QTemporaryFile file; file.open(); file.write("import QtQuick 2.0\n Text {text: \"Test\"}"); file.close(); QQuickView view; view.setSource(QUrl::fromLocalFile(file.fileName())); view.resize(200, 50); view.setTitle("Window"); view.show(); QWidget widget; widget.winId(); widget.resize(200, 50); widget.setWindowTitle("Widget"); widget.show(); QQuickView *v = new QQuickView(widget.window()->windowHandle()); v->setSource(QUrl::fromLocalFile(file.fileName())); v->setGeometry(0, 0, 200, 50); v->show(); return app.exec(); }
And the result in HiDPI mode of OS X is attached.
You can see that "Window" shows clear text while the text of "Widget" is dirty.
Although the sample code is using Text element for simplicity, You can see same results for any other elements like Image and textures of Open GL, too.