Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Unsolved Wizard

    General and Desktop
    1
    1
    138
    Loading More Posts
    • 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
      123456789 last edited by VRonin

      I intend to create an assistant, does anyone know of any examples? I can not override buttons

      import QtQuick 2.0
      import QtQuick.Controls 2.0
      import QtQuick.Layouts 1.0
      Page{
          header:HeaderBar{}
      GridLayout {
         id : grid
         anchors.fill: parent
         rows    : 12
          columns : 12
          property double colMulti : grid.width / grid.columns
         property double rowMulti : grid.height / grid.rows
         function prefWidth(item){
            return colMulti * item.Layout.columnSpan
          }
          function prefHeight(item){
              return rowMulti * item.Layout.rowSpan
          }
      
          Rectangle {
              color : 'white'
              Layout.rowSpan   : 10
              Layout.columnSpan: 3
             Layout.preferredWidth  : grid.prefWidth(this)
              Layout.preferredHeight : grid.prefHeight(this)
      
              Label {
                  y:20
                  font.pixelSize: 22
                  width: parent.width
                  elide: Label.ElideRight
                  horizontalAlignment: Qt.AlignHCenter
                  text: qsTr("Steps")
              }
      
              Label{
                  y:40
                  width: parent.width
                  elide: Label.ElideRight
                  text:"______________________"
                  horizontalAlignment: Qt.AlignHCenter
              }
      
      
              Label {
                  y:90
                 id:step1
                  font.pixelSize: 15
                width: parent.width
                elide: Label.ElideRight
                horizontalAlignment: Qt.AlignHCenter
                  text: qsTr("Step")
              }
      
      
              Label {
                 y:120
                id:step2
                font.pixelSize: 15
                width: parent.width
                 elide: Label.ElideRight
                horizontalAlignment: Qt.AlignHCenter
                text: qsTr("Step")
            }
             Label {
                 y:150
      
                 font.pixelSize: 15
                  width: parent.width
                 elide: Label.ElideRight
                  horizontalAlignment: Qt.AlignHCenter
                  text: qsTr("Step")
              }
              Label {
                  y:180
      
                 font.pixelSize: 15
                 width: parent.width
                  elide: Label.ElideRight
                  horizontalAlignment: Qt.AlignHCenter
                  text: qsTr("Step")
              }
              Label {
                  y:210
      
                  font.pixelSize: 15
                  width: parent.width
                  elide: Label.ElideRight
                 horizontalAlignment: Qt.AlignHCenter
                  text: qsTr("Step")
              }
        }
        Rectangle {
           id:q
            color : 'gainsboro'
             Layout.rowSpan   : 10
             Layout.columnSpan: 9
            Layout.preferredWidth  : grid.prefWidth(this)
             Layout.preferredHeight : grid.prefHeight(this)
      
      
              Column {
                 id: column
                 y:20
                  spacing: 20
                  anchors.margins: 20
                  anchors.left: parent.left
                  anchors.right: parent.right
      
                  Label {
                   id:center
                    font.pixelSize: 22
                      width: parent.width
                     elide: Label.ElideRight
                      horizontalAlignment: Qt.AlignHCenter
                     text: qsTr("Initialization")
                 }
                 Label {
                     id:c1
                     font.pixelSize: 15
                     width: parent.width
                     elide: Label.ElideRight
                   //  horizontalAlignment: Qt.AlignHCenter
                   text: qsTr("Number machine")
                  }
      
             TextInput{
                      width: 500
                     text:"Required field"
                  }
      
                Label {
                      id:c2
                     font.pixelSize: 15
                      width: parent.width
                      elide: Label.ElideRight
                      text: qsTr("it is obrigation to insert the machine number")
                  }
      
                 Row { // The "Row" type lays out its child items in a horizontal line
                     spacing: 60 // Places 20px of space between items
                     Rectangle {
                          width: 80;
                         height: 80;
                         //https://www.rapidtables.com/web/color/gray-color.html
                          color: 'gainsboro';
                         y:200
      
                        Button{
                              text:"< Back"
                         }
                     }
                      Rectangle {
                          width: 80;
                         height: 80;
                          color: 'gainsboro';
                          y:200
      
                          Button{
                              id:btn1
                             text:"Next"
                             onClicked:{
                                         //step 1
                                          center.text= "Group "
                                          c1.text="Id Term Group"
                                         c2.text="it is obrigation to insert the ID Term Group"
                                         btn1.visible="false"
      
      
                             }
      
                             Button {
                                x: 326
                                 y: 2
                                 text: "Cancel"
                                onClicked: {
                                     Qt.quit()
                                }
                             }
                          }
                     }
                  }
        }
      
             ScrollIndicator.vertical: ScrollIndicator { }
         }
      
          Rectangle {
              id : greenRect
              color : '#9E9E9E'
            Layout.rowSpan : 2
              Layout.columnSpan : 12
              Layout.preferredWidth  : grid.prefWidth(this)
              Layout.preferredHeight : grid.prefHeight(this)
          }
      }
      
      }
      
      1 Reply Last reply Reply Quote 0
      • First post
        Last post