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

Item state change reverts item's scaled size

    XMLWordPrintable

Details

    • Android, iOS/tvOS/watchOS, macOS, Windows
    • 0232ef390 (dev), da8dea905 (6.8), 71d60afc6 (6.7), 0994f9a8a (tqtc/lts-6.5)

    Description

      QML Item state change reverts item's size back to old size even size is not part of state property change. If Item size is scaled after Item has changed its state to a defined state Item size is reverted to original when Item state changes back to default state. This is a regression in Qt6, not reproducible with Qt5.15.17.

      Customer has an issue in their mobile app where their ToggleSwitch thumb indicator (knob) size expands when disabled if it was enabled at startup. Size of the UI controls inside the application, including ToggleSwitch, are controlled via scaleFactor which is calculated at application startup. The issue emerged after transitioning from Qt5.15 to Qt6.

      ToggleSwitch has been implemented in a way that knob position is controlled via anchoring. In ToggleSwitch main state knob is anchored to left of the toggle root object. It has a state "statusOn" where anchor is changed to right with AnchorChanges.

      Example app which can be built on both Qt6 and Qt5 included and video on macOS attached.

      1. ToggleSwitch and knob size is calculated with initial default scaleFactor 1.
      2. If ToggleSwitch is enabled it changes its state into "statusOn"
      3. Value of the scaleFactor gets calculated
      4. ToggleSwitch and knob size get re-calculated to scaled size
      5. When ToggleSwitch is disabled at later point it changes its state to main state and knob gets the size it had before scaleFactor was adjusted

      Attachments

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

        Activity

          People

            mikko.hallamaa Mikko Hallamaa
            tealamak Tero Alamäki
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews