Logo Search packages:      
Sourcecode: qps version File versions

void QtTableView::updateScrollBars ( uint  f  )  [private]

Updates the scroll bars' contents and presence to match the table's state or f.

See also:
setTableFlags()

Definition at line 1960 of file qttableview.C.

References autoUpdate(), maxViewX(), maxViewY(), maxXOffset(), maxYOffset(), setXOffset(), setYOffset(), testTableFlags(), viewHeight(), viewWidth(), xOffset(), and yOffset().

{
    sbDirty = sbDirty | f;
    if ( inSbUpdate )
      return;
    inSbUpdate = TRUE;

    if ( testTableFlags(Tbl_autoHScrollBar) && (sbDirty & horRange) ||
       testTableFlags(Tbl_autoVScrollBar) && (sbDirty & verRange) )
                              // if range change and auto
      doAutoScrollBars();           // turn scroll bars on/off if needed

    if ( !autoUpdate() ) {
      inSbUpdate = FALSE;
      return;
    }
    if ( yOffset() > 0 && testTableFlags( Tbl_autoVScrollBar ) &&
       !testTableFlags( Tbl_vScrollBar ) ) {
      setYOffset( 0 );
    }
    if ( xOffset() > 0 && testTableFlags( Tbl_autoHScrollBar ) &&
       !testTableFlags( Tbl_hScrollBar ) ) {
      setXOffset( 0 );
    }
    if ( !isVisible() ) {
      inSbUpdate = FALSE;
      return;
    }

    if ( testTableFlags(Tbl_hScrollBar) && (sbDirty & horMask) != 0 ) {
      if ( sbDirty & horGeometry )
          hScrollBar->setGeometry( 0,height() - HSBEXT,
                                     viewWidth() + frameWidth()*2,
                                   HSBEXT);

      if ( sbDirty & horSteps ) {
          if ( cellW )
            hScrollBar->setSteps( QMIN(cellW,viewWidth()/2), viewWidth() );
          else
            hScrollBar->setSteps( 16, viewWidth() );
      }

      if ( sbDirty & horRange )
          hScrollBar->setRange( 0, maxXOffset() );

      if ( sbDirty & horValue )
          hScrollBar->setValue( xOffs );

                  // show scrollbar only when it has a sane geometry
      if ( !hScrollBar->isVisible() )
          hScrollBar->show();
    }

    if ( testTableFlags(Tbl_vScrollBar) && (sbDirty & verMask) != 0 ) {
      if ( sbDirty & verGeometry )
          vScrollBar->setGeometry( width() - VSBEXT, 0,
                                     VSBEXT,
                                     viewHeight() + frameWidth()*2 );

      if ( sbDirty & verSteps ) {
          if ( cellH )
            vScrollBar->setSteps( QMIN(cellH,viewHeight()/2), viewHeight() );
          else
            vScrollBar->setSteps( 16, viewHeight() );  // fttb! ###
      }

      if ( sbDirty & verRange )
          vScrollBar->setRange( 0, maxYOffset() );

      if ( sbDirty & verValue )
          vScrollBar->setValue( yOffs );

                  // show scrollbar only when it has a sane geometry
      if ( !vScrollBar->isVisible() )
          vScrollBar->show();
    }
    if ( coveringCornerSquare &&
       ( (sbDirty & verGeometry ) || (sbDirty & horGeometry)) )
      cornerSquare->move( maxViewX() + frameWidth() + 1,
                      maxViewY() + frameWidth() + 1 );

    sbDirty = 0;
    inSbUpdate = FALSE;
}


Generated by  Doxygen 1.6.0   Back to index