QML StackView mangles strings after a few pushes

222 views Asked by At

I'm creating a QML application for sports bookmaking.

I have a StackView that shows various competitions and markets.

Previously, I used one View to e.g. display various matches in soccer, and then depending on the data I got, I simply changed the model in this view.

I used a StackView to push and pop various views to the user.

I now want to dynamically allocate these views onto the stack:

StackView {
    id: stack

    delegate: StackViewDelegate {
        function transitionFinished(properties) {
            properties.exitItem.opacity = 1
            properties.exitItem.visible = false
        }

        pushTransition: StackViewTransition {
            PropertyAnimation {
                target: enterItem
                property: "opacity"
                from: 0
                to: 1
            }
            PropertyAnimation {
                target: exitItem
                property: "opacity"
                from: 1
                to: 0
            }
        }
    }
}

And a component not yet allocated:

Component {
    id: groupComponent

    GroupView {
        onCompetitionClicked: {
            root.showCompetition(competitionId);
        }
    }
}

Component {
    id: competitionComponent

    CompetitionView {
            // Blabla
    }
}

When clicking in this component, showCompetition pushes a new view onto the stack:

    function showCompetition(competitionId) {

            var view = competitionComponent.createObject();
            view.loadCompetition(competitionId);

            stack.push( {item:view, destroyOnPop:true});
    }

So now this happens (Screenshots)

Before I changed it to dynamic allocation (notice I have hard-coded a title for debugging): enter image description here

After I changed to dynamic allocation (notice the fonts look thicker?): enter image description here

After clicking around a big: enter image description here

Going back to the first page (notice even the hard coded string is obfuscated): enter image description here

Apparently something goes wrong with the strings, as the number data seems to be the same, and the data I receive are still correct, as the breadcrumbs in the top still display the right strings.

What is going on?

0

There are 0 answers