PDA

View Full Version : How to disable 3 controls on the main application



sarode
30th January 2007, 08:08
Hello Everyone..

I have question here? I want to disable controll
s like mimimize, maximize and exit buttons on the title bar of the application and i could remove atleat 2 of them correctly. but finding difficulty further. Is there any way to do this and my title bar should look with only caption on it. Any help? Thanks in advance!!

aamer4yu
30th January 2007, 08:16
I dont know how this works..
but it works...


QMainWindow window(0,Qt::WindowTitleHint);
window.setWindowTitle("Hello abc");
window.show();


By the way what workaround you tried ? I would like to know

sarode
30th January 2007, 08:24
Hi...

I tried on QWidget by setting the fixed size for the widget something like this..



QWidget w;
w.setFixedSize(int x, int y)


This is will diable the maximize contoll on the application...

In the same way i want then not be visible on the title bar

wysota
30th January 2007, 08:58
Which Qt version are you using?

sarode
30th January 2007, 09:49
Using Qt 3.3.3 version on X11

aamer4yu
30th January 2007, 10:05
by the way,
isnt QMainWindow window(0,Qt::WindowTitleHint); working for you ?

sarode
30th January 2007, 10:45
Your option code is not working with Qt 4. I want this to done on Qt 3 and now i am checking in both version of Qt.

aamer4yu
30th January 2007, 12:24
I dont know abt Qt 3,
I am using Qt 4.2
But I am just setting the windows flags of the QMainWindow constructor.
I see the Qt 3 version has const char* as second parameter.


Q3MainWindow::Q3MainWindow ( QWidget * parent = 0, const char * name = 0, Qt::WindowFlags f = Qt::WType_TopLevel )

Just set the Qt::WindowTitleHint parameter for Qt::WindowsFlags

vermarajeev
30th January 2007, 13:09
You can use a QtoolBar instead of a widget. The QToolBar inherits QDockWindow... There you can provide a close button if you want......

Hope this helps

wysota
30th January 2007, 13:37
Try passing Qt::WStyle_Customize|Qt::WStyle_Title. I doubt you'll be able to get rid of the close button this way, but you might try.