[Qt-interest] Menu Bar - Drawing back ground
Santhosh Y
santhosh at softjin.com
Wed Jul 1 16:01:16 CEST 2009
Lars Amsel wrote:
> Santhosh,
>
> Santhosh Y wrote:
>
>> It works but the paintEvent of QMenuBar is over-riding background. So
>> half the portion will be seen with the style sheet set background and
>> the other
>> half i.e. with menu back ground is default.
>>
>> My issue is setting the style sheet back ground to the entire menu bar.
>>
>
> There is no need to override the paint method. You have to make the items
> transparent in the stylesheet:
>
> QMenuBar {
> background-image: url(:/res/menu_bg.png);
> }
> QMenuBar::item {
> background-color: transparent;
> }
>
Thanks a lot Lars Amsel.
This is exactly what I was looking for.
I tried with the above by setting transparent color and it works
> You may also set the selected/pressed/ states like this
>
> QMenuBar::item:selected {
> background-color: red;
> );
>
>
> Lars
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
--
----------------------------------------------------
Y Santhosh Kumar
Senior Software Engineer
SoftJin Technologies Private Limited
Unit No. 102, Mobius Tower,
I Floor, SJR I - Park,
EPIP, White Field,
Bangalore - 560066, India
U : www.softjin.com
E : santhosh at softjin.com
T : +91-80-41779999
M : +91-9740535265
----------------------------------------------------
Business Disclaimer
____________________________________________________________
This e-mail message and any files transmitted with it are intended solely
for the use of the individual or entity to which they are addressed. It
may contain confidential, proprietary or legally privileged information.
If you are not the intended recipient please be advised that you have
received this message in error and any use is strictly prohibited. Please
immediately delete it and all copies of it from your system, destroy any
hard copies of it and notify the sender by return mail. You must not,
directly or indirectly, use, disclose, distribute, print, or copy any part of
this message if you are not the intended recipient.
___________________________________________________________
More information about the Qt-interest-old
mailing list