[Qt-interest] setting background pixmap for a widget (QmenuBar, QtoolBar or to an QWidget)

Santhosh Y santhosh at softjin.com
Mon Jun 29 09:36:02 CEST 2009


Hello,

I want to set background images for my menuBar as well as for ToolBar;
What I should be doing for setting the back ground image to the menu bar.

I am trying to set the pixmap for rendering call. But it is not working.

What is the way of setting the background image for menu & too bars.
Let us say my windows screen resolution is 1440 X 990.

So I would like to set the menubar background to applications complete 
width i.e. 1440;
And the width of my png  /images/Bg_BigMainMenu.png is also 1440 and the 
height is 32 pixels.

---------------------------------------------------
class MenuBar : public QMenuBar
{
    Q_OBJECT
    public:
        MenuBar (QWidget* parent) : QMenuBar (parent)
    {
        QPixmap pMap(":/images/Bg_BigMainMenu.png");
        render(&pMap);
    }
    protected:
};
---------------------------------------------------
Any idea how to do this?

Regards,
Santhosh



-- 
----------------------------------------------------
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