summaryrefslogtreecommitdiff
path: root/src/qml/doc/snippets/qmltc/MyButton.qml
diff options
context:
space:
mode:
authorAndrei Golubev <andrei.golubev@qt.io>2021-12-13 17:12:46 +0100
committerAndrei Golubev <andrei.golubev@qt.io>2022-01-19 14:47:46 +0100
commitde30f10aeb1ccf495cf39b3910e89d60f3dc591a (patch)
tree285e051fc28030d3618dd2248db987a5937f09ec /src/qml/doc/snippets/qmltc/MyButton.qml
parent736154562228958f7887914d3af650800e660032 (diff)
downloadqtdeclarative-de30f10aeb1ccf495cf39b3910e89d60f3dc591a.tar.gz
Document qmltc tool
Add initial qmltc tool documentation with introduction, compilation process picture, description and limitations To simplify the description, we can consider some simple application. The same app can additionally become a test scenario for qmltc and a showcase of its capabilities Task-number: QTBUG-84368 Pick-to: 6.3 Change-Id: If6d586a8c68f48d17133b25170d0fff627e2066c Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/doc/snippets/qmltc/MyButton.qml')
-rw-r--r--src/qml/doc/snippets/qmltc/MyButton.qml77
1 files changed, 77 insertions, 0 deletions
diff --git a/src/qml/doc/snippets/qmltc/MyButton.qml b/src/qml/doc/snippets/qmltc/MyButton.qml
new file mode 100644
index 0000000000..ed7e177412
--- /dev/null
+++ b/src/qml/doc/snippets/qmltc/MyButton.qml
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** Copyright (C) 2022 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick
+
+Rectangle {
+ id: button
+ property alias text: textItem.text
+ signal clicked()
+
+ readonly property color constantColor: "#63ACBE"
+ color: mouseArea.pressed ? Qt.lighter(constantColor) : constantColor
+ width: textItem.implicitWidth + 5
+ height: textItem.implicitHeight + 5
+ radius: 10
+
+ Text {
+ id: textItem
+ font.pixelSize: 22
+ color: "black"
+ anchors.centerIn: button
+ }
+
+ MouseArea {
+ id: mouseArea
+ anchors.fill: button
+ anchors.margins: -5
+ onClicked: function(event) { button.clicked(); }
+ }
+}