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

Finish parsing defined expressions from QML

    XMLWordPrintable

Details

    • User Story
    • Resolution: Done
    • Not Evaluated
    • QDS 4.3
    • None
    • Logic Building
    • None
    • QDS Berlin - 2023 Week 29/30, QDS Berlin - 2023 Week 31/32, QDS Berlin - 2023 Week 33/34
    • f018ea6d8 (qds/dev)

    Description

      Tests as defined in the specifications should pass

      Add more tests for identified corner cases.

      Read expression and data into defined data structure for proecessing.

      struct Handler {
        bool hasIf
        bool hasElse
        MatchedStatement ok
        MatchedStatement ko //else statement
        MatchedCondition condition
      }
      
      struct MatchedStatement {
      enum Type {
         Empty,
         FunctionCall, //calling a function
         Assignment,  // assign variable to variable
         ProperttySet, //assigning literal
         StateSet      //setting state
         ConsoleLog //console.log("")
      }
      
         QVariant matchedLiteral //If there is a literal we can store it here. Here we do support numbers, strings/colors and bool literals (true/false)
         BindingProperty lhs //There always should be a binding property on the left hand side. The first identifier is considered node
         MatchedFunction function //CallExpression consisting of identifiers with ".". First identifier is considered node.
         Variable rhs //Similar to function but no function call. Just regular FieldExpression/binding
      } //This should be sufficient to represent any supported statement
      

      The expression can be represented as a list of 'tokens'

      struct MatchedCondition {
      list<ConditionToken> tokens
      }
      
      struct ConditionToken {
      enum Type {
        Not,
        And,
        Or,
        LargerThan,
        LargerEuqalsThan,
        SmallerThan,
        SmallerEqualsThan,
        Equals,
        LiteralString,
        LiteralNumber,
        Variable
      }
      
      union { //If one these we require extra data
        Variable variable
        LiteralString string
        LiteralNumber number
      }
      
      struct MatchedFunction { //First item before "." is considered node
        string nodeId
        string functionName
      }
      
      struct Variable { //Only one level for now (.)
        string nodeId
        string propertyName
      }
      

      Attachments

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

        Activity

          People

            ali.kianian Ali Kianian
            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