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. [SOLVED] Children's opacity greater than parent's?
QtWS25 Last Chance

[SOLVED] Children's opacity greater than parent's?

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 2 Posters 3.9k 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.
  • F Offline
    F Offline
    Fenix Voltres
    wrote on last edited by
    #1

    Is it possible?
    I need to display console with opacity let's say 0.5 with text on it having 1.0, is it possible?

    [quote author="Documentation" date="1301943141"]
    When this property is set, the specified opacity is also applied individually to child items. In almost all cases this is what you want, but in some cases it may produce undesired results.
    [/quote]

    but it doesn't say what to do in that particular 'some cases'...

    When temptation brings me to my knees
    And I lay here drained of strength
    Show me kindness
    Show me beauty
    Show me truth

    1 Reply Last reply
    0
    • Z Offline
      Z Offline
      ZapB
      wrote on last edited by
      #2

      My first thought would be to not make the opaque item a child of the transparent one. Instead fake it by positioning it using anchors relative to the semi-transparent item.

      @
      Item {
      Rect {
      id: myRect
      opacity: 0.5
      }

      Text {
          anchors.centerIn: myRect
          text: "I am opaque text"
      }
      

      }
      @

      [Not tested]

      Nokia Certified Qt Specialist
      Interested in hearing about Qt related work

      1 Reply Last reply
      0
      • F Offline
        F Offline
        Fenix Voltres
        wrote on last edited by
        #3

        Thank you, your idea works. :)

        When temptation brings me to my knees
        And I lay here drained of strength
        Show me kindness
        Show me beauty
        Show me truth

        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