diff --git a/examples/quick/controls/gallery/main.qml b/examples/quick/controls/gallery/main.qml
index aff3cb4c982e0b10e430be7b4cb1ff1ab3b486ef..7da74031e864be70d09659da52a8316cc739eb40 100644
--- a/examples/quick/controls/gallery/main.qml
+++ b/examples/quick/controls/gallery/main.qml
@@ -69,9 +69,8 @@ ApplicationWindow {
         onAccepted: imageViewer.open(fileUrl)
     }
 
-    ToolBar {
+    toolBar: ToolBar {
         id: toolbar
-        width: parent.width
         RowLayout {
             spacing: 2
             anchors.verticalCenter: parent.verticalCenter
@@ -265,10 +264,7 @@ ApplicationWindow {
         id:frame
         enabled: enabledCheck.checked
         tabPosition: controlPage.item ? controlPage.item.tabPosition : Qt.TopEdge
-        anchors.top: toolbar.bottom
-        anchors.bottom: parent.bottom
-        anchors.right: parent.right
-        anchors.left: parent.left
+        anchors.fill: parent
         anchors.margins: Qt.platform.os === "mac" ? 12 : 2
 
         Tab {
diff --git a/src/controls/ApplicationWindow.qml b/src/controls/ApplicationWindow.qml
index 44b6f187cedd997a069c3329926651a30559bfe4..f2e181a583fa40e81e80b639b4ba16f2ffa9d9fa 100644
--- a/src/controls/ApplicationWindow.qml
+++ b/src/controls/ApplicationWindow.qml
@@ -141,11 +141,12 @@ Window {
         id: backgroundItem
         anchors.fill: parent
 
-        Row {
+        Item {
             id: toolBarArea
             anchors.top: parent.top
             anchors.left: parent.left
             anchors.right: parent.right
+            height: childrenRect.height
         }
 
         Item {
@@ -156,11 +157,12 @@ Window {
             anchors.bottom: statusBarArea.top
         }
 
-        Row {
+        Item {
             id: statusBarArea
             anchors.bottom: parent.bottom
             anchors.left: parent.left
             anchors.right: parent.right
+            height: childrenRect.height
         }
 
         onVisibleChanged: if (visible && menuBar) menuBar.__parentWindow = root
diff --git a/src/controls/StatusBar.qml b/src/controls/StatusBar.qml
index b5d9e4d82bd5009725e2c264e57dffb36e56c8b1..248c16eeba09bff61e1934e1942c7016835df72d 100644
--- a/src/controls/StatusBar.qml
+++ b/src/controls/StatusBar.qml
@@ -70,7 +70,8 @@ Item {
     id: statusbar
     activeFocusOnTab: false
     Accessible.role: Accessible.StatusBar
-    implicitWidth: parent ? parent.width : loader.item ? loader.item.implicitHeight : 0
+    width: parent ? parent.width : implicitWidth
+    implicitWidth: loader.item.implicitHeight
     implicitHeight: loader.item ? loader.item.implicitHeight : 0
     property Component style: Qt.createComponent(Settings.theme() + "/StatusBarStyle.qml", statusbar)
     Loader {
diff --git a/src/controls/ToolBar.qml b/src/controls/ToolBar.qml
index abf8c2fa11180608468ae6fdcad7666916d9b0d2..71ef30a514c65810a1d8f07ebc4bc42f5b06da05 100644
--- a/src/controls/ToolBar.qml
+++ b/src/controls/ToolBar.qml
@@ -73,6 +73,7 @@ Item {
     id: toolbar
     activeFocusOnTab: false
     Accessible.role: Accessible.ToolBar
+    width: parent ? parent.width : implicitWidth
     implicitWidth: loader.item ? loader.item.implicitWidth : 0
     implicitHeight: loader.item ? loader.item.implicitHeight : 0
     property Component style: Qt.createComponent(Settings.theme() + "/ToolBarStyle.qml", toolbar)