Note that there are some explanatory texts on larger screens.

plurals
  1. POQt: Erase background (Windows Aero Glass)
    primarykey
    data
    text
    <h1>Update</h1> <p>see <a href="http://labs.trolltech.com/blogs/2009/09/15/using-blur-behind-on-windows/" rel="nofollow noreferrer">Using Blur Behind on Windows</a> for an example of using Qt and <a href="http://msdn.microsoft.com/en-us/library/aa969540(VS.85).aspx" rel="nofollow noreferrer">DWM</a>.<a href="http://labs.trolltech.com/blogs/wp-content/uploads/2009/09/blurbehind2.png" rel="nofollow noreferrer">alt text http://labs.trolltech.com/blogs/wp-content/uploads/2009/09/blurbehind2.png</a></p> <hr> <h2>Original question:</h2> <p>I want to create a Windows Aero Glass window with Qt, now it looks like this: <img src="https://img-fotki.yandex.ru/get/3203/goodrone.0/0_1ee1c_ecb3fc6e_L.jpg" alt="alt text"></p> <p>But after calling some <code>my_window->repaint()</code> my window's label becomes broken: <img src="https://img-fotki.yandex.ru/get/3201/goodrone.0/0_1ee20_16877c58_L.jpg" alt="alt text"></p> <p>But now <strong>if I resize the window</strong> slightly, it repaints properly.</p> <hr> <p><strong>The question is</strong>: how do I erase the window background, so that widgets would paint themselves on a clean glass?</p> <hr> <p>The short code to reproduce the problem is (Vista with Aero):</p> <pre><code>class Window(QWidget): def __init__(self, *args): QWidget.__init__(self, *args) self.setLayout(QVBoxLayout()) self.layout().addWidget(QLabel("This is the text")) # let the whole window be a glass self.setAttribute(Qt.WA_NoSystemBackground) from ctypes import windll, c_int, byref windll.dwmapi.DwmExtendFrameIntoClientArea(c_int(self.winId()), byref(c_int(-1))) def mousePressEvent(self, event): self.repaint() </code></pre> <p>You can click the window now, or just hit <code>Alt-Tab</code> several times.</p> <p>Anyway, using labels with Aero Glass is not what I need, because QLabel doesn't know how to paint itself with a while glow (like the title of the window). What I need is a general way to clean the "glass".</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload