PDA

View Full Version : QMenuBar's CornerWidget hides on maximizing QMdiSubWindow



vaibhav
3rd May 2011, 15:57
Hi,
I have QMainwindow with QMenubar to which I have added the QcomboBox as cornerwidget.

pMenuBar->setCornerWidget(pComboBox);

I have QMdiArea whose parent is QMainwindow and I have set this QMdiArea to its central widget.

mdi=new QMdiArea(this);
setCentralWidget( mdi );

Then I created QMdiSubWindow window.
QMdiSubWindow *midsubWindow= mdi->addSubWindow(Qwidget);

The application looks fine when the QMdiSubWindow is not Maximized (see Image.png)

But the moment I Maximize the QMdiSubWindow it Hides the Combobox that I have set on QMenubar as Corner widget(see maximize.png ).

I tried everything in my application but it looks like QT does not allow this.

Attached are the two images which shows the scenario.

Any help would be appreciated.

Thanks.

high_flyer
4th May 2011, 08:43
One option would be to move the combobox to the left of the system buttons when you maximize.

P.S
Don't urge people to look at your posts per PM.
Its against the rules and is just plain rude.

nish
4th May 2011, 11:57
please report a bug to nokia as well... may be they will give some attention to desktop then

high_flyer
4th May 2011, 12:45
You could also try using QMenuBar::setCornerWidget().
This will place your combobox not at the far right, but after the last menu item.
Another thing I would try would be to create a cusotom widget which would have the combobox and a spacer and set a horizontal layout as the main layout for that widget, and set that custom widget with setCornerWidget().
|-----|<combobox>
This way the the combobox will always be at the right most position on the menubar, but it should move to the left of the system buttons once they apear, and take their place when they disappear.


please report a bug to nokia as well
Why do you think its a bug?

vaibhav
4th May 2011, 14:29
At first instance only i used setcornerWidget.:)

I guess it hides on maximize coz datz how its wriiten in qMdiSubWindow.cpp .(I checked it )

So i called the slot on OnMAximize() signal of QMDISUBWINDOW and shown my comboBox manually.

It worked but still QMdisubwindows title bar buttons overlapped with the combobox.

So i overrided the paintevent() and there i subtracted the QMainwindow width -QMdSubWwindowWidth-comboboxwith to get the xPos of combox so that it wont overlapp .

It works fine now.

So possibly its a bug.

Possibly Its a Bug.

Added after 27 minutes:

Possibly a Bug.

nish
6th May 2011, 10:51
Why do you think its a bug?
lets say its an undocumented feature :D