CodexBloom - Programming Q&A Platform

QML ListView flickering when scrolling with complex delegate in Qt 6.5

šŸ‘€ Views: 486 šŸ’¬ Answers: 1 šŸ“… Created: 2025-06-14
qt qml performance

I keep running into I'm working on a project and hit a roadblock. I'm experiencing a flickering scenario when scrolling a `ListView` that uses a complex delegate in Qt 6.5. The delegate contains a variety of elements, including images, text, and custom components, which seem to trigger a performance bottleneck during scrolling. I've implemented the `ListView` like this: ```qml ListView { width: 400 height: 600 model: myModel delegate: Item { width: 400 height: 100 Row { Image { source: model.imageSource width: 50 height: 50 } Text { text: model.title font.pointSize: 20 } // Additional complex components MyCustomComponent { property var itemData: model } } } } ``` While this works, during scrolling, the entire `ListView` flickers, especially when the images load asynchronously. I've tried using `CacheBuffer` in the `ListView`, but it hasn't resolved the scenario. Also, I’m using a custom model that loads data from a database, and it seems to perform adequately; however, the UI experience is poor due to this flickering. I came across the following message in the debug output: `QML ListView: Too much content is being drawn at once, consider optimizing your delegates or using a more efficient model.` Is there a best practice for optimizing the performance of `ListView` with complex delegates in Qt? Any help would be greatly appreciated! I recently upgraded to Qml LTS. I'm working with Qml in a Docker container on Ubuntu 22.04. Is there a simpler solution I'm overlooking?