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

QML form

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 718 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.
  • F Offline
    F Offline
    fender
    wrote on last edited by
    #1

    Good afternoon.
    How to correctly create a form on a qml of this kind?
    0_1516079718706_8.PNG

    Now I'm creating this way, but it's not correct as I understand it and will look incorrect at different resolutions

        RowLayout {
            x: 29
            y: 51
            width: 598
            height: 40
            
            Label {
                id: label111
                text: qsTr("Наименование объекта :")
                Layout.fillWidth: true
            }
            
            TextField {
                id: edit_name
                width: 400
                height: 20
                text: qsTr("")
                font.pointSize: 12
                scale: 0.7
                placeholderText: "Введите наименование объекта"
            }
        }```
    1 Reply Last reply
    0
    • ODБOïO Offline
      ODБOïO Offline
      ODБOï
      wrote on last edited by
      #2

      @fender Hi,

      Try like this :

        Column {
                  id:_root
                  height: parent.height * 0.8
                  width: parent.width * 0.8
                  anchors.centerIn: parent
                  spacing: 5
      
                  RowLayout {
                      spacing: 5
                      Layout.preferredHeight: 25
                      Layout.fillHeight: false
                      Layout.fillWidth: true
                      Label {
                          Layout.fillHeight: false
                          Layout.fillWidth: false
                          Layout.preferredHeight: 25
                         Layout.preferredWidth: _root.width*0.3
                          text: "TestTest"
                      }
                      TextField{
                          Layout.fillHeight: false
                          Layout.fillWidth: true
                          Layout.preferredWidth: _root.width*0.7
                          text: "red"
                      }
                  }
                  RowLayout {
                      spacing: 5
                      Layout.preferredHeight: 25
                      Layout.fillHeight: false
                      Layout.fillWidth: true
                      Label {
                          Layout.fillHeight: false
                          Layout.fillWidth: false
                          Layout.preferredHeight: 25
                          Layout.preferredWidth: _root.width*0.3
                          text: "TestTestTestTest"
                      }
                      TextField{
                          Layout.fillHeight: false
                          Layout.fillWidth: true
                          Layout.preferredWidth: _root.width*0.7
                          text: "red"
                      }
                  }
                  RowLayout {
                      spacing: 5
                      Layout.preferredHeight: 25
                      Layout.fillHeight: false
                      Layout.fillWidth: true
                      Text {
                          Layout.fillHeight: false
                          Layout.fillWidth: false
                          Layout.preferredHeight: 25
                          Layout.preferredWidth: _root.width*0.7
                          text: "rTestTestTestTestTestTestTestTested"
                      }
                      TextField{
                          Layout.fillHeight: false
                          Layout.fillWidth: true
                          Layout.preferredWidth: _root.width*0.3
                          text: "red"
                      }
                  }
      
              }
      
      1 Reply Last reply
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved