MCPcopy Create free account
hub / github.com/NetHack/NetHack / findRawRow

Method findRawRow

outdated/win/Qt3/qt3tableview.cpp:1575–1619  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1573
1574
1575int QtTableView::findRawRow( int yPos, int *cellMaxY, int *cellMinY,
1576 bool goOutsideView ) const
1577{
1578 int r = -1;
1579 if ( nRows == 0 )
1580 return r;
1581 if ( goOutsideView || yPos >= minViewY() && yPos <= maxViewY() ) {
1582 if ( yPos < minViewY() ) {
1583#if defined(QT_CHECK_RANGE)
1584 qWarning( "QtTableView::findRawRow: (%s) internal error: "
1585 "yPos < minViewY() && goOutsideView "
1586 "not supported. (%d,%d)",
1587 name( "unnamed" ), yPos, yOffs );
1588#endif
1589 return -1;
1590 }
1591 if ( cellH ) { // uniform cell height
1592 r = (yPos - minViewY() + yCellDelta)/cellH; // cell offs from top
1593 if ( cellMaxY )
1594 *cellMaxY = (r + 1)*cellH + minViewY() - yCellDelta - 1;
1595 if ( cellMinY )
1596 *cellMinY = r*cellH + minViewY() - yCellDelta;
1597 r += yCellOffs; // absolute cell index
1598 } else { // variable cell height
1599 QtTableView *tw = (QtTableView *)this;
1600 r = yCellOffs;
1601 int h = minViewY() - yCellDelta; //##arnt3
1602 int oldH = h;
1603 Q_ASSERT( r < nRows );
1604 while ( r < nRows ) {
1605 oldH = h;
1606 h += tw->cellHeight( r ); // Start of next cell
1607 if ( yPos < h )
1608 break;
1609 r++;
1610 }
1611 if ( cellMaxY )
1612 *cellMaxY = h - 1;
1613 if ( cellMinY )
1614 *cellMinY = oldH;
1615 }
1616 }
1617 return r;
1618
1619}
1620
1621
1622int QtTableView::findRawCol( int xPos, int *cellMaxX, int *cellMinX ,

Callers

nothing calls this directly

Calls 1

cellHeightMethod · 0.60

Tested by

no test coverage detected