| 314 | */ |
| 315 | |
| 316 | void QtTableView::setNumCols( int cols ) |
| 317 | { |
| 318 | if ( cols < 0 ) { |
| 319 | #if defined(QT_CHECK_RANGE) |
| 320 | qWarning( "QtTableView::setNumCols: (%s) Negative argument %d.", |
| 321 | name( "unnamed" ), cols ); |
| 322 | #endif |
| 323 | return; |
| 324 | } |
| 325 | if ( nCols == cols ) |
| 326 | return; |
| 327 | int oldCols = nCols; |
| 328 | nCols = cols; |
| 329 | if ( autoUpdate() && isVisible() ) { |
| 330 | int maxCol = lastColVisible(); |
| 331 | if ( maxCol >= oldCols || maxCol >= nCols ) |
| 332 | repaint(); |
| 333 | } |
| 334 | updateScrollBars( horRange ); |
| 335 | updateFrameSize(); |
| 336 | } |
| 337 | |
| 338 | |
| 339 | /*! |
nothing calls this directly
no outgoing calls
no test coverage detected