开发者

How can I make a transparent window stay on top?

开发者 https://www.devze.com 2023-01-06 21:26 出处:网络
I\'m trying to make a transparent window stays on top (z-order). I want to implement something like layer that indicates some parameters开发者_StackOverflow中文版 on the other program.

I'm trying to make a transparent window stays on top (z-order).

I want to implement something like layer that indicates some parameters开发者_StackOverflow中文版 on the other program.

So what I need is to make background transparent, not whole widget with QWidget::setWindowOpacity function.

I found some documents about it

  1. Transparent Backgrounds in Qt 4.1

  2. QWidget Class Reference — Transparency and Double Buffering

The first one explains "New in Qt 4.1: The Backing Store" and the picture is exactly what I want.

The second one explains more details about it. (left picture)

The left widget has no additional properties or widget attributes set. This default state suits most custom widgets using transparency, are irregularly-shaped, or do not paint over their entire area with an opaque brush.

But I don't know how to do it. I'm using Qt 4.6 B.T.W.


Taken from ctd's answer as suggested in the comments: QT4: Transparent Window with rounded corners

this->setAttribute(Qt::WA_TranslucentBackground, true); 
0

精彩评论

暂无评论...
验证码 换一张
取 消