PDA

View Full Version : Disable the minimize, maximize,close buttons



qtlinuxnewbie
22nd February 2010, 13:31
hi,

i need to disable the window's maximize , minimize, close buttons in my app...
can any one, have any idea ?
any little help, could be appreciated.

@qtlinuxnewbie

high_flyer
22nd February 2010, 14:05
see window flags, and widget attributes.

qtlinuxnewbie
23rd February 2010, 04:01
i have already gone through the window flags but i dint get anything out of it..

Could u mention in specific,....

@qtlinuxnewbie

BalaQT
23rd February 2010, 07:21
hi,
u can use

setWindowFlags(Qt::FramelessWindowHint);
hope it helps
Bala

qtlinuxnewbie
23rd February 2010, 08:07
@Bala

Thnk you for ur snippet
it worked well . and the buttons are not visible.
But the buttons should be visible in disable mode.
Is it possible ?

@qtlinuxnewbie

high_flyer
23rd February 2010, 08:25
if(pWindow->isEnabled()){
pWindow->setWindowFlags(Qt::FramelessWindowHint);
}else {
pWindow->setWindowFlags(Qt::Window);
}

spirit
23rd February 2010, 08:30
I don't think that you can achieve this by standard Qt's methods.
you can use such flags combination, but no minimize & maximize buttons will be not visible.


Qt::Window
| Qt::WindowTitleHint
| Qt::WindowSystemMenuHint
| Qt::CustomizeWindowHint

BalaQT
23rd February 2010, 10:17
Try the following flag


setWindowFlags(Qt::WindowTitleHint);

This show only the titlebar without min,max,close button
hope it helps
Bala

BalaQT
25th February 2010, 09:28
have u tried qtlinuxnewbie?

Bala

qtlinuxnewbie
25th February 2010, 09:33
setWindowFlags(Qt::Window | Qt::WindowTitleHint | Qt::CustomizeWindowHint);

@bala :this is what i have used:


@qtlinuxnewbie

qtlinuxnewbie
25th February 2010, 10:18
Thnk u all .. my problem solved

@qtlinuxnewbie