Nominate our 2022 Qt Champions!

C++ delegate in QML ListView, possible?

  • Greetings all,

    I'm writing app that uses Qt Quick. Currently I'm experiencing performance issues with QML ListView element (the items are drawn with artifacts during scrolling, same happens in OpenGL apps when double buffering is turned off). It looks that this problem occurs due to complicated delegate, so I have a question: is it possible somehow to expose the C++ delegate to QML ListView? Thank you in advance

  • Well, since you can use any QML element as a delegate, and since you can code QML elements in C++, I think the answer would be: "sure you can". It would just not be a delegate in the sense of a QAbstractItemDelegate, but a subclass of QDeclarativeItem like any other QML element.

  • Thank you very much, I'll try to explore this idea

Log in to reply