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
-
For Gerrit Dashboard: QTBUG-116675 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
649599,3 | sg: Fix dpr when grabbing a not-yet-shown QQuickWindow | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
649732,2 | sg: Fix dpr when grabbing a not-yet-shown QQuickWindow | 6.10 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
649804,2 | sg: Fix dpr when grabbing a not-yet-shown QQuickWindow | 6.9 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
650365,2 | sg: Fix dpr when grabbing a not-yet-shown QQuickWindow | tqtc/lts-6.8 | qt/tqtc-qtdeclarative | Status: MERGED | +2 | 0 |
650510,2 | sg: Fix dpr when grabbing a not-yet-shown QQuickWindow | tqtc/lts-6.5 | qt/tqtc-qtdeclarative | Status: MERGED | +2 | 0 |