From be60cd00980917df952019592a89ab223683a67e Mon Sep 17 00:00:00 2001 From: John-Sotack <46409068+John-Sotack@users.noreply.github.com> Date: Fri, 19 Sep 2025 15:18:24 -0400 Subject: [PATCH] Enhance layout.md with note that inclusion of MouseArea may be needed for drag to work. Added explanation about dragging behavior of squares in QML. --- docs/ch04-qmlstart/layout.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ch04-qmlstart/layout.md b/docs/ch04-qmlstart/layout.md index bfb30d61..50c21aca 100644 --- a/docs/ch04-qmlstart/layout.md +++ b/docs/ch04-qmlstart/layout.md @@ -106,6 +106,6 @@ An element has 6 major anchor lines (`top`, `bottom`, `left`, `right`, `horizont ``` ## Hidden Gems - + 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.