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. Can I make an item be rendered when an ancestor of it has opacity 0?
Forum Update on Monday, May 27th 2025

Can I make an item be rendered when an ancestor of it has opacity 0?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
translucenttransparencyopacitycullingvisibility
1 Posts 1 Posters 611 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.
  • Stefan Monov76S Offline
    Stefan Monov76S Offline
    Stefan Monov76
    wrote on last edited by
    #1

    Problem statement

    Can I make an item be rendered when an ancestor of it has opacity 0?


    Motivation

    The motivation for this question is this other question of mine (I'll call it the "hidden-texture-source" problem). Note that currently I'm using opacity: 0 rather than visible: false, but this causes the same problem as in the linked question.

    The reason I'm hiding items is this.

    At one point, I was only culling directly each item that needs to be used as a texture source. So the fix for the hidden-texture-source problem was simple: (simplified pseudocode)

    texSourceItem.opacity = 1;
    cppItem.update(); // QQuickFramebufferObject
    texSourceItem.opacity = 0; // reset back to 0
    

    But now I'm also culling entire Rows of such items. And since opacity is inherited, if I want to update the cppItem, I have to do the unhide-hide dance for the entire parent Row. Then, two texture-source items may happen do the unhide-hide procedure with interlocked timing, so to avoid bugs, I have to keep a custom reference counter that knows how many cppItems are currently being updated. This is too complicated a solution for my liking. So an answer to my question would be beneficial.

    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