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. Login simples
Qt 6.11 is out! See what's new in the release blog

Login simples

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
6 Posts 2 Posters 922 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.
  • 1 Offline
    1 Offline
    123456789
    wrote on last edited by raven-worx
    #1

    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
                                } 
    					}
            	}
     }
    
    raven-worxR 1 Reply Last reply
    0
    • 1 123456789

      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
                                  } 
      					}
              	}
       }
      
      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by raven-worx
      #2

      @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

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0
      • 1 Offline
        1 Offline
        123456789
        wrote on last edited by
        #3

        not understand
        @corvo-worx

        raven-worxR 1 Reply Last reply
        0
        • 1 123456789

          not understand
          @corvo-worx

          raven-worxR Offline
          raven-worxR Offline
          raven-worx
          Moderators
          wrote on last edited by
          #4

          @123456789
          instead of TextField.text write idOfYourTextField.text

          --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
          If you have a question please use the forum so others can benefit from the solution in the future

          1 Reply Last reply
          0
          • 1 Offline
            1 Offline
            123456789
            wrote on last edited by
            #5

            not result
            http://prntscr.com/jzxe3r

            @corvo-worx

            1 Reply Last reply
            0
            • 1 Offline
              1 Offline
              123456789
              wrote on last edited by
              #6

              @raven-worx

              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