just try ..
use
void QPainter::setOpacity ( qreal opacity )
Qt Code:
in paintEvent() { painter->setOpacity(opacity); } in void TransparentWindow::setOpaque() { opacity = 0.2; update(); }To copy to clipboard, switch view to plain text mode
just try ..
use
void QPainter::setOpacity ( qreal opacity )
Qt Code:
in paintEvent() { painter->setOpacity(opacity); } in void TransparentWindow::setOpaque() { opacity = 0.2; update(); }To copy to clipboard, switch view to plain text mode
"Behind every great fortune lies a crime" - Balzac
Have a look at Qt::WA_TranslucentBackgroundYou can use it to get a transparent window with non-transparent childs.
I have tried the option QPainter::setOpacity ( qreal opacity )
Still it didn't work.
Is there any other option.
Waiting for reply.
Raghvendra
setWindowOpacity() works only if you have composite extension enabled in X11. Here's an extract from Qt documentation of setWindowOpacity():
So, in my office PC with composite extension, setWindowOpacity() doesn't work but it works on my laptop as i have composite extension (Beryl 3D) installed.Note that under X11 you need to have a composite manager running, and the X11 specific _NET_WM_WINDOW_OPACITY atom needs to be supported by the window manager you are using.
My GNU/Linux Blog:
http://funwithlinux.blogspot.com
Thnx for that Information.
Could you plz tell me how can i enable composite extension in X11. I am new to this concept.
Plz do reply...............
Regards
raghvendra
oops, sorry i missed this thread for long
u can just google for "how to enable composite extension in linux or X11"
Also, if you just want to show your desktop and make your window appear as transparent, you can use the grabWindow function to get the desktop background as a QPixmap and then you can just set your window background to that pixmap.
My GNU/Linux Blog:
http://funwithlinux.blogspot.com
Bookmarks