Logo Search packages:      
Sourcecode: qps version File versions

void QtTableView::clearTableFlags ( uint  f = ~0  )  [protected]

Clears the table flags that are set in f.

Example (clears a single flag):

    clearTableFlags( Tbl_snapToGrid );

The default argument clears all flags.

See also:
setTableFlags(), testTableFlags(), tableFlags()

Definition at line 846 of file qttableview.C.

References autoUpdate(), maxXOffset(), maxYOffset(), repaint(), setAutoUpdate(), setHorScrollBar(), setOffset(), setVerScrollBar(), snapToGrid(), and updateScrollBars().

{
    f = (f ^ ~tFlags) & f;          // clear flags that are already 0
    tFlags &= ~f;

    bool updateOn = autoUpdate();
    setAutoUpdate( FALSE );

    uint repaintMask = Tbl_cutCellsV | Tbl_cutCellsH;

    if ( f & Tbl_vScrollBar ) {
      setVerScrollBar( FALSE );
    }
    if ( f & Tbl_hScrollBar ) {
      setHorScrollBar( FALSE );
    }
    if ( f & Tbl_scrollLastHCell ) {
      int maxX = maxXOffset();
      if ( xOffs > maxX ) {
          setOffset( maxX, yOffs );
          repaintMask |= Tbl_scrollLastHCell;
      }
      updateScrollBars( horRange );
    }
    if ( f & Tbl_scrollLastVCell ) {
      int maxY = maxYOffset();
      if ( yOffs > maxY ) {
          setOffset( xOffs, maxY );
          repaintMask |= Tbl_scrollLastVCell;
      }
      updateScrollBars( verRange );
    }
    if ( f & Tbl_smoothScrolling ) {            // Note: checks for 2 flags
      if ((f & Tbl_smoothHScrolling) != 0 && xCellDelta != 0 ||//must scroll?
          (f & Tbl_smoothVScrolling) != 0 && yCellDelta != 0 ) {
          snapToGrid( (f & Tbl_smoothHScrolling) != 0,      // do snapping
                  (f & Tbl_smoothVScrolling) != 0 );
          repaintMask |= Tbl_smoothScrolling;              // repaint table
      }
    }
    if ( f & Tbl_snapToHGrid ) {
      updateScrollBars( horRange );
    }
    if ( f & Tbl_snapToVGrid ) {
      updateScrollBars( verRange );
    }
    if ( updateOn ) {
      setAutoUpdate( TRUE );
      updateScrollBars();          // returns immediately if nothing to do
      if ( isVisible() && (f & repaintMask) )
          repaint();
    }

}


Generated by  Doxygen 1.6.0   Back to index