Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QLabel and Background Transparency
Qt 6.11 is out! See what's new in the release blog

QLabel and Background Transparency

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 2.1k Views 2 Watching
  • 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.
  • webzoidW Offline
    webzoidW Offline
    webzoid
    wrote on last edited by
    #1

    I'm using stylesheets to control the overall theme of my application.

    In a number of instances, I have semi-transparent panels (90% transparency) which contain QLabel widgets who have their background-color style property set to be transparent. This works fine up until the point at which the text in the label changes, then the background is no longer transparent.

    If I force a re-paint of the container QWidget, then all becomes clear again (pardon the pun) however, I don't really want to do this parent re-paint every time a label is updated (there are 8 updatable QLabels on this particular QWidget) as it seems a fairly expensive thing to do.

    How can I maintain the transparency of a QLabel even when the text() has changed?

    sankarapandiyanS 1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by mrjj
      #2

      Hi
      Tried to reproduce it but had no luck.

      1 Reply Last reply
      0
      • webzoidW webzoid

        I'm using stylesheets to control the overall theme of my application.

        In a number of instances, I have semi-transparent panels (90% transparency) which contain QLabel widgets who have their background-color style property set to be transparent. This works fine up until the point at which the text in the label changes, then the background is no longer transparent.

        If I force a re-paint of the container QWidget, then all becomes clear again (pardon the pun) however, I don't really want to do this parent re-paint every time a label is updated (there are 8 updatable QLabels on this particular QWidget) as it seems a fairly expensive thing to do.

        How can I maintain the transparency of a QLabel even when the text() has changed?

        sankarapandiyanS Offline
        sankarapandiyanS Offline
        sankarapandiyan
        wrote on last edited by
        #3

        @webzoid You can use setvisible (true) And (False) and make a transparent even when the text has changed

        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