diff options
author | Samuli Piippo <samuli.piippo@qt.io> | 2018-03-01 15:31:10 +0200 |
---|---|---|
committer | Samuli Piippo <samuli.piippo@qt.io> | 2018-03-19 14:30:17 +0000 |
commit | ef7aa7d06eefb33537d37b06cbf970e28e675d56 (patch) | |
tree | 75641d5cb26233ad145c2192d7f59b9a4efc8d7d | |
parent | 2dd93e76e19440f97f79a4d048905e26c01684b6 (diff) |
Don't anchor to item that is part of a layout
Fix warnings for QML Rectangle: Detected anchors on an item
that is part of a layout. This is undefined behavior.
Task-number: QTBUG-66736
Change-Id: I3c52d7ef4c11e5a8b657148352f9ddaa4a84337a
Reviewed-by: Kari Oikarinen <kari.oikarinen@qt.io>
-rw-r--r-- | src/qml/FeaturePermissionBar.qml | 15 | ||||
-rw-r--r-- | src/qml/NavigationBar.qml | 40 | ||||
-rw-r--r-- | src/qml/PageView.qml | 25 | ||||
-rw-r--r-- | src/qml/assets/UIToolBar.qml | 32 |
4 files changed, 26 insertions, 86 deletions
diff --git a/src/qml/FeaturePermissionBar.qml b/src/qml/FeaturePermissionBar.qml index 0d49604..374c9d7 100644 --- a/src/qml/FeaturePermissionBar.qml +++ b/src/qml/FeaturePermissionBar.qml @@ -55,10 +55,7 @@ Rectangle { } Rectangle { color: uiColor - anchors { - top: parent.top - bottom: parent.bottom - } + height: parent.height Layout.fillWidth: true Text { @@ -89,10 +86,7 @@ Rectangle { } Rectangle { width: 1 - anchors { - top: parent.top - bottom: parent.bottom - } + height: parent.height color: uiSeparatorColor } @@ -110,10 +104,7 @@ Rectangle { } Rectangle { width: 1 - anchors { - top: parent.top - bottom: parent.bottom - } + height: parent.height color: uiSeparatorColor } diff --git a/src/qml/NavigationBar.qml b/src/qml/NavigationBar.qml index 742ca47..f6e3bea 100644 --- a/src/qml/NavigationBar.qml +++ b/src/qml/NavigationBar.qml @@ -159,10 +159,7 @@ ToolBar { } Rectangle { width: 1 - anchors { - top: parent.top - bottom: parent.bottom - } + height: parent.height color: uiSeparatorColor } UIButton { @@ -175,19 +172,13 @@ ToolBar { } Rectangle { width: 1 - anchors { - top: parent.top - bottom: parent.bottom - } + height: parent.height color: uiSeparatorColor } Rectangle { Layout.fillWidth: true implicitWidth: 10 - anchors { - top: parent.top - bottom: parent.bottom - } + height: parent.height color: uiColor } TextField { @@ -286,10 +277,7 @@ ToolBar { visible: !cancelButton.visible Layout.fillWidth: true implicitWidth: 10 - anchors { - top: parent.top - bottom: parent.bottom - } + height: parent.height color: uiColor } @@ -313,10 +301,7 @@ ToolBar { } Rectangle { width: 1 - anchors { - top: parent.top - bottom: parent.bottom - } + height: parent.height color: uiSeparatorColor } UIButton { @@ -336,10 +321,7 @@ ToolBar { } Rectangle { width: 1 - anchors { - top: parent.top - bottom: parent.bottom - } + height: parent.height color: uiSeparatorColor } UIButton { @@ -371,10 +353,7 @@ ToolBar { } Rectangle { width: 1 - anchors { - top: parent.top - bottom: parent.bottom - } + height: parent.height color: uiSeparatorColor } UIButton { @@ -402,10 +381,7 @@ ToolBar { } Rectangle { width: 1 - anchors { - top: parent.top - bottom: parent.bottom - } + height: parent.height color: uiSeparatorColor } UIButton { diff --git a/src/qml/PageView.qml b/src/qml/PageView.qml index f7e0448..1ccacb1 100644 --- a/src/qml/PageView.qml +++ b/src/qml/PageView.qml @@ -295,10 +295,7 @@ Rectangle { anchors.fill: parent Rectangle { width: 5 - anchors { - top: parent.top - bottom: parent.bottom - } + height: parent.height color: uiColor } TextField { @@ -324,18 +321,12 @@ Rectangle { } Rectangle { width: 5 - anchors { - top: parent.top - bottom: parent.bottom - } + height: parent.height color: uiColor } Rectangle { width: 1 - anchors { - top: parent.top - bottom: parent.bottom - } + height: parent.height color: uiSeparatorColor } UIButton { @@ -346,10 +337,7 @@ Rectangle { } Rectangle { width: 1 - anchors { - top: parent.top - bottom: parent.bottom - } + height: parent.height color: uiSeparatorColor } UIButton { @@ -360,10 +348,7 @@ Rectangle { } Rectangle { width: 1 - anchors { - top: parent.top - bottom: parent.bottom - } + height: parent.height color: uiSeparatorColor } UIButton { diff --git a/src/qml/assets/UIToolBar.qml b/src/qml/assets/UIToolBar.qml index f692cda..caf4ec1 100644 --- a/src/qml/assets/UIToolBar.qml +++ b/src/qml/assets/UIToolBar.qml @@ -62,14 +62,14 @@ ToolBar { RowLayout { spacing: 0 height: toolBarSize - anchors.fill: parent + anchors { + top: parent.top + right: parent.right + left: parent.left + } Rectangle { width: childrenRect.width - anchors { - left: parent.left - top: parent.top - bottom: parent.bottom - } + height: parent.height color: toolBarFillColor Text { id: titleBox @@ -103,27 +103,18 @@ ToolBar { Rectangle { visible: toolBarButton.visible width: 1 - anchors { - top: parent.top - bottom: parent.bottom - } + height: parent.height color: toolBarSeparatorColor } Rectangle { width: indicatorWidth - anchors { - top: parent.top - bottom: parent.bottom - } + height: parent.height color: toolBarFillColor } Rectangle { color: toolBarFillColor Layout.fillWidth: true - anchors { - top: parent.top - bottom: parent.bottom - } + height: parent.height Rectangle { visible: root.indicator !== "" color: "transparent" @@ -143,10 +134,7 @@ ToolBar { } Rectangle { width: 1 - anchors { - top: parent.top - bottom: parent.bottom - } + height: parent.height color: toolBarSeparatorColor } UIButton { |