ICS

QicsTable Documentation Set

HOWTO - Controlling the Size of a QicsTable Widget

The overall dimensions of a QicsTable widget can be set in two different ways.

As with any other Qt widget, absolute widget geometry may be set using methods like QWidget::setGeometry(), QWidget::setFixedWidth(), and QWidget::setFixedHeight(). In addition, you may specify the width and height of the table widget indirectly, by setting the properties "visibleRows" and "visibleColumns".

table->setVisibleRows(20);

When setVisibleRows() is called, the table computes the height of the specified number of rows, starting with the current value of the "topRow" property. This value becomes the preferred height of the main grid in the table widget.

Similarly, calling setVisibleColumns() causes the table to compute the width of the specified number of columns, starting with the current value of the "leftColumn" property. This value becomes the preferred width of the main grid in the table widget.

It is important to remember that the number of visible rows and columns does not include any frozen rows and columns. For instance, the following code will result in 12 visible rows -- the two frozen rows plus the ten "regular" rows.

table->freezeTopRows(2);
table->setVisibleRows(10);

All trademarks and copyrights on this page are properties of their respective owners.
The rest is copyright 1999-2006 Integrated Computer Solutions, Inc.