I have 2 widgets:
One of them is background(semi-transparent), second contains other widgets(without background)
Can I make a blur behind window like this?
Asked
Active
Viewed 1,779 times
3

Dmitry Bardyshev
- 95
- 9
-
1I guess you can hijack the parent's paint event and append a blur in the children's rect and do the alpha blending mormally. For example, sub class the widget's class, re-implement paint event, add to the end: if background is visible, do a blur in the background's rect. Also this might be helpful http://stackoverflow.com/questions/19383427/blur-effect-over-a-qwidget-in-qt – user3528438 Jan 04 '16 at 22:29
-
have you found a solution? I'm looking for the same. – ofer dofer Jul 10 '16 at 20:42
1 Answers
0
I have 2 widgets: One of them is background(semi-transparent), second contains other widgets(without background)
QLCDNumber is a widget of such kind.
That is doable and one of the good examples is: C++,Qt QMainWindow Transparent Background Example. But if you need to make it semi-transparent or lower the transparency you can do something like:
// mind the last component of rgba
mainwindow->setStyleSheet("QMainWindow{background-color: rgba(255, 255, 255, 127)};");

Alexander V
- 8,351
- 4
- 38
- 47