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

Method colXPos

outdated/win/Qt3/qt3tableview.cpp:1758–1784  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1756*/
1757
1758bool QtTableView::colXPos( int col, int *xPos ) const
1759{
1760 int x;
1761 if ( col >= xCellOffs ) {
1762 if ( cellW ) {
1763 int lastVisible = lastColVisible();
1764 if ( col > lastVisible || lastVisible == -1 )
1765 return FALSE;
1766 x = (col - xCellOffs)*cellW + minViewX() - xCellDelta;
1767 } else {
1768 //##arnt3
1769 x = minViewX() - xCellDelta; // x of uppermost cell in view
1770 int c = xCellOffs;
1771 QtTableView *tw = (QtTableView *)this;
1772 int maxX = maxViewX();
1773 while ( c < col && x <= maxX )
1774 x += tw->cellWidth( c++ );
1775 if ( x > maxX )
1776 return FALSE;
1777 }
1778 } else {
1779 return FALSE;
1780 }
1781 if ( xPos )
1782 *xPos = x;
1783 return TRUE;
1784}
1785
1786
1787/*!

Callers

nothing calls this directly

Calls 1

cellWidthMethod · 0.45

Tested by

no test coverage detected