Logo Search packages:      
Sourcecode: koffice version File versions

int QtTableView::lastRowVisible (  )  const [protected]

Returns the index of the last (bottom) row in the view. The index of the first row is 0.

If no rows are visible it returns -1. This can happen if the view is too small for the first row and Tbl_cutCellsV is set.

See also:
lastColVisible()

Definition at line 1001 of file qttableview.cpp.

References maxViewY(), and testTableFlags().

Referenced by rowYPos(), and setNumRows().

{
    int cellMaxY;
    int row = findRawRow( maxViewY(), &cellMaxY );
    if ( row == -1 || row >= nRows ) {          // maxViewY() past end?
      row = nRows - 1;              // yes: return last row
    } else {
      if ( testTableFlags(Tbl_cutCellsV) && cellMaxY > maxViewY() ) {
          if ( row == yCellOffs )         // cut by right margin?
            return -1;              // yes, nothing in the view
          else
             row = row - 1;               // cut by margin, one back
      }
    }
    return row;
}


Generated by  Doxygen 1.6.0   Back to index