Results 1 to 3 of 3

Thread: Problem: Transparent Background with Stylesheets

  1. #1
    Join Date
    Aug 2010
    Posts
    18
    Thanks
    2
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Problem: Transparent Background with Stylesheets

    Hi,

    I have read some threads about similar problems but I couldn't find an answer for mine. What I want is to set a background color with alpha for e.g. QMenus over a stylesheet. My application has a plastique style and I compile my code for Windows as well as Mac. Now the problem. Everything works fine under Mac. There I get a menu with transparent background. The same code under Windows7 results in an opaque background of the menu. Any hints how I can solve this problem?

    Regards,
    Marcus

  2. #2
    Join Date
    Apr 2011
    Posts
    124
    Thanks
    1
    Thanked 10 Times in 10 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows Symbian S60

    Default Re: Problem: Transparent Background with Stylesheets

    I vaguely recall that a WINDOW on Windows always has an opaque background. Will a widget work instead?

  3. #3
    Join Date
    Aug 2010
    Posts
    18
    Thanks
    2
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Problem: Transparent Background with Stylesheets

    Hi DanH,

    what do you mean by "will a widget work instead"? I can set the windowOpacity of widget to some alpha value between 0.0 and 1.0 and I get semitransparent toplevel windows. That's not the problem. What I want is a semitransparent Menu e.g. in connection with an action of my mainwindow toolbar. Therefore I set the background attribute in my stylesheet for QMenus but the alpha is only working on OSX. So what can I do to get the alpha working on Windows as well? Do I have to set some Flag to the QMenu to tell Windows that it can have transparent backgrounds?

    Regards,
    Marcus

Similar Threads

  1. Replies: 1
    Last Post: 28th December 2010, 09:43
  2. Qt Widgets seen half transparent when using stylesheets
    By codeslicer in forum Qt Programming
    Replies: 5
    Last Post: 14th December 2010, 09:52
  3. Problem with OpenGL support (transparent background)
    By developer-nsk in forum Qt Programming
    Replies: 0
    Last Post: 2nd November 2009, 19:31
  4. QTabWidget transparent background problem
    By destroyar0 in forum Qt Programming
    Replies: 10
    Last Post: 25th June 2009, 12:19
  5. Transparent background on QLabel on transparent QWidget
    By codeslicer in forum Qt Programming
    Replies: 1
    Last Post: 13th February 2008, 02:10

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
  •  
Qt is a trademark of The Qt Company.