[Interest] Qt Style Sheet problem under Windows 7

Tibold Kandrai dom at dotzteam.com
Fri Apr 6 08:35:42 CEST 2012


Hi!

Check this example from Qt's website:
http://doc.qt.nokia.com/4.7-snapshot/stylesheet-examples.html#customizing-qmenu

What you need is probably:
QMenu::item {
  background-color: transparent;
}

Cheers,
Tibold

On 06/04/2012 02:54, Andrea Borsic wrote:
> 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
>
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest


-- 
Tibold Kandrai
CEO @ Dotz Team

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20120406/27332e6f/attachment.html>


More information about the Interest mailing list