Harmattan virtual keyboard covering textfields in a listView



  • As the title, is there any workaround for this?
    Here there is a simple example. I have solved the problem in Symbian by using the inputContext object, but it seems to be not available on harmattan...

    main.qml
    @import QtQuick 1.1
    import com.nokia.meego 1.1

    PageStackWindow {
    id: appWindow

    initialPage: mainPage
    
    showStatusBar: true
    
    
    MainPage {
        id: mainPage
    }
    
    ToolBarLayout {
        id: commonTools
        visible: true
        ToolIcon {
            platformIconId: "toolbar-close"
            anchors.left: (parent === undefined) ? undefined : parent.left
            onClicked: Qt.quit()
        }
        ToolIcon {
            platformIconId: "toolbar-view-menu"
            anchors.right: (parent === undefined) ? undefined : parent.right
            onClicked: (myMenu.status === DialogStatus.Closed) ? myMenu.open() : myMenu.close()
        }
    }
    
    Menu {
        id: myMenu
        visualParent: pageStack
        MenuLayout {
            MenuItem { text: qsTr("Sample menu item") }
        }
    }
    

    }@

    MainPage.qml
    @
    import QtQuick 1.1
    import com.nokia.meego 1.1

    Page {
    tools: commonTools

    ListModel {
        id: contactModel
        ListElement {
            name: "Bill Smith"
            number: "555 3264"
        }
        ListElement {
            name: "John Brown"
            number: "555 8426"
        }
        ListElement {
            name: "Sam Wise"
            number: "555 0473"
        }
        ListElement {
            name: "Bill Smith"
            number: "555 3264"
        }
        ListElement {
            name: "John Brown"
            number: "555 8426"
        }
        ListElement {
            name: "Sam Wise"
            number: "555 0473"
        }
        ListElement {
            name: "Bill Smith"
            number: "555 3264"
        }
        ListElement {
            name: "John Brown"
            number: "555 8426"
        }
        ListElement {
            name: "Sam Wise"
            number: "555 0473"
        }
     }
    
    Component {
        id: contactDelegate
        Item {
            anchors.left: parent.left
            anchors.right: parent.right
            height: childrenRect.height
            Column {
                Text { text: '<b>Name:</b> ' + name }
                Text { text: '<b>Number:</b> ' + number }
                TextField {text: "Some Text"}
            }
        }
    }
    
     ListView {
         anchors.fill: parent
         model: contactModel
         delegate: contactDelegate
         highlight: Rectangle { color: "lightsteelblue"; radius: 5 }
         focus: true
     }
    

    }
    @



  • Noone with an idea? Is this a so strange behavior? :S



  • Ok. After some invetigations, I think I found a bug in the TextAreaHelper.js script used for repositioning the view of a flickable the input fields are in. In particular, there is this part of code into the repositionFlickable function:

    @
    case Screen.Portrait:
    if(flickableY + flickable.height - mf.width - margin < mf.x) {
    var dY = mf.x - flickableY - flickable.height
    dY += flickable.height / 2
    newContentY += dY
    } else if(flickableY + margin > mf.x){
    var dY = flickableY - mf.x
    dY += flickable.height / 2
    newContentY -= dY
    }
    break
    @

    I'm not sure on what microFocus (ms) is, but why, if the screen is in potrait, should i use the x and with values of it? By changing it with y and height, all seems to work good... :)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.