Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Program crashes with custom ImageItem and renderTarget == QQuickPaintedItem::FramebufferObject

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

Scheduled Pinned Locked Moved QML and Qt Quick
qquickpainteditframebufferobje
2 Posts 2 Posters 1.1k Views
  • 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 Offline
    G Offline
    gs_chris
    wrote on 8 Sept 2015, 08:43 last edited by
    #1

    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

    P 1 Reply Last reply 8 Sept 2015, 12:21
    0
    • G gs_chris
      8 Sept 2015, 08:43

      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

      P Offline
      P Offline
      p3c0
      Moderators
      wrote on 8 Sept 2015, 12:21 last edited by
      #2

      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
      0

      1/2

      8 Sept 2015, 08:43

      • Login

      • Login or register to search.
      1 out of 2
      • First post
        1/2
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved