Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Sometimes page animation is not running when currentIndex is changed on a SwipeView



  • In one of my projects, I'm currently facing a strange bug which I cannot figure out. This bug happens in a complex interface, and I could not reproduce it in a simpler project, so forgive me, I cannot publish any code to illustrate the issue.

    So my problem is the following: In a qml file, I have a SwipeView, which contains several pages, each of them contain a ListView and several other components (Buttons, TextInput, ComboBox, ...) One of these page shows a kind of file browser, an when you double-click on a dir, the view is cleared and repopulated with the sub-dir content, in a such manner it's possible to browse in the dirs content.

    However, every time I clear and repopulate the view of this browser, the page animation is broken in the parent SwipeView, in a such manner as when I change the currentIndex property, the value effectively changes, but the SwipeView remains on the same page, and the animation never runs.

    I tried to search the reason of a such bug for several days now, but I cannot understand why it happens. All I know is:

    1. The bug seems appear after the following code is executed in my browser model Clear() function:
        beginResetModel();
        m_Rows.clear();
        endResetModel();
    
    1. The SwipeView currentIndex property no longer runs the page change animation until I interfere with something on the UI (e.g clicking a button, moving manually the page a little, ...). If I do that the currentIndex property works again... until the browser view is cleared again.

    I have sincerely no idea about what may cause a such bug. Has someone already faced a such bug? What was the solution if yes? And by the hell, what may cause a such bug? May is a memory corruption? Or what else...

    NOTE I may eventually publish the demo I created to try to reproduce the issue, if it may help, however, as I said, this demo doesn't present the issue, so I thought that it wouldn't be useful.