Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.3.2, 6.4.2, 6.5.3
Description
Grabbing the contents of a window on macOS with device pixel ratio 2 results in an image with the correct physical size, but the rendered content is too small.
#include <QtGui/QGuiApplication> #include <QtQuick/QQuickWindow> #include <QtQuick/QQuickItem> #include <QtQml/QQmlComponent> int main(int argc, char** argv){ QGuiApplication app{argc, argv}; QQuickWindow window; window.resize({200, 200}); QQmlEngine qmlEngine; QQmlComponent component{&qmlEngine}; component.setData(QByteArrayLiteral("import QtQuick\nRectangle{ color: 'red' }"), {}); auto* item = qobject_cast<QQuickItem*>(component.create()); item->setParent(window.contentItem()); item->setParentItem(window.contentItem()); item->setSize({200, 200}); window.grabWindow().save("qt6-test.png"); }