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. Circular references in Qml : Should they be flagged or not?

Circular references in Qml : Should they be flagged or not?

Scheduled Pinned Locked Moved QML and Qt Quick
6 Posts 4 Posters 3.8k Views 1 Watching
  • 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.
  • E Offline
    E Offline
    eminemence
    wrote on last edited by
    #1

    Hi, I was trying this code snippet:
    @ Text{
    id : main_title
    text : "Hello Qt from Symbian"
    x : rect_man.x
    y : 25
    font.family: "Arial"
    font.pixelSize: 25
    }

    Rectangle{
        id: rect_man
        width : main_title.width
        color:  "red"
        x: main_title.x
        y: main_title.y + main_title.font.pixelSize + 5
        height:  5
    }@
    

    As I had heard in the training videos, circular references would be flagged as warning. But I did not notice any warning while building this code in QtCreator?
    Am I doing something wrong or is my code alright?

    Qt is Qt - http://symbiangeek.flaminghorns.com

    1 Reply Last reply
    0
    • T Offline
      T Offline
      thisisbhaskar
      wrote on last edited by
      #2

      I have also seen this.. I feel it should give a run time warning/error . Can you raise a error in JIRA..

      1 Reply Last reply
      0
      • E Offline
        E Offline
        eminemence
        wrote on last edited by
        #3

        -JIRA? sorry where is that?-
        Edit: Got it. I am checking if similar issue has been raised.
        Whoops there are lots of issues. If someone has noticed a similar issue, please answer here. I am not really interested in checking the long list of bugs.

        Qt is Qt - http://symbiangeek.flaminghorns.com

        1 Reply Last reply
        0
        • D Offline
          D Offline
          DenisKormalev
          wrote on last edited by
          #4

          eminemence, use search :)

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mbrasser
            wrote on last edited by
            #5

            Hi,

            Warnings are raised when an actual binding loop is encountered, but there is no e.g. static analysis to detect circular references. The example code doesn't trigger the warning as both bindings are trying to set the respective values to their natural initial value of 0.

            If you'd like to see an example of how the warning is triggered, you can change:

            @x: main_title.x@

            to

            @x: main_title.x + 10@

            Regards,
            Michael

            1 Reply Last reply
            0
            • T Offline
              T Offline
              thisisbhaskar
              wrote on last edited by
              #6

              ok thanks. It makes sense now.. :)

              1 Reply Last reply
              0

              • Login

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