[Qt-interest] How can I change a QDialog's border color for a dialog under Win7

Joe Liu passer.by007gg at gmail.com
Fri Dec 31 18:19:28 CET 2010


Hi there,

Actually, I have two questions, about the border color and QBrush. Here they
are.

1).
I want to use some specific color for a dialog's border, and tried to do
this within Qt Designer by setting up the styleSheet, anyway I didn't see
any immediate effect.

I am using Win7 64bit enterprise system, and figure the window manager may
take over the rendering process, so I removed the window theme, like this:


DWMNCRENDERINGPOLICY policy = DWMNCRP_DISABLED;  // No Non-Client area
rendering
ret = DwmSetWindowAttribute(hWnd,
DWMWA_NCRENDERING_POLICY,
(void*)&policy,
sizeof(DWMNCRENDERINGPOLICY));

SetWindowTheme(hWnd, L"", L"");  // remove the window theme

These codes work, but the border color is still not applied as expected.

So I am wondering, how can we make the border-color take effect? Is it
really for a dialog frame?


2) .
Can we get the HBrush from the QBrush? Since I create this QBrush within Qt
Designer, and would like to apply my settings in customized WM_NCPAINT
message handler.
Google does not return useful information on this topic.

Any hint will be appreciated. Thanks.


Joe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110101/7ed426fc/attachment.html 


More information about the Qt-interest-old mailing list