Logo Search packages:      
Sourcecode: koffice version File versions

void QtTableView::setNumCols ( int  cols  )  [protected, virtual]

Sets the number of columns of the table to cols (must be non-negative). Does not change leftCell().

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

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

Definition at line 315 of file qttableview.cpp.

References autoUpdate(), lastColVisible(), repaint(), and updateScrollBars().

{
    if ( cols < 0 ) {
#if defined(QT_CHECK_RANGE)
      qWarning( "QtTableView::setNumCols: (%s) Negative argument %d.",
             name( "unnamed" ), cols );
#endif
      return;
    }
    if ( nCols == cols )
      return;
    int oldCols = nCols;
    nCols = cols;
    if ( autoUpdate() && isVisible() ) {
      int maxCol = lastColVisible();
      if ( maxCol >= oldCols || maxCol >= nCols )
          repaint();
    }
    updateScrollBars( horRange );
    updateFrameSize();
}


Generated by  Doxygen 1.6.0   Back to index