Logo Search packages:      
Sourcecode: qps version File versions

void QtTableView::setNumRows ( int  rows  )  [protected, virtual]

Sets the number of rows of the table to rows (must be non-negative). Does not change topCell().

The table repaints itself automatically if autoUpdate() is set.

See also:
numCols(), setNumCols(), numRows()

Definition at line 272 of file qttableview.C.

References autoUpdate(), lastRowVisible(), repaint(), topCell(), and updateScrollBars().

{
    if ( rows < 0 ) {
#if defined(QT_CHECK_RANGE)
      qWarning( "QtTableView::setNumRows: (%s) Negative argument %d.",
             name( "unnamed" ), rows );
#endif
      return;
    }
    if ( nRows == rows )
      return;

    if ( autoUpdate() && isVisible() ) {
      int oldLastVisible = lastRowVisible();
      int oldTopCell = topCell();
      nRows = rows;
      if ( autoUpdate() && isVisible() &&
           ( oldLastVisible != lastRowVisible() || oldTopCell != topCell() ) )
            repaint( oldTopCell != topCell() );
    } else {
      // Be more careful - if destructing, bad things might happen.
      nRows = rows;
    }
    updateScrollBars( verRange );
    updateFrameSize();
}


Generated by  Doxygen 1.6.0   Back to index