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. QQuickPaintedItem with opaquePainting
Forum Updated to NodeBB v4.3 + New Features

QQuickPaintedItem with opaquePainting

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 193 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.
  • M Offline
    M Offline
    Michal Turcel
    wrote on last edited by
    #1

    Hi, I am on embedded Linux using LinuxFB plugin and software backend. I am using transparent window background and I have a translucent QQuickPaintedItem on the bottom with some small UI on top. In this case I can use setOpaquePainting(true); since there is nothing under the item that it needs to blend with, and it is significantly faster.

    You can pan the contents of this item by dragging with mouse, but it might take significant amount of time to paint. So I implemented it as moving the item (so part of the screen will be empty as you move it, but that's acceptable) and on mouse release recenter it and repaint at this new position. This way you don't "paint" the item into the render target while you're dragging it, only the render target is being redrawn at different position in the scene.

    However, I noticed that this "draw" time increases with the number of partially transparent pixels in the render target. Fully transparent is as fast as fully opaque. Only explanation I could come up with is that the render target is in premultiplied format and whatever it is drawing into is not. In that case even though it is not blending, it needs to divide each channel by alpha if it is not 0 or 255. Is that the case? If so, is there any way to choose the format of the render target?

    For a while I considered using 1x1 pixel checkerboard of black and transparent as a background. It doesn't look as bad as I expected, but sharpness setting on a monitor can affect it a lot. It also flickers because of the pixel response time, but that could be worked around by making sure x+y is always even.

    1 Reply Last reply
    0

    • Login

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