Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Program crashes with custom ImageItem and renderTarget == QQuickPaintedItem::FramebufferObject

    QML and Qt Quick
    qquickpaintedit framebufferobje
    2
    2
    818
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • G
      gs_chris last edited by

      Hello,

      I have an app that keeps a dynamically generated list of images in a ListView. The images are generated from backend data and exist in the form of QImage objects. In order to display them, I had to create a custom Item (subclassed off QQuickPaintedItem). This initially seemed to work well, but after a while I began to encounter random crashes when resizing the app window (I recompute the image list to fit the window size). The debugger stack showed only Qt functions, and the actual crash seemed to happen inside OpenGL driver code. There was no obvious connection to my code.

      After 2 days of wading through my code and trying to find any irregularity, I found that by commenting out one line of code I was able to avoid the crashes: This line is inside the constructor of my ImageItem class, and it reads:

      setRenderTarget(QQuickPaintedItem::FramebufferObject);

      It seems that setting that flag (which supposedly yields performance improvements) causes the random crashes I was encountering. I have come to conclude that this is a very nasty Qt/QML bug.

      regards,
      Christian

      p3c0 1 Reply Last reply Reply Quote 0
      • p3c0
        p3c0 Moderators @gs_chris last edited by

        Hi @gs_chris It looks very close to the warning here.

        Warning: Resizing a framebuffer object is a costly operation, avoid using the QQuickPaintedItem::FramebufferObject render target if the item gets resized often.

        157

        1 Reply Last reply Reply Quote 0
        • First post
          Last post