PDA

View Full Version : Top Level Widget Transparency



dotboy
2nd July 2009, 09:06
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...

wysota
2nd July 2009, 09:51
Did you set the FramelessWindowHint for the widget?

dotboy
2nd July 2009, 10:43
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...:p

nish
2nd July 2009, 10:56
Do you have any informations about the title bar...


you dont want to ask.. he does a lot:p

wysota
2nd July 2009, 10:57
What about the title bar? I'm afraid I don't understand your question.

dotboy
2nd July 2009, 11:04
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...

wysota
2nd July 2009, 11:14
I know what a title bar is :) I just still don't see a question about it.

dotboy
2nd July 2009, 13:46
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...

wysota
2nd July 2009, 13:54
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.

dotboy
2nd July 2009, 14:11
got it, thank u very much...