Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/ch04-qmlstart/layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,6 @@ An element has 6 major anchor lines (`top`, `bottom`, `left`, `right`, `horizont
```

## Hidden Gems

<!-- The dragging did not work for me until I added code MouseArea { anchors.fill: parent; drag.target:parent } to wrap in MouseArea. -->
Our squares have been magically enhanced to enable dragging. Try the example and drag around some squares. You will see that (1) can’t be dragged as it’s anchored on all sides (although you can drag the parent of (1), as it’s not anchored at all). (2) can be vertically dragged, as only the left side is anchored. The same applies to (3). (4) can only be dragged vertically, as both squares are horizontally centered. (5) is centered on the parent, and as such, can’t be dragged. The same applies to (6). Dragging an element means changing its `x,y` position. As anchoring is stronger than setting the `x,y` properties, dragging is restricted by the anchored lines. We will see this effect later when we discuss animations.