Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.3.2, 6.4.2, 6.5.3
-
d96f61672 (dev), d88b17313 (6.10), e10fc5eda (6.9), f64bcade5 (tqtc/lts-6.8), 4aec9781b (tqtc/lts-6.5)
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"); }
Attachments
Issue Links
- is duplicated by
-
QTBUG-111799 QQuickWindow::grabWindow() produces image with window in top left
-
- Closed
-