PDA

View Full Version : Docking widgets setFixedSize and setBaseSize Problem



forrestfsu
12th October 2006, 19:08
I have a few docking widgets that I would like to set the width and height of them on startup. However, if I use setBaseSize it does not work at all. I am able to use setFixedSize to get it to startup with the correct size, but then the user cannot resize the docking windows. As a partial workaround I didn't use either, instead I set the setMinimumSize to the size I wanted on startup. Yet, this still leaves the problem of not allowing the user to make the docking window any smaller then the size I specify in setMinimumSize. Is there anyway I can accomplished what I want (to start the window at a specific size, but then allow the user to modify the size however they wish)?

Thanks in advance.

wysota
13th October 2006, 22:06
You should specify the sizeHint for each of the widgets (subclass and reimplement sizeHint()). If anything is to help, this should.

forrestfsu
16th October 2006, 19:20
Thanks for the tip...it worked perfectly. Incase anybody has a similar problem, here is the solution:

In the header file:

private:
virtual QSize sizeHint () const;

In the cpp file:

QSize ClassName::sizeHint() const
{
QSize theSize(284, 300);
return theSize;
}