Login simples



  • i want login not ligation with database
    where is my erro?

    import QtQuick 2.1
    import QtQuick . Layouts 1.0
    import QtQuick.Controls 1.0
    import QtQuick.Layouts 1.0
    
    //QString nvl= ui->TextField->text();
    ColumnLayout {
        anchors.fill: parent
        anchors.margins: 300
        spacing: 3
        property color mainAppcolor: "#6fda9c"
    
        Label{
            text: "LOGIN"
            font.pointSize:70
            leftPadding: 90
            width: layout.implicitWidth
        }
    
        ComboBox {
            Layout.fillWidth: true
            model :[ "Nível 1                                      " ,
                     "Nível 2                                      " ,
                     "Nível 3                                      " ,
                     "Nível 4                                      "  ]
        }
    
        TextField {
                id: password_field
                placeholderText: qsTr("Write your password")
                Layout.fillWidth: true
                echoMode: TextInput.Password
            }
    
        Button {
            id: proccessButton
            Layout.fillWidth: true
            text:"Login"
           // QString nvl= ui->TextField->text();
    
            onClicked: {
                console.log("ProcessButton: pasword = ", TextField.text)
                console.log("ProcessButton: nível = ", ComboBox.text)
                if(TextField.text == "m" && /*idPasswordTextField.text*/ ComboBox.text == "Nível 1 "){
                                     idthisLogin.loginSuccess = true;
                                     idLoginColumn.visible = false
    
                                     idinfoTimer.start ()
                                     idInfoPopUp.info = qsTr("Login Success!");
                                     idInfoPopUp.visible = true
                                     objQtCPPSearchV4.funcLoadBasemap();
                                 }
                                 else
                                 {
                                     idthisLogin.loginSuccess = false
                                     idInfoPopUp.info = qsTr("Login Failed!");
                                     idLoginColumn.visible = true
                                } 
    					}
            	}
     }
    

  • Moderators

    @123456789 said in Login simples:

    if(TextField.text == "m" && /idPasswordTextField.text/ ComboBox.text == "Nível 1 "){

    you should use the ids of the corresponding items. (like the commented part of this line)

    Actually your code should already raise some QML runtime errros



  • not understand
    @corvo-worx


  • Moderators

    @123456789
    instead of TextField.text write idOfYourTextField.text



  • not result
    http://prntscr.com/jzxe3r

    @corvo-worx




Log in to reply
 

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