[Interest] Loader seems to be blocking animation

Sletta Gunnar Gunnar.Sletta at digia.com
Tue Dec 10 14:43:56 CET 2013


You want to have a look at the new Animator types introduced in Qt 5.2. These run on the render thread and won't be blocked when the loader is running.

http://doc-snapshot.qt-project.org/qt5-stable/qtquick-statesanimations-topic.html#animators

cheers,
Gunnar

________________________________________
Fra: interest-bounces+gunnar.sletta=digia.com at qt-project.org [interest-bounces+gunnar.sletta=digia.com at qt-project.org] på vegne av VStevenP [vstevenpavao at yahoo.com]
Sendt: 10. desember 2013 14:20
To: interest at qt-project.org
Emne: [Interest] Loader seems to be blocking animation

Is it possible to avoid the Loader blocking an animation in the following case?:

1. I have a sidebar that contains a few icons, and I am animating the location of a colored Rectangle to highlight the most recently touched sidebar icon.

2. As a result of a new sidebar icon selection, I am unloading/loading some other QML based on the resulting change to the value of currentTab.

So, I've basically got a very simple situation where the sidebar icon selection controls the QML that is loaded/shown in a shared client area of the display.

Sample code:

        DesktopIcon {
            id: thisIcon
            y: 200
            source: "thisIcon.png"

            onDesktopIconClicked: {
                pageTabs.state = 'arrange'            // This triggers the animation of the highlighter rectangle of the icon.
                currentTab = Common.PageView.Arrange  //  This causes unload old QML then load new QML for client pane area,
                                                      //  due to a binding to currentTab elsewhere in the code.
            }
        }

This code causes a noticeable delay before the animation occurs, at least on Android.  It seems the Loader blocks the animation.  Is this delay at all avoidable?  My current workaround is to not use the Loader, and just load all the QML at startup, then use the visibility property to control what is shown in the client pane area.  It requires that more QML stay loaded at a given time, though.  (This workaround might not be all bad, because it would allow for nicer transition animation possibilities in the client pane area.)

- VStevenP
_______________________________________________
Interest mailing list
Interest at qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest



More information about the Interest mailing list