<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[QML TextField and overlay keyboard]]></title><description><![CDATA[<p dir="auto">Hi devs, I`m currently develope a mobile cross-platform app (Qt 5.9.1) which has a contact page.<br />
This page has many textfields (e.g name, lastname, street, city .....) and on the bottom a send-button. When I input some text in the fields, the overlay keyboard becomes visible and covers my send-button. It is possible to move the page top, when the overlay keyboard becomes visible (e.g WhatsApp has this feature).</p>
<p dir="auto">Example code:</p>
<pre><code>import QtQuick 2.7
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
import QtGraphicalEffects 1.0
import QtQuick.Controls.Material 2.2

ApplicationWindow {
    visible: true
    width: 640
    height: 480
    title: qsTr("Example")

    Flickable {
        id: flickable
        contentHeight: root.implicitHeight
        anchors.fill: parent
        boundsBehavior: Flickable.OvershootBounds
        clip: true

        Pane {
            id: root
            anchors.fill: parent
            padding: 0
            ColumnLayout {
                id: theContent
                anchors.right: parent.right
                anchors.left: parent.left

                RowLayout {
                    Label {
                        topPadding: 6
                        leftPadding: 6
                        font.pointSize: 20
                        text: qsTr("Contact")
                        Layout.fillWidth: true
                    }
                }

                RowLayout {
                    Layout.leftMargin: 20
                    Layout.rightMargin: 20
                    Label {
                        wrapMode: Text.WordWrap
                        text: qsTr("First name: ")
                        Layout.fillWidth: true
                        Layout.preferredWidth: 2
                    }
                    TextField {
                        id: textFieldFirstName
                        Layout.fillWidth: true
                        Layout.preferredWidth: 3
                        onEditingFinished: {
                            focus = false
                        }
                    } // textField

                } // row

                RowLayout {
                    Layout.leftMargin: 20
                    Layout.rightMargin: 20
                    Label {
                        wrapMode: Text.WordWrap
                        text: qsTr("Last name: ")
                        Layout.fillWidth: true
                        Layout.preferredWidth: 2
                    }
                    TextField {
                        id: textFieldLastName
                        Layout.fillWidth: true
                        Layout.preferredWidth: 3
                        onEditingFinished: {
                            focus = false
                        }
                    } // textField

                } // row

                RowLayout {
                    Layout.leftMargin: 20
                    Layout.rightMargin: 20
                    Label {
                        wrapMode: Text.WordWrap
                        text: qsTr("Company: ")
                        Layout.fillWidth: true
                        Layout.preferredWidth: 2
                    }
                    TextField {
                        id: textFieldCompany
                        Layout.fillWidth: true
                        Layout.preferredWidth: 3
                        onEditingFinished: {
                            focus = false
                        }
                    } // textField

                } // row

                RowLayout {
                    Layout.leftMargin: 20
                    Layout.rightMargin: 20
                    Label {
                        wrapMode: Text.WordWrap
                        text: qsTr("City: ")
                        Layout.fillWidth: true
                        Layout.preferredWidth: 2
                    }
                    TextField {
                        id: textFieldCity
                        Layout.fillWidth: true
                        Layout.preferredWidth: 3
                        onEditingFinished: {
                            focus = false
                        }
                    } // textField

                } // row

                RowLayout {
                    Layout.leftMargin: 20
                    Layout.rightMargin: 20
                    Label {
                        wrapMode: Text.WordWrap
                        text: qsTr("E-mail: ")
                        Layout.fillWidth: true
                        Layout.preferredWidth: 2
                    }

                    TextField {
                        id: textFieldEMail
                        Layout.fillWidth: true
                        Layout.preferredWidth: 3
                        onEditingFinished: {
                            focus = false
                        }
                    } // textField

                } // row

                RowLayout {
                    Layout.leftMargin: 20
                    Layout.rightMargin: 20
                    Layout.topMargin: 6
                    Label {
                        wrapMode: Text.WordWrap
                        text: qsTr("Your message: ")
                        Layout.fillWidth: true
                        Layout.preferredWidth: 3
                    }
                } // row
                Rectangle {
                    Layout.leftMargin: 20
                    Layout.rightMargin: 20
                    Layout.fillWidth: true
                    height: 200
                    color: "white"
                    border.width: 1
                    border.color: "darkgrey"
                    ScrollView {
                        id: view
                        anchors.fill: parent
                        width: parent.width
                        anchors.margins: 6
                        TextArea {
                            id: textAreaMessage
                            implicitWidth: parent.width
                            selectByMouse: true
                            hoverEnabled: false
                            wrapMode: TextEdit.WordWrap
                            onEditingFinished: {
                                focus = false
                            }
                        } // textArea
                    }
                }

                Button {
                    id: buttonSend
                    enabled: textFieldFirstName.text.length != 0 &amp;&amp; textFieldLastName.text.length != 0
                    text: "Send"
                    anchors.right: parent.right
                    anchors.rightMargin: 20
                    onClicked: {
                        console.log("Send-Button clicked")
                    }
                }

            } // col layout
        } // root
        ScrollIndicator.vertical: ScrollIndicator { }
    } // flickable
}

</code></pre>
]]></description><link>https://forum.qt.io/topic/82027/qml-textfield-and-overlay-keyboard</link><generator>RSS for Node</generator><lastBuildDate>Mon, 12 Oct 2026 02:58:25 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/82027.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 04 Aug 2017 06:37:41 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to QML TextField and overlay keyboard on Fri, 04 Aug 2017 12:01:33 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/manu19">@<bdi>Manu19</bdi></a> said in <a href="/post/408507">QML TextField and overlay keyboard</a>:</p>
<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sierdzio">@<bdi>sierdzio</bdi></a> Shame on me. I thought contentY would be readOnly. I should go to bed and sleep. Thank you for your patience and for your example</p>
</blockquote>
<p dir="auto">Hehe, no worries. This property actually sounds almost as if it <strong>should</strong> be read-only. Before I wrote my reply I checked several times if it was writable or not, because I felt intuitively that it could not be :-) So, I understand you 100% here :D</p>
]]></description><link>https://forum.qt.io/post/408509</link><guid isPermaLink="true">https://forum.qt.io/post/408509</guid><dc:creator><![CDATA[sierdzio]]></dc:creator><pubDate>Fri, 04 Aug 2017 12:01:33 GMT</pubDate></item><item><title><![CDATA[Reply to QML TextField and overlay keyboard on Fri, 04 Aug 2017 11:45:19 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sierdzio">@<bdi>sierdzio</bdi></a> Shame on me. I thought contentY would be readOnly. I should go to bed and sleep. Thank you for your patience and for your example</p>
]]></description><link>https://forum.qt.io/post/408507</link><guid isPermaLink="true">https://forum.qt.io/post/408507</guid><dc:creator><![CDATA[Manu19]]></dc:creator><pubDate>Fri, 04 Aug 2017 11:45:19 GMT</pubDate></item><item><title><![CDATA[Reply to QML TextField and overlay keyboard on Fri, 04 Aug 2017 11:38:33 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/manu19">@<bdi>Manu19</bdi></a> said in <a href="/post/408503">QML TextField and overlay keyboard</a>:</p>
<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sierdzio">@<bdi>sierdzio</bdi></a> Whith which function should i test it? Flickable does not have a function to move it programmaticaly besides flick( )</p>
</blockquote>
<p dir="auto"><code>contenxtX</code> is a <strong>property</strong>. Just set it's value to any value you need and it will update the position automatically.</p>
<p dir="auto">For example:</p>
<pre><code>Button {
  onClicked: flickable.contentY += 100
}

Flicakble {
  id: flickable
  // some contents
}
</code></pre>
<p dir="auto">Or:</p>
<pre><code>Flickable {
  id: flickable
  contentY: keyboardRect.height
}

Rectangle {
  id: keyboardRect
  height: keyboardVisible? 500 : 0
}
</code></pre>
]]></description><link>https://forum.qt.io/post/408505</link><guid isPermaLink="true">https://forum.qt.io/post/408505</guid><dc:creator><![CDATA[sierdzio]]></dc:creator><pubDate>Fri, 04 Aug 2017 11:38:33 GMT</pubDate></item><item><title><![CDATA[Reply to QML TextField and overlay keyboard on Fri, 04 Aug 2017 11:28:32 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sierdzio">@<bdi>sierdzio</bdi></a> Whith which function should i test it? Flickable does not have a function to move it programmaticaly besides flick( )</p>
]]></description><link>https://forum.qt.io/post/408503</link><guid isPermaLink="true">https://forum.qt.io/post/408503</guid><dc:creator><![CDATA[Manu19]]></dc:creator><pubDate>Fri, 04 Aug 2017 11:28:32 GMT</pubDate></item><item><title><![CDATA[Reply to QML TextField and overlay keyboard on Fri, 04 Aug 2017 10:35:14 GMT]]></title><description><![CDATA[<p dir="auto">Try setting <a href="http://doc.qt.io/qt-5/qml-qtquick-flickable.html#contentX-prop" target="_blank" rel="noopener noreferrer nofollow ugc">contentX</a> or <a href="http://doc.qt.io/qt-5/qml-qtquick-flickable.html#contentY-prop" target="_blank" rel="noopener noreferrer nofollow ugc">contentY</a> properties.</p>
]]></description><link>https://forum.qt.io/post/408487</link><guid isPermaLink="true">https://forum.qt.io/post/408487</guid><dc:creator><![CDATA[sierdzio]]></dc:creator><pubDate>Fri, 04 Aug 2017 10:35:14 GMT</pubDate></item><item><title><![CDATA[Reply to QML TextField and overlay keyboard on Fri, 04 Aug 2017 11:11:25 GMT]]></title><description><![CDATA[<p dir="auto">Does anyone know how to move the flickable to a specific height. I`ve tested a bit with flickable.flick, but this seems not the proper way</p>
]]></description><link>https://forum.qt.io/post/408483</link><guid isPermaLink="true">https://forum.qt.io/post/408483</guid><dc:creator><![CDATA[Manu19]]></dc:creator><pubDate>Fri, 04 Aug 2017 11:11:25 GMT</pubDate></item><item><title><![CDATA[Reply to QML TextField and overlay keyboard on Fri, 04 Aug 2017 07:24:42 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sierdzio">@<bdi>sierdzio</bdi></a> Thank you, this helps a lot</p>
]]></description><link>https://forum.qt.io/post/408430</link><guid isPermaLink="true">https://forum.qt.io/post/408430</guid><dc:creator><![CDATA[Manu19]]></dc:creator><pubDate>Fri, 04 Aug 2017 07:24:42 GMT</pubDate></item><item><title><![CDATA[Reply to QML TextField and overlay keyboard on Fri, 04 Aug 2017 07:09:23 GMT]]></title><description><![CDATA[<p dir="auto">I don't, unfortunately.</p>
<p dir="auto">Some hackish solution is available <a href="https://stackoverflow.com/questions/23868530/qt-android-virtual-keyboard-hiding-half-of-the-text-box" target="_blank" rel="noopener noreferrer nofollow ugc">here</a> and <a href="https://bugreports.qt.io/browse/QTBUG-37477" target="_blank" rel="noopener noreferrer nofollow ugc">here</a>.</p>
]]></description><link>https://forum.qt.io/post/408427</link><guid isPermaLink="true">https://forum.qt.io/post/408427</guid><dc:creator><![CDATA[sierdzio]]></dc:creator><pubDate>Fri, 04 Aug 2017 07:09:23 GMT</pubDate></item><item><title><![CDATA[Reply to QML TextField and overlay keyboard on Fri, 04 Aug 2017 07:02:28 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sierdzio">@<bdi>sierdzio</bdi></a> Thank you for your fast answer. Have you a little example for me how I can use this?</p>
]]></description><link>https://forum.qt.io/post/408424</link><guid isPermaLink="true">https://forum.qt.io/post/408424</guid><dc:creator><![CDATA[Manu19]]></dc:creator><pubDate>Fri, 04 Aug 2017 07:02:28 GMT</pubDate></item><item><title><![CDATA[Reply to QML TextField and overlay keyboard on Fri, 04 Aug 2017 06:51:15 GMT]]></title><description><![CDATA[<p dir="auto">You can get <a href="http://doc.qt.io/qt-5/qinputmethod.html" target="_blank" rel="noopener noreferrer nofollow ugc">keyboardRectangle()</a> from <a href="http://doc.qt.io/qt-5/qml-qtqml-qt.html" target="_blank" rel="noopener noreferrer nofollow ugc">Qt.inputMethod</a> and use that information to scroll your view.</p>
]]></description><link>https://forum.qt.io/post/408421</link><guid isPermaLink="true">https://forum.qt.io/post/408421</guid><dc:creator><![CDATA[sierdzio]]></dc:creator><pubDate>Fri, 04 Aug 2017 06:51:15 GMT</pubDate></item></channel></rss>