Q3TableSelection Class

The Q3TableSelection class provides access to a selected area in a Q3Table . 更多...

头: #include <Q3TableSelection>

公共函数

Q3TableSelection ()
Q3TableSelection (int start_row , int start_col , int end_row , int end_col )
int anchorCol () const
int anchorRow () const
int bottomRow () const
void expandTo (int row , int col )
void init (int row , int col )
bool isActive () const
bool isEmpty () const
int leftCol () const
int numCols () const
int numRows () const
int rightCol () const
int topRow () const
bool operator!= (const Q3TableSelection & s ) const
bool operator== (const Q3TableSelection & s ) const

详细描述

The Q3TableSelection class provides access to a selected area in a Q3Table .

The selection is a rectangular set of cells in a Q3Table . One of the rectangle's cells is called the anchor cell; this is the cell that was selected first. The init () function sets the anchor and the selection rectangle to exactly this cell; the expandTo () function expands the selection rectangle to include additional cells.

There are various access functions to find out about the area: anchorRow () 和 anchorCol () return the anchor's position; leftCol (), rightCol (), topRow () 和 bottomRow () return the rectangle's four edges. All four are part of the selection.

A newly created Q3TableSelection is inactive -- isActive () returns false. You must use init () 和 expandTo () to activate it.

Q3Table::selectCells () Q3Table::selectRow () Q3Table::selectColumn ()

另请参阅 Q3Table , Q3Table::addSelection (),和 Q3Table::selection ().

成员函数文档编制

Q3TableSelection:: Q3TableSelection ()

Creates an inactive selection. Use init () 和 expandTo () to activate it.

Q3TableSelection:: Q3TableSelection ( int start_row , int start_col , int end_row , int end_col )

Creates an active selection, starting at start_row and start_col , ending at end_row and end_col .

int Q3TableSelection:: anchorCol () const

Returns the anchor column of the selection.

另请参阅 anchorRow () 和 expandTo ().

int Q3TableSelection:: anchorRow () const

Returns the anchor row of the selection.

另请参阅 anchorCol () 和 expandTo ().

int Q3TableSelection:: bottomRow () const

Returns the bottom row of the selection.

另请参阅 topRow (), leftCol (),和 rightCol ().

void Q3TableSelection:: expandTo ( int row , int col )

Expands the selection to include cell row , col . The new selection rectangle is the bounding rectangle of row , col and the previous selection rectangle. After calling this function the selection is active.

If you haven't called init (), this function does nothing.

另请参阅 init () 和 isActive ().

void Q3TableSelection:: init ( int row , int col )

Sets the selection anchor to cell row , col and the selection to only contain this cell. The selection is not active until expandTo () 被调用。

To extend the selection to include additional cells, call expandTo ().

另请参阅 isActive ().

bool Q3TableSelection:: isActive () const

Returns whether the selection is active or not. A selection is active after init () and expandTo () have been called.

bool Q3TableSelection:: isEmpty () const

Returns whether the selection is empty or not.

另请参阅 numRows () 和 numCols ().

int Q3TableSelection:: leftCol () const

Returns the left column of the selection.

另请参阅 topRow (), bottomRow (),和 rightCol ().

int Q3TableSelection:: numCols () const

Returns the number of columns in the selection.

另请参阅 numRows ().

int Q3TableSelection:: numRows () const

Returns the number of rows in the selection.

另请参阅 numCols ().

int Q3TableSelection:: rightCol () const

Returns the right column of the selection.

另请参阅 topRow (), bottomRow (),和 leftCol ().

int Q3TableSelection:: topRow () const

Returns the top row of the selection.

另请参阅 bottomRow (), leftCol (),和 rightCol ().

bool Q3TableSelection:: operator!= (const Q3TableSelection & s ) const

返回 true 若 s does not include the same cells as the selection; otherwise returns false.

bool Q3TableSelection:: operator== (const Q3TableSelection & s ) const

返回 true 若 s includes the same cells as the selection; otherwise returns false.