diff options
Diffstat (limited to 'examples/quickcontrols2/gallery/pages/ButtonPage.qml')
-rw-r--r-- | examples/quickcontrols2/gallery/pages/ButtonPage.qml | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/examples/quickcontrols2/gallery/pages/ButtonPage.qml b/examples/quickcontrols2/gallery/pages/ButtonPage.qml index 7e945fa1..39776380 100644 --- a/examples/quickcontrols2/gallery/pages/ButtonPage.qml +++ b/examples/quickcontrols2/gallery/pages/ButtonPage.qml @@ -39,13 +39,12 @@ ****************************************************************************/ import QtQuick 2.6 +import QtQuick.Layouts 1.0 import QtQuick.Controls 2.1 ScrollablePage { id: page - readonly property int itemWidth: Math.max(button.implicitWidth, Math.min(button.implicitWidth * 2, page.availableWidth / 3)) - Column { spacing: 40 width: parent.width @@ -58,24 +57,24 @@ ScrollablePage { + "Buttons are normally used to perform an action, or to answer a question." } - Column { + ColumnLayout { spacing: 20 anchors.horizontalCenter: parent.horizontalCenter Button { text: "First" - width: itemWidth + Layout.fillWidth: true } Button { id: button text: "Second" - width: itemWidth highlighted: true + Layout.fillWidth: true } Button { text: "Third" enabled: false - width: itemWidth + Layout.fillWidth: true } } } |