Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-20187

Alternating between pixelSize and pointSize in state changes does not work as expected

    XMLWordPrintable

Details

    Description

      In the code below, when entering state 2, pointSize is set to 80 but then its pixelSize is immediately set back to 25.

      import QtQuick 2.0
      
      Item {
          id: main
          height: 640; width: 360
      
          Text {
              id: label
              text: "hello world"
              font.pointSize: 25
          }
      
          states: [
              State {
                  name: "1"
                  PropertyChanges { target: label; font.pixelSize: 10 }
              },
              State {
                  name: "2"
                  PropertyChanges { target: label; font.pointSize: 80 }
              }
          ]
      
          MouseArea {
              anchors.fill: parent
              onClicked: {
                  if (main.state == "")
                      main.state = "1"
                  else if (main.state == "1")
                      main.state = "2"
                  else
                      main.state = ""
              }
          }
      }
      

      Attachments

        Issue Links

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

          Activity

            People

              qt.team.quick.subscriptions Qt Quick and Widgets Team
              bodson Yann Bodson (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes