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

StackView.visible attached property makes children of an item visible even when the item is invisible

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • 6.5.0 RC
    • Quick: Controls 2
    • None

      In the file I have attached, the code uses StackView.visible to toggle the visibility of an item that will be pushed onto a StackView.

      I have a stackview and two items I plan to push on to the stack. I cannot use Component because I plan to communicate with items inside the parent item later on, so I opt for the StackView.visible attached property, to make the items invisible until they have been pushed to the stack.

      What did I expect to happen:

         - When the item has not been pushed yet onto the stackview or is not part of the stackview, its children as well as itself should be invisible.

       

      What happens instead:

        - The parent item with the StackView.visible declared on it, stays invisible till it is made the current item in the stackview, but its children stays visible the whole time, even before it is later pushed onto the stack.

       

       

      However I have been able to get around it by using the StackView.index attached propery instead as

      visible: StackView.index == 0

        1. in_stack.PNG
          in_stack.PNG
          11 kB
        2. not_in_stack.PNG
          not_in_stack.PNG
          11 kB
        3. buggy_code.qml
          0.9 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            amohampofo Godwin Amoh - Gyebi
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes