C++ (Qt)struct CNode {... int GetChildCount( void ) const; CNode * GetChild( int index ); // data int mRow, mColumn; ...};
C++ (Qt)struct CNode : public GridMan {... int GetChildCount( void ) const; CNode * GetChild( int index ); // from GridMan virtual int GetCellCount( void ) const { return GetChildCount(); } virtual int & RowAt( int index ) { return GetChild(index)->mRow; } virtual int & ColumnAt( int index ) { return GetChild(index)->mColumn; } // data int mRow, mColumn; ...};
C++ (Qt)void GridMan::SetNodePos( int index, int row, int column );