Saturday, July 5th 2008, 6:13am UTC+1

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Saturday, May 17th 2008, 7:56am

QWidget hide or remove close minimize and maximize button

I've tried many things but it looks like it is not possible to do so, all i've been able to do is to disable closeevent. Any Ideas ???( if hiding the entire bar is also possible it is better )
  • Go to the top of the page

2

Saturday, May 17th 2008, 9:11am

RE: QWidget hide or remove close minimize and maximize button

try

Source code

1
2
3
4
5
void YourMainWindow::closeEvent( QCloseEvent * ev )
{
	if( data.okClose ) ev->accept();
	else               ev->ignore();
}

perhaps add a message for the user if you refuse to close

also look at
Qt::WidgetAttribute
Qt::WindowFlags
Nicolas
  • Go to the top of the page

nijish

Trainee

Posts: 154

Location: Bangalore

Occupation: Software Engineer

3

Sunday, May 18th 2008, 1:39pm

hmmm... i got the same problem sometime back. what is your package?
anyways what i did was, i had harcoded my appln to a certain resolution say 100x100. so minimize, maximize, etc became a problem. eventually i ended up using setGeometry() :D bad coding but thats what i did. entire appln bar i removed by resizing and pushing the appln to the top.
ie, do something like setGeometry(-10,-10,x,y).
  • Go to the top of the page

4

Sunday, May 18th 2008, 2:28pm

Quoted

Originally posted by nijish
hmmm... i got the same problem sometime back. what is your package?
anyways what i did was, i had harcoded my appln to a certain resolution say 100x100. so minimize, maximize, etc became a problem. eventually i ended up using setGeometry() :D bad coding but thats what i did. entire appln bar i removed by resizing and pushing the appln to the top.
ie, do something like setGeometry(-10,-10,x,y).



Well i didn't quite get what you mean, you've pushed the top widget outside the MainWindow by settin the -10, -10, but in my case the top widget is a menubar ! i've tried to set its geometry to go beyond the " title bar " but Designer didn't let me do it it has resized it to original size.


I've been working on this for day and it seems quite impossible to do so.
  • Go to the top of the page

nijish

Trainee

Posts: 154

Location: Bangalore

Occupation: Software Engineer

5

Sunday, May 18th 2008, 6:51pm

i haven't worked on designer much. and i was mentioning about the main widget, not top widget.
  • Go to the top of the page

Rate this thread