summaryrefslogtreecommitdiffstats
path: root/basicsuite/Text Input
diff options
context:
space:
mode:
Diffstat (limited to 'basicsuite/Text Input')
-rw-r--r--basicsuite/Text Input/ScrollBar.qml66
-rw-r--r--basicsuite/Text Input/TextArea.qml88
-rw-r--r--basicsuite/Text Input/TextBase.qml95
-rw-r--r--basicsuite/Text Input/TextField.qml93
-rw-r--r--basicsuite/Text Input/background.pngbin34931 -> 0 bytes
-rw-r--r--basicsuite/Text Input/description.txt6
-rw-r--r--basicsuite/Text Input/main.qml121
-rw-r--r--basicsuite/Text Input/preview_l.jpgbin16465 -> 0 bytes
8 files changed, 0 insertions, 469 deletions
diff --git a/basicsuite/Text Input/ScrollBar.qml b/basicsuite/Text Input/ScrollBar.qml
deleted file mode 100644
index e6a8143..0000000
--- a/basicsuite/Text Input/ScrollBar.qml
+++ /dev/null
@@ -1,66 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 Nokia Corporation and its Subsidiary(-ies) 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 2.0
-
-Item {
- property var scrollArea: parent
-
- width: 6
- opacity: scrollArea && scrollArea.movingVertically ? 1.0 : 0.0
- visible: scrollArea && scrollArea.contentHeight >= scrollArea.height
- anchors { right: parent.right; top: parent.top; bottom: parent.bottom; margins: 2 }
-
- Behavior on opacity { NumberAnimation { properties: "opacity"; duration: 600 } }
-
- function size() {
- var nh = scrollArea.visibleArea.heightRatio * height
- var ny = scrollArea.visibleArea.yPosition * height
- return ny > 3 ? Math.min(nh, Math.ceil(height - 3 - ny)) : nh + ny
- }
- Rectangle {
- x: 1
- y: scrollArea ? Math.max(2, scrollArea.visibleArea.yPosition * parent.height) : 0
- height: scrollArea ? size() : 0
- width: parent.width - 2
- color: Qt.rgba(1.0, 1.0, 1.0, 0.5)
- radius: 1
- }
-}
diff --git a/basicsuite/Text Input/TextArea.qml b/basicsuite/Text Input/TextArea.qml
deleted file mode 100644
index cf337f6..0000000
--- a/basicsuite/Text Input/TextArea.qml
+++ /dev/null
@@ -1,88 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 Nokia Corporation and its Subsidiary(-ies) 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 2.0
-
-TextBase {
- id: textArea
-
- property alias color: textEdit.color
- property alias text: textEdit.text
- property alias textWidth: textEdit.width
- property alias readOnly: textEdit.readOnly
- property alias inputMethodHints: textEdit.inputMethodHints
-
- editor: textEdit
-
- Repeater {
- model: Math.floor((parent.height - 30) / editor.cursorRectangle.height)
- Rectangle {
- x: 8
- y: (index+1)*editor.cursorRectangle.height+6
- height: 1; width: textArea.width-24
- color: Qt.rgba(1.0, 1.0, 1.0, 0.5)
- }
- }
- TextEdit {
- id: textEdit
-
- property alias enterKeyText: textArea.enterKeyText
- property alias enterKeyEnabled: textArea.enterKeyEnabled
-
- y: 6
- focus: true
- color: "#EEEEEE"
- wrapMode: TextEdit.Wrap
- cursorVisible: activeFocus
- height: Math.max(implicitHeight, 60)
- font.pixelSize: textArea.fontPixelSize
- selectionColor: Qt.rgba(1.0, 1.0, 1.0, 0.5)
- selectedTextColor: Qt.rgba(0.0, 0.0, 0.0, 0.8)
- anchors { left: parent.left; right: parent.right; margins: 12 }
- cursorDelegate: Rectangle {
- width: 2
- opacity: 0.7
- color: "#EEEEEE"
- visible: textEdit.activeFocus
- }
-
- onActiveFocusChanged: if (!activeFocus) deselect()
- }
-}
diff --git a/basicsuite/Text Input/TextBase.qml b/basicsuite/Text Input/TextBase.qml
deleted file mode 100644
index a26c6c6..0000000
--- a/basicsuite/Text Input/TextBase.qml
+++ /dev/null
@@ -1,95 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 Nokia Corporation and its Subsidiary(-ies) 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 2.0
-
-FocusScope {
- id: textBase
-
- property var editor
- property bool previewTextActive: !editor.activeFocus && text.length === 0
- property int fontPixelSize: 32
- property string previewText
- property string enterKeyText
- property bool enterKeyEnabled: true
- property alias mouseParent: mouseArea.parent
-
- implicitHeight: editor.height + 12
-
- signal enterKeyClicked
-
- Keys.onReleased: {
- if (event.key === Qt.Key_Return)
- enterKeyClicked()
- }
-
- Rectangle {
- // background
- radius: 5.0
- anchors.fill: parent
- color: Qt.rgba(1.0, 1.0, 1.0, 0.2)
- border { width: editor.activeFocus ? 2 : 0; color: "#CCCCCC" }
- }
- Text {
- id: previewText
-
- y: 8
- color: "#CCCCCC"
- visible: previewTextActive
- text: textBase.previewText
- font.pixelSize: 28
- anchors { left: parent.left; right: parent.right; margins: 12 }
-
- }
- MouseArea {
- id: mouseArea
-
- z: 1
- parent: textBase
- anchors.fill: parent
- onClicked: {
- var positionInEditor = mapToItem(editor, mouseX, mouseY)
- var cursorPosition = editor.positionAt(positionInEditor.x, positionInEditor.y)
- editor.cursorPosition = cursorPosition
- editor.forceActiveFocus()
- Qt.inputMethod.show()
- }
- }
-}
diff --git a/basicsuite/Text Input/TextField.qml b/basicsuite/Text Input/TextField.qml
deleted file mode 100644
index aa6768e..0000000
--- a/basicsuite/Text Input/TextField.qml
+++ /dev/null
@@ -1,93 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 Nokia Corporation and its Subsidiary(-ies) 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 2.0
-
-TextBase {
- id: textField
-
- property alias color: textInput.color
- property alias text: textInput.text
- property alias textWidth: textInput.width
- property alias readOnly: textInput.readOnly
- property alias inputMethodHints: textInput.inputMethodHints
- property alias validator: textInput.validator
- property alias echoMode: textInput.echoMode
-
- editor: textInput
- mouseParent: flickable
-
- Flickable {
- id: flickable
-
- x: 12
- clip: true
- width: parent.width-24
- height: parent.height
- flickableDirection: Flickable.HorizontalFlick
- interactive: contentWidth - 4 > width
-
- contentWidth: textInput.width+2
- contentHeight: textInput.height
- TextInput {
- id: textInput
-
- property alias enterKeyText: textField.enterKeyText
- property alias enterKeyEnabled: textField.enterKeyEnabled
-
- y: 6
- focus: true
- color: "#EEEEEE"
- cursorVisible: activeFocus
- passwordCharacter: "\u2022"
- font.pixelSize: textField.fontPixelSize
- selectionColor: Qt.rgba(1.0, 1.0, 1.0, 0.5)
- selectedTextColor: Qt.rgba(0.0, 0.0, 0.0, 0.8)
- width: Math.max(flickable.width, implicitWidth)-2
- cursorDelegate: Rectangle {
- width: 2
- opacity: 0.7
- color: "#EEEEEE"
- visible: textInput.activeFocus
- }
- onActiveFocusChanged: if (!activeFocus) deselect()
- }
- }
-}
diff --git a/basicsuite/Text Input/background.png b/basicsuite/Text Input/background.png
deleted file mode 100644
index d85f6ee..0000000
--- a/basicsuite/Text Input/background.png
+++ /dev/null
Binary files differ
diff --git a/basicsuite/Text Input/description.txt b/basicsuite/Text Input/description.txt
deleted file mode 100644
index 7c3b780..0000000
--- a/basicsuite/Text Input/description.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-This examples illustrates how Qt can handle input on touch devices.
-
-The launcher loads a custom platform input context plugin and contains a virtual keyboard. When a text control in Qt Quick gets focus, the input context will trigger the virtual keyboard to show on screen and clicks in the virtual keyboard are delegated to the text control.
-
-Our demo virtual keyboard has support for english, finnish and arabic. The input context plugin API is plugin based and can be replaced with whatever the user desiers. Qt has a ready made plugin for Maliit, an open-source, cross-platform input method framework for mobile and embedded.
-
diff --git a/basicsuite/Text Input/main.qml b/basicsuite/Text Input/main.qml
deleted file mode 100644
index 53593bf..0000000
--- a/basicsuite/Text Input/main.qml
+++ /dev/null
@@ -1,121 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 Nokia Corporation and its Subsidiary(-ies) 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 2.0
-
-Image {
- source: "background.png"
-
- Flickable {
- id: flickable
-
- property real scrollMarginVertical: 20
-
- width: parent.width
- contentWidth: content.width
- contentHeight: content.height
- interactive: contentHeight > height
- height: Qt.inputMethod.keyboardRectangle.y
- flickableDirection: Flickable.VerticalFlick
- children: ScrollBar {}
-
- MouseArea {
- id: content
-
- width: flickable.width
- height: textEditors.height + 24
-
- onClicked: {
- if (Qt.inputMethod.inputItem)
- Qt.inputMethod.inputItem.focus = false
- }
-
- Column {
- id: textEditors
- spacing: 15
- x: 12; y: 12
- width: parent.width - 26
-
- Text {
- color: "#EEEEEE"
- text: "Tap fields to enter text"
- anchors.horizontalCenter: parent.horizontalCenter
- font.pixelSize: 22
- }
- TextField {
- width: parent.width
- previewText: "One line field"
- enterKeyText: "Next"
- enterKeyEnabled: text.length > 0
- onEnterKeyClicked: passwordField.focus = true
- }
- TextField {
- id: passwordField
-
- width: parent.width
- echoMode: TextInput.PasswordEchoOnEdit
- previewText: "Password field"
- inputMethodHints: Qt.ImhNoAutoUppercase | Qt.ImhPreferLowercase | Qt.ImhSensitiveData | Qt.ImhNoPredictiveText
- enterKeyText: "Next"
- enterKeyEnabled: text.length > 0
- onEnterKeyClicked: numberField.focus = true
- }
- TextField {
- id: numberField
-
- validator: RegExpValidator { regExp: /^[0-9\+\-\#\*\ ]{6,}$/ }
- width: parent.width
- previewText: "Phone number field"
- inputMethodHints: Qt.ImhDialableCharactersOnly
- enterKeyText: "Next"
- enterKeyEnabled: text.length > 0
- onEnterKeyClicked: textArea.focus = true
- }
- TextArea {
- id: textArea
-
- width: parent.width
- previewText: "Multiple lines field"
- height: Math.max(206, implicitHeight)
- }
- }
- }
- }
-}
diff --git a/basicsuite/Text Input/preview_l.jpg b/basicsuite/Text Input/preview_l.jpg
deleted file mode 100644
index f415a86..0000000
--- a/basicsuite/Text Input/preview_l.jpg
+++ /dev/null
Binary files differ