From 6a85b7fa00626c544103c48099260d7a36778686 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomi=20Korpip=C3=A4=C3=A4?= Date: Tue, 1 Oct 2013 14:02:32 +0300 Subject: Android QtQuick.Controls button fix Change-Id: If72aa627515978cd30cbb159eb9a6a5dddbb8f52 Change-Id: If72aa627515978cd30cbb159eb9a6a5dddbb8f52 Reviewed-by: Miikka Heikkinen --- examples/qmlbarchart/qml/qmlbarchart/main.qml | 3 ++ examples/qmlscatter/qml/qmlscatter/main.qml | 14 ++++---- examples/qmlscatter/qml/qmlscatter/newbutton.qml | 43 ++++++++++++++++++++++++ examples/qmlscatter/qmlscatter.pro | 5 ++- examples/qmlscatter/qmlscatter.qrc | 1 + examples/qmlsurface/qml/qmlsurface/main.qml | 12 +++---- examples/qmlsurface/qml/qmlsurface/newbutton.qml | 43 ++++++++++++++++++++++++ examples/qmlsurface/qmlsurface.qrc | 1 + 8 files changed, 106 insertions(+), 16 deletions(-) create mode 100644 examples/qmlscatter/qml/qmlscatter/newbutton.qml create mode 100644 examples/qmlsurface/qml/qmlsurface/newbutton.qml (limited to 'examples') diff --git a/examples/qmlbarchart/qml/qmlbarchart/main.qml b/examples/qmlbarchart/qml/qmlbarchart/main.qml index 8159aff8..9ad3f022 100644 --- a/examples/qmlbarchart/qml/qmlbarchart/main.qml +++ b/examples/qmlbarchart/qml/qmlbarchart/main.qml @@ -84,6 +84,7 @@ Item { id: mappingToggle anchors.bottom: parent.bottom width: tableView.width + height: 60 text: "Show Income" onClicked: { if (chartData.mapping.valueRole === "expenses") { @@ -102,6 +103,7 @@ Item { id: shadowToggle anchors.bottom: mappingToggle.top width: tableView.width + height: 60 text: "Hide Shadows" onClicked: { if (testChart.shadowQuality == Bars3D.ShadowNone) { @@ -118,6 +120,7 @@ Item { id: dataToggle anchors.bottom: shadowToggle.top width: tableView.width + height: 60 text: "Show 2010 - 2012" onClicked: { if (testChart.rowAxis.max !== 6) { diff --git a/examples/qmlscatter/qml/qmlscatter/main.qml b/examples/qmlscatter/qml/qmlscatter/main.qml index d3a650db..e533801b 100644 --- a/examples/qmlscatter/qml/qmlscatter/main.qml +++ b/examples/qmlscatter/qml/qmlscatter/main.qml @@ -17,7 +17,6 @@ ****************************************************************************/ import QtQuick 2.1 -import QtQuick.Controls 1.0 import com.digia.QtDataVisualization 1.0 import "." @@ -58,7 +57,7 @@ Item { } } - Button { + NewButton { id: shadowToggle width: parent.width / 6 text: "Hide Shadows" @@ -73,7 +72,7 @@ Item { } } - Button { + NewButton { id: smoothToggle width: parent.width / 6 text: "Use Smooth Dots" @@ -89,7 +88,7 @@ Item { } } - Button { + NewButton { id: cameraToggle width: parent.width / 6 text: "Change Camera Placement" @@ -103,7 +102,7 @@ Item { } } - Button { + NewButton { id: themeToggle width: parent.width / 6 text: "Change Theme" @@ -117,7 +116,7 @@ Item { } } - Button { + NewButton { id: backgroundToggle width: parent.width / 6 text: "Hide Background" @@ -132,7 +131,8 @@ Item { } } } - Button { + + NewButton { id: exitButton width: parent.width / 6 text: "Quit" diff --git a/examples/qmlscatter/qml/qmlscatter/newbutton.qml b/examples/qmlscatter/qml/qmlscatter/newbutton.qml new file mode 100644 index 00000000..895db183 --- /dev/null +++ b/examples/qmlscatter/qml/qmlscatter/newbutton.qml @@ -0,0 +1,43 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc +** All rights reserved. +** For any questions to Digia, please use contact form at http://qt.digia.com +** +** This file is part of the QtDataVisualization module. +** +** Licensees holding valid Qt Enterprise licenses may use this file in +** accordance with the Qt Enterprise License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. +** +** If you have questions regarding the use of this file, please use +** contact form at http://qt.digia.com +** +****************************************************************************/ + +import QtQuick 2.1 +import QtQuick.Controls 1.0 + +Item { + id: newbutton + + property alias text: buttonText.text + + signal clicked + + height: 80 + + Button { + width: parent.width + height: parent.height + Text { + id: buttonText + wrapMode: Text.WordWrap + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignHCenter + anchors.fill: parent + } + onClicked: newbutton.clicked() + } +} diff --git a/examples/qmlscatter/qmlscatter.pro b/examples/qmlscatter/qmlscatter.pro index 6f89fbae..b42fd239 100644 --- a/examples/qmlscatter/qmlscatter.pro +++ b/examples/qmlscatter/qmlscatter.pro @@ -2,6 +2,8 @@ error( "Couldn't find the examples.pri file!" ) } +QT += widgets + # Add more folders to ship with the application, here folder_01.source = qml/qmlscatter folder_01.target = qml @@ -13,9 +15,6 @@ QML_IMPORT_PATH = # The .cpp file which was generated for your project. Feel free to hack it. SOURCES += main.cpp -# Installation path -# target.path = - # Please do not modify the following two lines. Required for deployment. include(qtquick2applicationviewer/qtquick2applicationviewer.pri) qtcAddDeployment() diff --git a/examples/qmlscatter/qmlscatter.qrc b/examples/qmlscatter/qmlscatter.qrc index 3746e6b3..6b77a4bc 100644 --- a/examples/qmlscatter/qmlscatter.qrc +++ b/examples/qmlscatter/qmlscatter.qrc @@ -2,5 +2,6 @@ qml/qmlscatter/main.qml qml/qmlscatter/data.qml + qml/qmlscatter/newbutton.qml diff --git a/examples/qmlsurface/qml/qmlsurface/main.qml b/examples/qmlsurface/qml/qmlsurface/main.qml index 2e192197..0b22d6b6 100644 --- a/examples/qmlsurface/qml/qmlsurface/main.qml +++ b/examples/qmlsurface/qml/qmlsurface/main.qml @@ -17,7 +17,6 @@ ****************************************************************************/ import QtQuick 2.1 -import QtQuick.Controls 1.0 import com.digia.QtDataVisualization 1.0 import "." @@ -71,8 +70,9 @@ Item { } } - Button { + NewButton { id: surfaceGridToggle + anchors.top: parent.top anchors.left: parent.left width: 200 text: "Show Surface Grid" @@ -87,7 +87,7 @@ Item { } } - Button { + NewButton { id: smoothSurfaceToggle anchors.top: surfaceGridToggle.bottom width: surfaceGridToggle.width @@ -103,7 +103,7 @@ Item { } } - Button { + NewButton { id: backgroundToggle anchors.top: smoothSurfaceToggle.bottom width: smoothSurfaceToggle.width @@ -119,7 +119,7 @@ Item { } } - Button { + NewButton { id: gridToggle anchors.top: backgroundToggle.bottom width: backgroundToggle.width @@ -135,7 +135,7 @@ Item { } } - Button { + NewButton { id: proxyToggle anchors.top: gridToggle.bottom width: gridToggle.width diff --git a/examples/qmlsurface/qml/qmlsurface/newbutton.qml b/examples/qmlsurface/qml/qmlsurface/newbutton.qml new file mode 100644 index 00000000..895db183 --- /dev/null +++ b/examples/qmlsurface/qml/qmlsurface/newbutton.qml @@ -0,0 +1,43 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc +** All rights reserved. +** For any questions to Digia, please use contact form at http://qt.digia.com +** +** This file is part of the QtDataVisualization module. +** +** Licensees holding valid Qt Enterprise licenses may use this file in +** accordance with the Qt Enterprise License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. +** +** If you have questions regarding the use of this file, please use +** contact form at http://qt.digia.com +** +****************************************************************************/ + +import QtQuick 2.1 +import QtQuick.Controls 1.0 + +Item { + id: newbutton + + property alias text: buttonText.text + + signal clicked + + height: 80 + + Button { + width: parent.width + height: parent.height + Text { + id: buttonText + wrapMode: Text.WordWrap + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignHCenter + anchors.fill: parent + } + onClicked: newbutton.clicked() + } +} diff --git a/examples/qmlsurface/qmlsurface.qrc b/examples/qmlsurface/qmlsurface.qrc index 9c2e9108..d0745b94 100644 --- a/examples/qmlsurface/qmlsurface.qrc +++ b/examples/qmlsurface/qmlsurface.qrc @@ -2,6 +2,7 @@ qml/qmlsurface/main.qml qml/qmlsurface/data.qml + qml/qmlsurface/newbutton.qml heightmap.png -- cgit v1.2.3