Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Virtual keyboard not visible
Qt 6.11 is out! See what's new in the release blog

Virtual keyboard not visible

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 404 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    manny_lp
    wrote on last edited by
    #1

    I have a sample application which has scrollable text area and input panel. When user clicks on text area, keyboard should appear and height of text area should be adjusted.
    1. I see that first time when I click on text area, keyboard is not visible! Click again and keyboard comes up.
    2. Also, I see a binding loop error: qrc:/main.qml:6:1: QML QQuickWindowQmlImpl*: Binding loop detected for property "conclusionAreaHeight"*

    Please share your suggestions.

    import QtQuick 2.9
    import QtQuick.Window 2.2
    import QtQuick.Controls 2.2
    import QtQuick.VirtualKeyboard 2.2
    
    Window {
        visible: true
        width: 1280
        height: 480
        title: qsTr("Hello World")
    
        property int conclusionAreaHeight: Qt.inputMethod.visible ? 85 : 480
        property int conclusionLength: 511
    
        Rectangle{
            color: "white"
            border.color: "#eeeeee"
            height: conclusionAreaHeight
            width: 1000
            anchors.margins: 15
            anchors.horizontalCenter: parent.horizontalCenter
            ScrollView {
                id: conclusionViewId
                anchors.fill: parent
                contentWidth: conclusionViewId.width - 35
                clip: true
    
                TextArea {
                    id: conclusionTextAreaId
                    wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
                    focus: false
    
                    property string previousText: text
    
                    /*to limit no. of characters*/
                    /*Text area does not have validator property, hence the work around*/
                    /*Refer https://bugreports.qt.io/browse/QTBUG-12304*/
                    onLengthChanged: {
                        if(length > conclusionLength){
                            var cursor = cursorPosition;
                            text = previousText;
                            if (cursor > text.length) {
                                cursorPosition = text.length;
                            } else {
                                cursorPosition = cursor-1;
                            }
                        }
                        previousText = text
                    }
                }
            }
        }
    
    
        InputPanel{
            id: keyboardId
            width: 800
            visible: active
            anchors.horizontalCenter: parent.horizontalCenter
            anchors.bottom: parent.bottom
        }
    }
    
    
    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved