Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Forums

OverviewFelgo SDK Support › StackViewDelegate Missing Dependency

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #25393

    Glenn

    Your StackView API docs mention using the StackViewDelegate to modify the NavigationStack transitionDelegate.  The sample code in the docs say we can use the StackViewDelegate to modify the pushTransition and popTransition object properties.

    The problem I’m seeing is that StackViewDelegate.qml does not exist in my Felgo 4.1.0 sources. Qt Creator can’t find it. What am I missing? Where should I look?

    #25394

    Günther
    Felgo Team

    Hi,

    In Felgo 3 (Qt 5 with Quick Controls 1) you would use the Qt StackViewDelegate as described here: https://doc.qt.io/qt-5/qml-qtquick-controls-stackview.html#transitions

    With Felgo 4 and Qt 6 it works differently. Also, there seems to be a bug that prevents customizing the Felgo 4 StackViewDelegate of NavigationStack.

    As a workaround, you can overwrite the delegate transitions after the component was created:

    NavigationStack {
            id: stackView
            Component.onCompleted: {
                stackView.transitionDelegate.pushEnter = pushEnterTransition
                stackView.transitionDelegate.pushExit = pushExitTransition
                stackView.transitionDelegate.popEnter = popEnterTransition
                stackView.transitionDelegate.popExit = popEnterTransition
            }
            
            Transition {
                id: pushEnterTransition
                PropertyAnimation {
                    property: "opacity"
                    from: 0
                    to:1
                    duration: 200
                }
            }
            
            
            Transition {
                id: pushExitTransition             
                PropertyAnimation {
                    property: "opacity"
                    from: 1
                    to:0
                    duration: 200
                }
            }
            
            Transition {
                id: popEnterTransition             
                PropertyAnimation {
                    property: "opacity"
                    from: 0
                    to:1
                    duration: 200
                }
            }
            
            Transition {
                id: popExitTransition
                PropertyAnimation {
                    property: "opacity"
                    from: 1
                    to:0
                    duration: 200
                }
            }
    }

    Thank you for raising the issue, we will fix it with one of the next updates.

    Best,
    Günther

Viewing 2 posts - 1 through 2 (of 2 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded