From cf32b66adbfb489cd6e5d5c0bf3f741b59ba204c Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 15 Sep 2022 13:21:53 +0200 Subject: Move examples around Change the directory structure to closer match that of Qt. Task-number: PYSIDE-841 Change-Id: I87aca346b6654aafe94dd1fb83c184c182ceb2e6 Reviewed-by: Qt CI Bot Reviewed-by: Cristian Maureira-Fredes --- examples/quick/shared/TextField.qml | 43 +++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 examples/quick/shared/TextField.qml (limited to 'examples/quick/shared/TextField.qml') diff --git a/examples/quick/shared/TextField.qml b/examples/quick/shared/TextField.qml new file mode 100644 index 000000000..01addb2e9 --- /dev/null +++ b/examples/quick/shared/TextField.qml @@ -0,0 +1,43 @@ +// Copyright (C) 2017 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +import QtQuick 2.1 + +Item { + id: root + + property alias textInput: textInput + property alias text: textInput.text + signal accepted + signal downPressed + implicitWidth: textInput.implicitWidth + rect.radius * 2 + implicitHeight: textInput.implicitHeight + + function copyAll() { + textInput.selectAll() + textInput.copy() + } + + SystemPalette { id: palette } + height: textInput.implicitHeight + 8 + clip: true + + Rectangle { + id: rect + anchors.fill: parent + radius: height / 4 + color: palette.button + border.color: Qt.darker(palette.button, 1.5) + } + + TextInput { + id: textInput + color: palette.text + anchors.fill: parent + anchors.leftMargin: rect.radius + anchors.rightMargin: rect.radius + verticalAlignment: Text.AlignVCenter + onAccepted: root.accepted() + Keys.onDownPressed: root.downPressed() + } +} -- cgit v1.2.3