PDA

View Full Version : QMenuBar or QToolBar Logo



^NyAw^
3rd November 2009, 11:44
Hi,

I need to insert my application Logo into a QMenuBar or QToolBar but I don't find anyway to perform this.

Thanks,

high_flyer
3rd November 2009, 11:59
You can add a dummy menu, with an icon with out text, that will do nothing.

^NyAw^
3rd November 2009, 12:03
Hi,

And, if I want the logo to be shown on the right? I don't want the icon to be shown next to the other actions.

Thanks,

aamer4yu
3rd November 2009, 12:13
How about reversing the layout :rolleyes:

^NyAw^
3rd November 2009, 12:17
Hi,



How about reversing the layout :rolleyes:


Reversing the QToolBar layoutDirection layouts all icons to the right.
I just want the actions on the left side and the logo(QLabel) to the right side.
Will try adding a QSpacer.

^NyAw^
3rd November 2009, 12:53
Hi,

It's not possible to add a QSpacerItem because it not inherit from QWidget.

Any other idea?

Thanks,

high_flyer
3rd November 2009, 15:31
It's not possible to add a QSpacerItem because it not inherit from QWidget.

But QMenuBar does inherit QWidget, so you can add a spacer item to its layout.
OR
You can create a custom widget derived from QMenuBar, and override the painEevnt().