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. QML focus iteating with QPlatformInputContext

QML focus iteating with QPlatformInputContext

Scheduled Pinned Locked Moved QML and Qt Quick
1 Posts 1 Posters 884 Views 1 Watching
  • 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.
  • J Offline
    J Offline
    jduran
    wrote on last edited by
    #1

    Dear all,

    I'm developing a QML application for a device which only have a touchscreen. To insert data, currently I'm using Maliit as input module to provide a VirtualKeyboard.

    I've wrote a very simple sample:

    @
    import QtQuick 2.0
    import QtQuick.Controls 1.1
    import QtQuick.Layouts 1.1

    FocusScope {
    id: winRoot

    width: 400
    height: 400
    
    ColumnLayout {
        anchors.fill: parent
    
        Button {
            Layout.fillWidth: true
            text: "Quit"
            onClicked: Qt.quit()
        }
    
        Button { text: "button"; }
    
        TextEdit {
            Layout.fillWidth: true
            Layout.fillHeight: true
    
            Rectangle {
                anchors.fill: parent
    
                color: "red"
                opacity: 0.5
            }
        }
    
        TextEdit {
            Layout.fillWidth: true
            Layout.fillHeight: true
    
            Rectangle {
                anchors.fill: parent
    
                color: "blue"
                opacity: 0.5
            }
        }
    }
    

    }
    @

    Executing sample on the development PC, we see that the clicking on any textedit item, it receives the focus and then the maliit VK is shown. However, once the VK shown, if I click on any of the buttons of the application, the VK is not hidden. I could hide the VK if with the PC keybard I press shift + tab several times, till the focus has been assigned to any of the buttons of the application.

    Is it possible set the active focus to a button (or any other item) when its has been clicked? does the focus could only be assigned when the user navigates with keys?

    Joaquim Duran

    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