How to improve qml application program's speed
-
Hi everyone:i meet a trouble,it's very emergency,we did a picture viewer,we use QML write user interface,use C++ implement application logic,when we carry out the program,slide the cellphone screen to view picture one by one ,it too slow to bear,so can you give me some advices to solve this problem?thanks very much!
-
-
I agree with Chuck.Gao. It's depends on your code.
- Try to use QDeclarativeItem for complex things.
- Less Gradients.
-
Hi, have you read this performance tip article: http://doc.qt.nokia.com/4.7/qdeclarativeperformance.html
I have an application which uses ListView which definitely needed speeding up.For me, the best tip in the article was preferring anchoring instead of binding. Actually my app used to use Row and Column components, but anchoring was also much faster than using the layout elements.
Also keeping delegates as simple as they can be gave a little bit more speed.
I used to have a gradient with four stops which also gave its own overhead. I created similar gradients in a vector graphics application and saved those as .png's and imported them with Image element instead.
Combining all these improvements (with a help of cacheBuffer), I managed to get quite velvet panning for my view :)
edited: corrected a typo
-
I am going to try to find you a blog posting I once saw about speeding up QML apps. The biggest item in the posting was about not using Rectangles over Rectangles. Each Rectangle needs to be drawn. So if you have a Rectangle that will really never be seen, use Item instead. That way the program doesn't need to draw a Rectangle that will never be seen. I hope this makes sense. I will post link if I can find it again.
-
Yeah, removing overlapping items should help. In addition, there is this: http://juhaturunen.com/blog/2011/04/a-qml-rendering-performance-trick-so-simple-that-it-hurts/
It's also an issue which considers every QML app, even if they don't use ListView's.