[Interest] Qt Style Sheet problem under Windows 7

Andrea Borsic andrea.borsic at dartmouth.edu
Fri Apr 6 02:54:04 CEST 2012


Dear All,

I am developing a PyQt based application with the following environment:

Windows 7 64bit
Qt 4.7.3 compiled from sources for 64bit (using Visual Studio 2010)
PyQt 4.9.1

I am using the Qt Style Sheets to set all the widgets to have a dark 
gray background, using the following stylesheet string:

" * {  background-color: rgb(80,80,80);  }"

Everything works as expected (all the widgets turn dark gray) except 
from the "File" menu, where the background of the text "File" remains 
light gray. The whole menu bar turns dark gray, except from a small 
rectangular area under the text "File" representing the title of the 
menu. I am attaching to this email a screenshot of the main window of 
the application - I am not sure though it will be published on the 
mailing list.

I have tried setting the background color of the menu explicitly, as:

" QMenu {  background-color: rgb(80,80,80);  }"

to no avail. The first style sheet command should anyway apply to all 
widgets, given the '*' selector.

I have noticed that if I change the Windows theme to Classic, the 
problem disappears (the menu is rendered dark gray), if I switch back to 
the Windows 7 theme, the problem shows. I guess the problem might arise 
therefore from the interaction between Qt and the OS.

Has anybody experienced anything similar ?

Thanks very much for any comment !

Best Regards,

Andrea
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot Vascular Explorer.jpg
Type: image/jpeg
Size: 59356 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20120405/2a0c61b5/attachment.jpg>


More information about the Interest mailing list