Ubuntu: Creating simple login form using Qt creator without any QtQuickControls



Question:

I am new to Qt Creator . I want to build a simple form( example a Login form) with a submit button in qml but without using any import QtQuick.Controls. How to create buttons using Rectangle component? ( that is using Qt Quick-Basic )

Can any one help with these?


Solution:1

I found the answer for the above question:

Following is the code:

import QtQuick 1.0    Rectangle{      id:screen      color: "lightgray"      width: 3000; height:2700        Column {          id: column1          width: 201          height: 400            Row {              id: row1              width: 40              height:50                TextInput {                  id: userName                  x: 40                  y: 18                  width: 80                  height: 20                  text: qsTr("UserName")                  font.pixelSize: 12              }                Rectangle {                  id: rectangle1                  x: 115                  y: 18                  width: 80                  height: 20                  color: "#ffffff"              }              }            Row {              id: row2              width: 40              height: 50                TextInput {                  id: password                  x: 40                  y: 18                  width: 80                  height: 20                  text: qsTr("Password")                  font.pixelSize: 12              }                Rectangle {                  id: rectangle2                  x: 115                  y: 18                  width: 80                  height: 20                  color: "#ffffff"              }          }            Row {              id: row3              x: 8              y: 113              width: 40              height: 50                Rectangle {                  id: rectangle3                  x: 8                  y: 8                  width: 80                  height: 20                  color: "#ffffff"                Text {                  id: login                  text: "Login"                  x:4                  y:4                  width:30                  height:10                  font.pixelSize: 12              }          }      }  }  

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »