Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Page navigation and Text input focus
QtWS25 Last Chance

Page navigation and Text input focus

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 289 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.
  • A Offline
    A Offline
    Anas_Deshmukh
    wrote on last edited by
    #1

    hello everyone,
    my aim is to get user keyboard input using "textInput" in main.qml then navigate to "1.qml" using loader, get some other text input and get back to main.qml.

    but after running my code everything is overlapped andnot navigating properly

    // main.qml
    
    import QtQuick 1.1
    
    Rectangle {
        width: 360
        height: 360
    
        Loader {
            id: loader1
            focus: true
            source: ""
        }
    
       Rectangle {
    
                id : uid
                width: 250
                height: 25
                anchors.horizontalCenter: parent.horizontalCenter
                y: 110
    
                Text {
                    id : pwd
                    text: "userId"
                    y: 5
                    font.pixelSize: 15
                }
    
                Rectangle {
    
                    id : pwdInput
                    width: 150
                    height: 25
                    border.color: "black"
                    anchors.right: parent.right
    
    
                    TextInput {
                        id : two
                        cursorVisible: true
                        anchors.fill: parent
                        KeyNavigation.tab: one
                        font.pointSize: 15
                        focus: true
    
                    }
                }
            }
    
            Rectangle {
                id : logIn
                height: 30
                width: 100
                anchors.horizontalCenter: parent.horizontalCenter
                y: 175
                color:  "#08407D"
    
                MouseArea{
                    anchors.fill: parent
                    onClicked: loader1.source="1.qml"
                }
    
                Text{
                    id: buttonLabel
                    anchors.centerIn: parent
                    text: "Log In"
                    color: "white"
                    KeyNavigation.tab: one
                }
            }
        }
    
    
    
    
    
    //// 1.qml
    
    
    import QtQuick 1.1
    
    Rectangle {
        id : root
        width: 400
        height: 400
        color: "steelblue"
    
        Item {
                id: item
                width: 200; height: 200
                Loader {
                    id:loader
                    source: ""
                    focus: true
                }
            }
    
            Rectangle {
                id : userName
                width: 250
                height: 25
                anchors.horizontalCenter: parent.horizontalCenter
                y: 75
    //            focus: true
    
                Text {
                    id : usrName
                    text: "Full Name"
                    y: 5
                    font.pixelSize: 15
                }
    
                Rectangle {
                    id : userNameInput
                    width: 150
                    height: 25
                    border.color: "black"
                    anchors.right: parent.right
    
                    TextInput {
                            id: one
                            focus: true
                            KeyNavigation.tab: two
                            font.pointSize: 15
                        }
                }
            }
    
            Rectangle {
            id : back
            height: 30
            width: 100
            anchors.horizontalCenter: parent.horizontalCenter
            y: 250
            color:  "#08407D"
    
            MouseArea{
                anchors.fill: parent
                onClicked: {loader.source="main.qml"}
            }
    
            Text{
                id: buttonLabel
                anchors.centerIn: parent
                text: "back"
                color: "white"
            }
        }
    }
    
    
    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