diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2021-09-01 15:29:26 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2021-09-22 20:39:52 +0200 |
commit | 38ac4b4ec2c08a6ea4ae693514e8c3520eb00c2a (patch) | |
tree | 612d64352667aec0150cccbb395f910a9d298ed2 /examples/quick/shapes/dashPattern.qml | |
parent | a15472716dbef63f1e5ad27ee412c2a2408b44e2 (diff) |
Shapes example: give each qml file's root item a default size
Each square is resized anyway in shapegallery.qml; but for the sake of
running individual examples on the command line with qml, the content
being shown should be visible. Without this fix, each item had a 0,0
size by default; but the shapes themselves have their own sizes and are
centered in the zero-size root item. But when a window is created, the
window system does not allow it to have zero size, so it expands; and
then the shape would be centered at the top-left corner, and you could
only see part of it.
Pick-to: 6.2
Change-Id: I42a537421430aea8233106353e9c2033f5bc5774
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'examples/quick/shapes/dashPattern.qml')
-rw-r--r-- | examples/quick/shapes/dashPattern.qml | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/examples/quick/shapes/dashPattern.qml b/examples/quick/shapes/dashPattern.qml index bcf6c40c3c..f64f02c5d9 100644 --- a/examples/quick/shapes/dashPattern.qml +++ b/examples/quick/shapes/dashPattern.qml @@ -53,6 +53,8 @@ import QtQuick.Shapes Rectangle { color: "lightGray" + width: 256 + height: 256 Shape { width: 200 height: 150 |