aboutsummaryrefslogtreecommitdiffstats
path: root/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.cpp
diff options
context:
space:
mode:
authorThomas Hartmann <thomas.hartmann@qt.io>2022-06-09 19:40:23 +0200
committerThomas Hartmann <thomas.hartmann@qt.io>2022-06-10 09:04:11 +0000
commitd8c605179ad4934c5f9a2060dd398a13821336c4 (patch)
treedddc4719928ae68bff1d63917daf4cb49b36d44a /share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.cpp
parent8ca39444f4cadff3ae543877008cd9f6443380db (diff)
QmlDesigner: Add option for smooth rendering in form editor
Smooth rendering turns on MSAA and doubles the resolution for rendered items. With this option enabled everything stays smooth when zooming in. Around factor 8-10 pixels become clearly visible again, but it still looks relatively smooth. I added both MSAA and increased the resolution to one option, for simplicity. The smooth mode takes 4 times the shared memory, which should not be an issue in most cases. For now, the option is not the default. Task-number: QDS-7129 Task-number: QDS-7128 Change-Id: I8a778650bb40f8ba796960db9bc966e8a1efff4e Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Diffstat (limited to 'share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.cpp')
-rw-r--r--share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.cpp
index 41d0015ce5..5b1f3171ad 100644
--- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.cpp
+++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.cpp
@@ -504,12 +504,12 @@ QImage QuickItemNodeInstance::renderImage() const
if (s_unifiedRenderPath) {
renderImage = nodeInstanceServer()->grabWindow();
renderImage = renderImage.copy(renderBoundingRect.toRect());
+ /* When grabbing an offscren window the device pixel ratio is 1 */
+ renderImage.setDevicePixelRatio(1);
} else {
renderImage = nodeInstanceServer()->grabItem(quickItem());
}
- /* When grabbing an offscren window the device pixel ratio is 1 */
- renderImage.setDevicePixelRatio(1);
#endif
return renderImage;