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. Translucent window with child widgets has darker areas?

Translucent window with child widgets has darker areas?

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 118 Views 1 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.
  • T Offline
    T Offline
    Taytoo
    wrote on last edited by
    #1

    Created a translucent window with rounded corners by setting Qt::WA_TranslucentBackground attribute and overriding paint event of the window and drawing rounded rect using a Brush with opacity set to 200.

    It draws fine and is transparent, the problem starts when I add child widgets to this window i.e. label, combobox etc. Sometimes the window draws fine and is semi-transparent while the controls are opaque (as I want). Other times there are horizontal areas of darker background around some of the widgets. Darker color is basically darker version of whatever color I use for window.

    To me this implies that the area behind widgets is getting painted multiple times and alpha-blending is resulting in it getting darker. None of the examples I see online exhibit this, so confused how to avoid this?

    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