Results 1 to 10 of 10

Thread: Top Level Widget Transparency

  1. #1
    Join Date
    Jul 2009
    Posts
    11
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Question Top Level Widget Transparency

    1. I declare a class derived from qwidget, and set its attribute with "setAttribute(Qt::WA_TranslucentBackground, true);"
    2. All I want is that the top level window will be transparent. But the result is that the winodw is filled by all black.
    3. I thought if the attribute was set up, the desktop could be seen from the window range.
    4. setMask() may gonna work, but I don't want to use.
    5. Plateform:Windows Qt4.4 or 4.5
    Before I post this thread, I've search the forum for my answer, but it seems none of the question comes to a end.
    Can anybody gives me a explanation for this issue? THX...

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Top Level Widget Transparency

    Did you set the FramelessWindowHint for the widget?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. The following user says thank you to wysota for this useful post:

    dotboy (2nd July 2009)

  4. #3
    Join Date
    Jul 2009
    Posts
    11
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Top Level Widget Transparency

    Quote Originally Posted by wysota View Post
    Did you set the FramelessWindowHint for the widget?
    That is the real reason....Thanks a lot...
    I also wonder to know what is exactly the title bar.Can I just think that it is because of the Frame of the widget has a black background?
    Do you have any informations about the title bar...
    thanks again...

  5. #4
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Top Level Widget Transparency

    Quote Originally Posted by dotboy View Post
    Do you have any informations about the title bar...
    you dont want to ask.. he does a lot

  6. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Top Level Widget Transparency

    What about the title bar? I'm afraid I don't understand your question.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #6
    Join Date
    Jul 2009
    Posts
    11
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Top Level Widget Transparency

    Quote Originally Posted by wysota View Post
    What about the title bar? I'm afraid I don't understand your question.
    ...What I've called "Title bar" is when I create a Widget without the flags "Qt::FramelessWindowHint", and the "Title bar" was shown at the top of the widget...

  8. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Top Level Widget Transparency

    I know what a title bar is I just still don't see a question about it.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  9. #8
    Join Date
    Jul 2009
    Posts
    11
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Top Level Widget Transparency

    I was thinking if the title bar acted as a parent of the main window and if it has a black background(because a widget with a title bar and was set attribute "Qt::WA_TranslucentBackground" shows full black), that what I want to ask...

  10. #9
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Top Level Widget Transparency

    The title bar is part of the windowing system, not the application - it's not a "parent" of any window. It's just that on Windows translucency requires the frameless window hint.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  11. #10
    Join Date
    Jul 2009
    Posts
    11
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Top Level Widget Transparency

    got it, thank u very much...

Similar Threads

  1. QDockWidget inside another widget in the center?
    By Antebios in forum Qt Programming
    Replies: 1
    Last Post: 16th February 2010, 07:06
  2. Custom event gets not propagated to the top level widget
    By nightghost in forum Qt Programming
    Replies: 0
    Last Post: 29th January 2009, 09:06
  3. Playbutton functionality
    By uchennaanyanwu in forum Qt Programming
    Replies: 5
    Last Post: 31st July 2008, 22:29
  4. How to Open & Close a Widget ?!!
    By Fatla in forum Qt Programming
    Replies: 6
    Last Post: 13th June 2008, 20:39
  5. Tricky problem with ARGB widget / UpdateLayeredWindow
    By nooky59 in forum Qt Programming
    Replies: 3
    Last Post: 21st February 2008, 10:35

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.