I get stuck with trying to determine the width of a QTableWidget in my application.

In my QTableWidget there are 5 columns. Four of them are of a fixed width and I want to make the third one take all the room that is left in the widget. I have tried to do that on the following way which did not work. So to see what happenend I put in some Line edits to make the values visible.

The sum of the width of all the columns is 477 but the width of the QTableWidget is 100?

Can somebody give me a clue what I've done wrong?


void WachtBoek::makeRemark()
{
QRect tempRect = memoryTableWidget->geometry();
int width = tempRect.width();
int sumWidth = memoryTableWidget->columnWidth( 0 ) + memoryTableWidget->columnWidth( 1 );
sumWidth = sumWidth + memoryTableWidget->columnWidth( 2 ) + memoryTableWidget->columnWidth( 3 );
sumWidth = sumWidth + memoryTableWidget->columnWidth( 4 );

QString widthStr, sumStr;
widthStr = widthStr.setNum( width );
sumStr = sumStr.setNum( sumWidth );
d301LineEdit->setText( widthStr );
d302LineEdit->setText( sumStr );
}


regards,

Giel Peters.