Results 1 to 3 of 3

Thread: Translucent window background in 4.3.2 - possible?

  1. #1
    Join Date
    Jul 2009
    Posts
    12
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Translucent window background in 4.3.2 - possible?

    Hi!

    I have a top-level window which is painted using QPixmap with varying alpha-channel. With Qt 4.5.x I use setAttribute( Qt::WA_TranslucentBackground) to make these regions semi-transparent depending on alpha value.

    Now I have the need to achieve the same effect with Qt 4.3.2 (please don't ask me why 4.3.2, I have my reasons ).

    I can't find a way to do this, perhaps someone can give me an advice? Is it possible at all?

    QLabel::setMask() won't do, because it only respects alpha 0 and alpha 1, not a values in between.

  2. #2
    Join Date
    Jul 2007
    Location
    California, USA
    Posts
    62
    Thanks
    17
    Thanked 7 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Translucent window background in 4.3.2 - possible?

    Do you only want part of the windows transparent? If so, then I think you'll have to go into Qt source code and make the changes yourself.

    If you want the whole app to have some sort of transparency, you can use QWidget::setWindowOpacity(qreal level);

  3. #3
    Join Date
    Jul 2009
    Posts
    12
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Translucent window background in 4.3.2 - possible?

    The first case: I want to draw a custom shadow with ranging alpha value on the sides of my window, while other parts staying opaque.

    Ok, thanks, perhaps I'll try to search on how QA_TranslucentBackground is implemented in 4.5.x...

Similar Threads

  1. How to set Qt window transparent?
    By montylee in forum Qt Programming
    Replies: 17
    Last Post: 24th December 2013, 20:11
  2. Window Background
    By QbelcorT in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 23rd September 2008, 06:03
  3. Set a window as child at runtime
    By sabeesh in forum Qt Programming
    Replies: 1
    Last Post: 26th November 2007, 09:30
  4. Background image for main window widget using css.
    By Enygma in forum Qt Programming
    Replies: 8
    Last Post: 23rd August 2007, 15:40
  5. Replies: 15
    Last Post: 23rd March 2007, 16:16

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.