Uploaded image for project: 'Qt Design Studio'
  1. Qt Design Studio
  2. QDS-9753

Research: Start with concept for visual tooling

    XMLWordPrintable

Details

    • User Story
    • Resolution: Done
    • Not Evaluated
    • None
    • None
    • All Other Issues
    • None
    • 4
    • QDS Berlin - 2023 Week 17/18, QDS Berlin - 2023 Week 19/20

    Description

      QML example

      
      import QtQuick 6.5
      import QtQuick.Controls 6.5
      import UntitledProject151
      import QtQuick.Studio.LogicHelper
      import QtQuick.Studio.Components
      
      Rectangle {
          id: rectangle
          width: Constants.width
          height: Constants.height
      
          color: Constants.backgroundColor
                 @Annotate {
                     property int x: 5
      
                 }
      
          ArcItem {
              id: arc
              x: 956
              y: 404
              end: rangeMapper.output
              begin: -90
              fillColor: "#00000000"
      
              RangeMapper {
                  id: rangeMapper
                  outputMinimum: 0
                  input: spinBox.value
                  inputMaximum: 100
                  outputMaximum: 180
              }
      
              MinMaxMapper {
                  id: minMaxMapper
                  maximum: 60
                  minimum: 0
                  input: spinBox.value
              }
          }
      
          SpinBox {
              id: spinBox
              x: 588
              y: 551
              value: 50
              stepSize: 1
              to: 100
          }
      
          StateGroup {
              id: arcColorSateGroup
              states: [
                  State {
                      name: "inRange"
                      when: !minMaxMapper.outOfRange
      
                      PropertyChanges {
                          target: arc
                          strokeColor: "#1eb641"
                      }
                  },
                  State {
                      name: "outOfRange"
                      when: minMaxMapper.outOfRange
      
                      PropertyChanges {
                          target: arc
                          strokeColor: "#c21414"
                      }
      
                      PropertyChanges {
                          target: button
                          text: qsTr("Reset")
                      }
                  }
              ]
          }
      
          Button {
              id: button
              x: 588
              y: 410
              text: qsTr("Reset")
      
              Connections {
                  target: button
                  onClicked: spinBox.value = 50 //Assigment should be handled my node       -> assigment.execute()/trigger()
              }
      
      
              /*
                Assignment {
                id: assignment
      
                  target: spinBox
                  property: "value"
                  value: 50
      
      
                }
      
                */
          }
      }
      
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            thohartm Thomas Hartmann
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes