Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

If you're building a QtQuick 2.0 app, what is the procedure for specifying that the soft-keyboard should be selectable/expandable at the bottom of the screen?

share|improve this question
Still need to test it, but it looks like as of Qt 5 you can just "" – RobotHumans Apr 20 '13 at 12:39
up vote 1 down vote accepted

Here is some un-styled sample code that just gets the keyboard on-screen. The docs indicate that you need to have a text-entry selected for this to work, so if you have a custom widget, you may have to sub-class text-entry or set up a particular slot/signal.

import QtQuick 2.0
import Ubuntu.Components 0.1

MainView {
    // objectName for functional testing purposes (autopilot-qt5)
    objectName: "mainView"
    id: "mainview"
    applicationName: "QMLTerminal"

    property bool keyShowing: false
    TextEdit {
        id: textConsumer
        visible: false
        width: parent.width
        height: parent.height * .10

    MouseArea {
        anchors.fill: parent
        onClicked: if (mainview.keyShowing){
                       mainview.keyShowing = false
                       textConsumer.visible = false
                       console.log("Tried to hide")
                   } else {
                       textConsumer.visible = true
                       textConsumer.focus = true
                       mainview.keyShowing = true
                       console.log("Tried to show")
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.