|
| Array2D () |
|
| Array2D (int rows, int cols, Type defaultValue) |
|
| Array2D (int rows, int cols) |
|
| Array2D (QSize size) |
|
const Type & | operator() (int r, int c) const |
|
Type & | operator() (int r, int c) |
|
const Type & | operator() (QPoint p) const |
|
Type & | operator() (QPoint p) |
|
void | resize (int rows, int cols) |
|
QSize | size () const |
|
int | width () const |
|
int | height () const |
|
bool | isInBounds (QPoint p) const |
| Returns true if (p.x(), p.y()) is a valid region. More...
|
|
IndexCollection | indices () const |
| indices Returns a lightweight object for iterating over all valid (x,y) pairs. More...
|
|
IndexedConstDataCollection | indexedData () const |
| indexedData Returns a lightweight object for iterating over all data in the grid that also provides indices. More...
|
|
Array2DCIterator< Type > | begin () const |
|
Array2DCIterator< Type > | end () const |
|
Array2DIterator< Type > | begin () |
|
Array2DIterator< Type > | end () |
|
Array2DCNeighborIterator< Type > | begin_neighbors (int x, int y) const |
|
Array2DCNeighborIterator< Type > | end_neighbors (int x, int y) const |
|
template<typename Type>
class Array2D< Type >
The Array2D class is basically a 2D implementation of QVector.
Usage: // Construction. arr = Array2D<YourType>(rows, cols).
// Access. arr(r,c) = obj;
It is possible to iterate through the Array2D using a for-each loop, as so: for (Type obj : array) { ... }
In the above, there is no guaranteed order of traversal.