PDA

View Full Version : Button on the Upper Right Corner of MainWindow?



vishal.chauhan
12th March 2008, 05:00
Hi All,

I am working on QT 4.3.3 on my MAC.
I have a QMainWindow on which I have a button on the upper right corner by default on my MAC (Actually I does not know what the button is called).

I want to hide that button so how should I do it.

Thanks.

wysota
12th March 2008, 07:40
What happens when you click the button? :) Does by any chance the dialog get closed?

vishal.chauhan
12th March 2008, 08:29
No The Dialog doesnot close.
generally it hides the toolbar but in my case it actually reduce the height of the mainWindow and when I again click it add some space to the main window.

wysota
12th March 2008, 08:37
Do you have a toolbar? Even if you think you don't, it might be there - it might simply be empty.

vishal.chauhan
12th March 2008, 08:42
yes I have a toolbar.
But in my case it is not hiding the toolbar it increases or decreases the height of QMainWindow.

wysota
12th March 2008, 09:00
How did you add the toolbar to the main window?

vishal.chauhan
12th March 2008, 09:30
I have just added the toolbar from the Designer and set the movable property to false.

wysota
12th March 2008, 10:00
And the button does something else than it should, correct? Can you verify that it works correctly for examples bundled with Qt?

vishal.chauhan
12th March 2008, 10:06
I can not veriy.
But in qt examples it doesnot increases or decreases the height of QMainWindow still it hides and show the toolbar.

So It is possible to hide the button.

wysota
12th March 2008, 10:12
I can not veriy.
What do you mean? You can't run the examples or the button doesn't work?


But in qt examples it doesnot increases or decreases the height of QMainWindow still it hides and show the toolbar.
Hmm... now I'm confused. So does it work or not?


So It is possible to hide the button.
If you found an application that hides the button, then just look into its sources - it probably passes some WindowFlag to the widget's constructor.

vishal.chauhan
12th March 2008, 10:47
Seeing into the Examples it only comes when the tool bar is added to the mainwindow.
If even I hide the toolbar then button is coming but it does not do any work.
so it is related to the toolbar but in example it does not hide when toolbar is coming.