Qt-interest Archive, January 2007
QHGroupBox Layout Problem
Message 1 in thread
Using Qt 3.3.4.
I have a simple problem but cannot figure out the solution.
I have a QHGroupBox. In the group box I have a QTable and to its right I
want to place two buttons, stacked vertically.
The following code fragment does the trick:
QHGroupBox* FCDetailsGB = new QHGroupBox("Details", CW, "FCDetailsGB");
FundingClassTable = new QTable( FCDetailsGB );
QVBox* VB = new QVBox( FCDetailsGB );
QPushButton* AddRowButton = new QPushButton( "&Add", VB, "AddRowButton" );
QPushButton* DeleteRowButton = new QPushButton( "&Delete", VB, "DeleteRowButton" );
Because of the way that this QHGroupBox is positioned in the screen, it has
some extra width and this width is being allocated to the QTable. I want the
QTable to be only as wide as it needs to be for the number of columns that it
has. Therefore, I need a way to add some stretchable space on either side of
the vertical button stack. This way, the extra space is evenly allocated on
either side of the button stack, with the buttons centered, and the QTable
is only as wide as it needs to be. I've tried many things but cannot figure
it out. Is there an easy way to do this?
Thanks!
...Jake
--
[ signature omitted ]