diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2018-02-19 13:08:14 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2018-02-19 13:08:14 +0100 |
commit | 21a91b0ee1e7bde013cba1e4ce333dfeb238877d (patch) | |
tree | 21394f812adcf52f9d2d2f8a039899fa418b78d5 | |
parent | f7d858c49a6d535d4c62a7e976d7daeac58a7a8c (diff) | |
parent | c924a94fb5077028965e2c6343e1bafabc0e69f8 (diff) |
Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: Id375217229c7f7dc7a8a2dc7edcfd56bbe403952
13 files changed, 53 insertions, 38 deletions
diff --git a/examples/quickcontrols2/imagine/automotive/qml/automotive.qml b/examples/quickcontrols2/imagine/automotive/qml/automotive.qml index a2985d0f..86355bb0 100644 --- a/examples/quickcontrols2/imagine/automotive/qml/automotive.qml +++ b/examples/quickcontrols2/imagine/automotive/qml/automotive.qml @@ -201,8 +201,8 @@ ApplicationWindow { value: 42 to: 100 stepSize: 1 - anchors.horizontalCenter: parent.horizontalCenter + Layout.alignment: Qt.AlignHCenter Layout.minimumWidth: 64 Layout.minimumHeight: 64 Layout.preferredWidth: 128 @@ -241,8 +241,8 @@ ApplicationWindow { font.pixelSize: fontSizeMedium * 0.8 horizontalAlignment: Label.AlignHCenter glowEnabled: false - anchors.bottom: radioOption.bottom + Layout.alignment: Qt.AlignBottom Layout.fillWidth: true } GlowingLabel { @@ -251,8 +251,8 @@ ApplicationWindow { font.pixelSize: fontSizeMedium * 0.6 horizontalAlignment: Label.AlignRight glowEnabled: false - anchors.bottom: radioOption.bottom + Layout.alignment: Qt.AlignBottom Layout.fillWidth: true } } diff --git a/examples/quickcontrols2/imagine/musicplayer/musicplayer.qml b/examples/quickcontrols2/imagine/musicplayer/musicplayer.qml index 84084862..f772fa42 100644 --- a/examples/quickcontrols2/imagine/musicplayer/musicplayer.qml +++ b/examples/quickcontrols2/imagine/musicplayer/musicplayer.qml @@ -188,15 +188,14 @@ ApplicationWindow { } Dial { - anchors.horizontalCenter: parent.horizontalCenter - + Layout.alignment: Qt.AlignHCenter Layout.topMargin: 50 } Label { text: "Volume" - anchors.horizontalCenter: parent.horizontalCenter + Layout.alignment: Qt.AlignHCenter Layout.topMargin: 12 } } diff --git a/src/imports/controls/GroupBox.qml b/src/imports/controls/GroupBox.qml index a594869b..2985c02e 100644 --- a/src/imports/controls/GroupBox.qml +++ b/src/imports/controls/GroupBox.qml @@ -66,9 +66,9 @@ T.GroupBox { } background: Rectangle { - y: control.topPadding - control.padding + y: control.topPadding - control.bottomPadding width: parent.width - height: parent.height - control.topPadding + control.padding + height: parent.height - control.topPadding + control.bottomPadding color: "transparent" border.color: control.palette.mid diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-groupbox-custom.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-groupbox-custom.qml index cdab3e62..afefd3d8 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-groupbox-custom.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-groupbox-custom.qml @@ -34,9 +34,9 @@ GroupBox { title: qsTr("GroupBox") background: Rectangle { - y: control.topPadding - control.padding + y: control.topPadding - control.bottomPadding width: parent.width - height: parent.height - control.topPadding + control.padding + height: parent.height - control.topPadding + control.bottomPadding color: "transparent" border.color: "#21be2b" radius: 2 diff --git a/src/imports/controls/doc/src/includes/qquickoverlay-popup-parent.qdocinc b/src/imports/controls/doc/src/includes/qquickoverlay-popup-parent.qdocinc new file mode 100644 index 00000000..7ad8a003 --- /dev/null +++ b/src/imports/controls/doc/src/includes/qquickoverlay-popup-parent.qdocinc @@ -0,0 +1,20 @@ +The following example uses the attached \l {Overlay::overlay}{Overlay.overlay} +property to position a popup in the center of the window, despite the position +of the button that opens the popup: + +\code +Button { + onClicked: popup.open() + + Popup { + id: popup + + parent: Overlay.overlay + + x: (parent.width - width) / 2 + y: (parent.height - height) / 2 + width: 100 + height: 100 + } +} +\endcode diff --git a/src/imports/controls/doc/src/qtquickcontrols2-configuration.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-configuration.qdoc index 9d356686..cab3b6fe 100644 --- a/src/imports/controls/doc/src/qtquickcontrols2-configuration.qdoc +++ b/src/imports/controls/doc/src/qtquickcontrols2-configuration.qdoc @@ -53,6 +53,10 @@ Primary=BlueGrey \endcode + It is possible to specify a custom location for the configuration file with + the \l {Supported Environment Variables in Qt Quick Controls 2} + {QT_QUICK_CONTROLS_CONF} environment variable. + \section1 Controls Section The following values can be specified in a \c Controls section of the diff --git a/src/imports/controls/fusion/GroupBox.qml b/src/imports/controls/fusion/GroupBox.qml index a98cc9a8..439783ac 100644 --- a/src/imports/controls/fusion/GroupBox.qml +++ b/src/imports/controls/fusion/GroupBox.qml @@ -68,9 +68,9 @@ T.GroupBox { } background: Rectangle { - y: control.topPadding - control.padding + y: control.topPadding - control.bottomPadding width: parent.width - height: parent.height - control.topPadding + control.padding + height: parent.height - control.topPadding + control.bottomPadding radius: 2 color: Color.transparent("black", 3 / 255) diff --git a/src/imports/controls/imagine/GroupBox.qml b/src/imports/controls/imagine/GroupBox.qml index f262fb5f..b2868cec 100644 --- a/src/imports/controls/imagine/GroupBox.qml +++ b/src/imports/controls/imagine/GroupBox.qml @@ -88,7 +88,7 @@ T.GroupBox { background: NinePatchImage { x: -leftInset - y: control.topPadding - control.padding - topInset + y: control.topPadding - control.bottomPadding - topInset width: control.width + leftInset + rightInset height: control.height + topInset + bottomInset - control.topPadding + control.padding diff --git a/src/imports/controls/material/CheckDelegate.qml b/src/imports/controls/material/CheckDelegate.qml index 8ccf399f..1d3ff61d 100644 --- a/src/imports/controls/material/CheckDelegate.qml +++ b/src/imports/controls/material/CheckDelegate.qml @@ -52,8 +52,8 @@ T.CheckDelegate { baselineOffset: contentItem.y + contentItem.baselineOffset padding: 16 - topPadding: 14 - bottomPadding: 14 + topPadding: 8 + bottomPadding: 8 spacing: 16 icon.width: 24 diff --git a/src/imports/controls/material/GroupBox.qml b/src/imports/controls/material/GroupBox.qml index cc2ab0f0..7ac30ec6 100644 --- a/src/imports/controls/material/GroupBox.qml +++ b/src/imports/controls/material/GroupBox.qml @@ -66,9 +66,9 @@ T.GroupBox { } background: Rectangle { - y: control.topPadding - control.padding + y: control.topPadding - control.bottomPadding width: parent.width - height: parent.height - control.topPadding + control.padding + height: parent.height - control.topPadding + control.bottomPadding radius: 2 color: control.Material.elevation > 0 ? control.Material.backgroundColor : "transparent" diff --git a/src/imports/controls/universal/GroupBox.qml b/src/imports/controls/universal/GroupBox.qml index f6b0b271..8fb68e29 100644 --- a/src/imports/controls/universal/GroupBox.qml +++ b/src/imports/controls/universal/GroupBox.qml @@ -67,9 +67,9 @@ T.GroupBox { } background: Rectangle { - y: control.topPadding - control.padding + y: control.topPadding - control.bottomPadding width: parent.width - height: parent.height - control.topPadding + control.padding + height: parent.height - control.topPadding + control.bottomPadding color: "transparent" border.color: control.Universal.chromeDisabledLowColor diff --git a/src/quicktemplates2/qquickoverlay.cpp b/src/quicktemplates2/qquickoverlay.cpp index 38f7949e..fe61dae2 100644 --- a/src/quicktemplates2/qquickoverlay.cpp +++ b/src/quicktemplates2/qquickoverlay.cpp @@ -60,26 +60,9 @@ QT_BEGIN_NAMESPACE \l {Popup::dim}{dimmed} popup is visible. The overlay is an ordinary Item that covers the entire window. It can be used - as a visual parent to position a popup in scene coordinates. The following - example uses the attached \c overlay property to position a popup to the center - of the window, despite the position of the button that opens the popup. + as a visual parent to position a popup in scene coordinates. - \code - Button { - onClicked: popup.open() - - Popup { - id: popup - - parent: Overlay.overlay - - x: (parent.width - width) / 2 - y: (parent.height - height) / 2 - width: 100 - height: 100 - } - } - \endcode + \include qquickoverlay-popup-parent.qdocinc \sa ApplicationWindow */ diff --git a/src/quicktemplates2/qquickpopup.cpp b/src/quicktemplates2/qquickpopup.cpp index e789710d..48bb0f98 100644 --- a/src/quicktemplates2/qquickpopup.cpp +++ b/src/quicktemplates2/qquickpopup.cpp @@ -168,6 +168,15 @@ QT_BEGIN_NAMESPACE } \endcode + \section1 Popup Positioning + + Similar to items in Qt Quick, Popup's \l x and \l y coordinates are + relative to its parent. This means that opening a popup that is a + child of a \l Button, for example, will cause the popup to be positioned + relative to the button. + + \include qquickoverlay-popup-parent.qdocinc + \sa {Popup Controls}, {Customizing Popup}, ApplicationWindow */ |