Optimization: Simplified ListView
-
Hi there.
I want to use QT on a simple hardware, e.g. without opengl or 2d acceleration. Especially the ListView is unbearably slow, both while flicking and by positionViewAtIndex.
It would be acceptable for me if all items stay put at the same position, only their data is changed while "scrolling", so every scrolling offset could be a multiple of the item's height. That means all displayed Widgets could be reused, and only the portion of each widget that actually changes has to be redrawn.
Is there a possibility to implement this without coding a new ListView-like type in C++? Say, binding each item indirectly via an offset to the underlying datasource?
Or if not, how would this new ListView-like class be implemented to offer the same slick delegate-functionality that ListView offers?
Thanks in advance.
-
I added
QApplication::setGraphicsSystem("raster");
as the first line in my Qt-Creator-generated main.cpp. But the Speed stays the same for "native", "raster" or "opengl", so I guess "raster" is the only available GraphicsSystem on my platform. Btw, OS is WinCE 6.0, no additional configure-switches were set. -
This would be one effect, yes. But I hoped to gain a performance increase because the Widgets created by the delegate could be reused, only invalidating the part of the screen that really changes. Say the background picture of each item largely stays the same, and only the portion covered by a changed text needs to be redrawn.
How would scroll-by-item be activated?
-
If you have some time, flattening the QWidget tree and using regions will do the trick. It definitely is more coding (C++) than using QML but you don't need to make compromises on user experience. ARM9 @ 200MHz with no HW accelerator for graphics can drive WVGA at 30+ FPS.
-
Pff tell me about slow ListViews.. I have the same problem, slow hardware (arm 300mhz, no graphic accelaration). For now I switched off all nice animations (while scrolling through the list). This helps a lot:
@
ListView {
highlightFollowsCurrentItem : true
highlightMoveSpeed : 1
highlightMoveDuration : 1
highlightResizeSpeed : 1
highlightResizeDuration : 1
}
@Also make sure the data retrieval contains no performance issues.
-
I do not use highlighting... the problem seems to be not slow graphics, but something in the event subsystem goes haywire when pushing the touch-screen. so flicking does not work at all. I have a very simple list with 20 elements, each defining 3 attributes defined in qml for testing purposes. My delegate is just a BorderImage with 3 texts displaying the attributes of each ListElement, but the list is also too slow for flicking when just using one text without background.
Moving the entire List by animating the x-property is acceptably fast btw. (as long as the touch is not pressed...), but I guess that only involves blitting a buffer.