Re: Half-resizable window
You can set both the minimum and maximum width to the same value.
LE: i have tried setFixedWidth and it works as expected with SDK 1.1 on Windows 7.
Re: Half-resizable window
I've tried it : setMaximumWidth(630); setMinimumWidth(630);
The window gets the size I want but the recize button of the tittle bar is still disabled.
To be clearer I want that when the user click on this button, the window's width stays at 630px but the heigth be miximized.
Re: Half-resizable window
My bad - i didn't understood what you meant by "auto-resize" and "resize button" - but i don't think that is possible to keep that button usable with one fixed size, that maximize button is for maximizing the window on both directions, not on only on one.
But your users can manually drag the margin of the window to "maximize" it on only one direction, isn't it acceptable?
Re: Half-resizable window
Sorry my bad about the vocabulary.
The user definitively can drag the vertical margin only ; but I really think it would be more powerfull if you let him mawimize it in one click.
I'm just begining with Qt, i'm not sure of what's possible and what's not.
If anymore idea, it's welcome.
Added after 1 19 minutes:
I found a solution for the one who finf the same proble :
resize(630, 380);
setFixedWidth(630);
setWindowFlags( (windowFlags() | Qt::CustomizeWindowHint));
The flags enable the Maximize button, and respect the limited width.
Re: Half-resizable window
Quote:
Originally Posted by
evergreen
I found a solution for the one who finf the same proble :
resize(630, 380);
setFixedWidth(630);
setWindowFlags( (windowFlags() | Qt::CustomizeWindowHint));
The flags enable the Maximize button, and respect the limited width.
be sure to check it on other OS and systems, window flags are known to work differently on different systems.
Re: Half-resizable window
Also I've some experiance with this.
You should also do this on the init of the form.
int maxSize = this->sizeHint().height();
this->setMinimumHeight(maxSize);
this->setMaximumHeight(maxSize);
This is because the Idea min height is different depending on the OS's.
This ensures that you get the appropriate minimum height befor the end user sees the form.
Re: Half-resizable window
Thanks dholliday,
that's what I was looking for, even if a simpler call in Qt API would be nice.
Regards
Gianni