Qt: Erase background (Windows Aero Glass)

匆匆过客 提交于 2019-11-29 20:29:24
Viesturs

Just use:

QPainter p  p.setCompositionMode(QPainter::CompositionMode_DestinationIn); p.fillRect(boundsRect, QColor(0, 0, 0, 0)); 

This discards the old contents and fills with transparent color.

More info at

Edit: Better use CompositionMode_Clear and paint the rect with whatever color.

I've been googling for a while so I thought I would share the solution:

replace WA_NoSystemBackground to WA_TranslucentBackground and forget about the mousepressevent

now the window is transparent aero glass and re-rendered automatically when needed, yay :)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!