qt-interest@trolltech.com
[Top] [All Lists]

Re: resize() ignored!

Subject: Re: resize() ignored!
From: Shea Martin
Date: Fri, 29 Oct 2004 14:30:46 -0600
It looks like minimumSizeHint was the problem. Using setFixedHeight() instead of resize() was the workaround.
~S

Shea Martin wrote:
Initially I want Figure #1, and then when the check box is ticked, figure #3.

When the checkbox is toggled, my code shrinks or grows the main window's
height by 100 accordingly, so the result should be Figure #1 or Figure #3.
(Ignoring the case where user resizes window).

Unfortunately resize will not shrink the window past 280, whether the
groupbox is visible or not.  I CAN manually resize the window down to 150.
When I call resize(X, 180) in my constructor, and groupbox->hide(), but
when the window opens, I get Figure #2. Then ticking the checkbox gives
me Figure #4.

minimumHeight() gives 280.  I tried setting minimum height to 180, then
resizing, but nothing changed.

Any ideas, this is driving me nutz.

~S

Figure #1
 ^   +--------------------------------+
 |   |[ ] QCheckBox                   |
 |   |+------------------------------+|
 |   || QTable                       ||<--QMainWindow
 |   ||                              ||
180  ||                              ||
 |   ||                              ||
 |   |+------------------------------+|
 v   +--------------------------------+

Figure #2
 ^   +--------------------------------+
 |   |[ ] QCheckBox                   |
 |   |+------------------------------+|
 |   || QTable                       ||<--QMainWindow
 |   ||                              ||
 |   ||                              ||
 |   ||                              ||
 |   ||                              ||
280  ||                              ||
 |   ||                              ||
 |   ||                              ||
 |   ||                              ||
 |   ||                              ||
 |   ||                              ||
 |   |+------------------------------+|
 v   +--------------------------------+

Figure #3
 ^   +--------------------------------+
 |   |[x] QCheckBox                   |
 |   |+------------------------------+|
 |   || QTable                       ||<--QMainWindow
 |   ||                              ||
 |   ||                              ||
 |   ||                              ||
 |   |+------------------------------+|
280  |+--QGroupBox-------------------+|
 |   ||                              ||
 |   || internal widgets             ||
 |   ||                              ||
 |   ||                              ||
 |   ||                              ||
 |   |+------------------------------+|
 v   +--------------------------------+

Figure #4
 ^   +--------------------------------+
 |   |[x] QCheckBox                   |
 |   |+------------------------------+|
 |   || QTable                       ||<--QMainWindow
 |   ||                              ||
 |   ||                              ||
 |   ||                              ||
 |   ||                              ||
 |   ||                              ||
 |   ||                              ||
 |   ||                              ||
380  ||                              ||
 |   ||                              ||
 |   ||                              ||
 |   |+------------------------------+|
 |   |+--QGroupBox-------------------+|
 |   ||                              ||
 |   || internal widgets             ||
 |   ||                              ||
 |   ||                              ||
 |   ||                              ||
 |   |+------------------------------+|
 v   +--------------------------------+

--
List archive and information: http://lists.trolltech.com/qt-interest/

<Prev in Thread] Current Thread [Next in Thread>