Uploaded image for project: 'Qt Safe Renderer'
  1. Qt Safe Renderer
  2. QSR-985

QML type two states with same name creates weird behavior without warnings

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • QSR 2.1
    • QSR 1.2
    • Runtime, Tooling
    • None

    Description

      Modified the indicators example.

      If there are two states with the same name, then the color property change is taken from the first one and the position change is taken from the second one.

      Below is working code. And if you rename the state D to C and test with QSR test harness, you will see the above described behavior. The states are mixed. Should there be a warning of the overlapping names, or the latter definition would be used fully, not partially? And is there a need to mention something in the safety manual?

      SafePicture {
              id: car1
              objectName: "car1"
              x: 0
              y: 0
              opacity: 1.0
              width: 64
              height: 64
              color: "#ff0000"
              source: "qrc:/iso-icons/iso_grs_7000_4_1358.dat"
              states: [
                      State {
                          name: "A"
                          PropertyChanges {
                              target: car1
                              x: 64
                              y: 64
                              opacity: 0.8
                              color: "#0000ff"
                          }
                      },
                      State {
                          name: "B"
                          PropertyChanges {
                              target: car1
                              x: 128
                              y: 128
                              opacity: 0.8
                              color: "#00ff00"
                          }
                      },
                      State {
                          name: "C"
                          PropertyChanges {
                              target: car1
                              x: 172
                              y: 172
                              opacity: 0.8
                              color: "#ff0000"
                          }
                      },
                      State {
                          name: "D"
                          PropertyChanges {
                              target: car1
                              x: 256
                              y: 256
                              opacity: 0.8
                              color: "#ffff00"
                          }
                      }
      
              ]
      

       

      Attachments

        For Gerrit Dashboard: QSR-985
        # Subject Branch Project Status CR V

        Activity

          People

            teemu.holappa Teemu Holappa
            assaarel Asmo Saarela (Inactive)
            Veli-Pekka Heinonen Veli-Pekka Heinonen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes