1 #ifndef __libquark_gui_Matrix_hxx 2 #define __libquark_gui_Matrix_hxx 29 Matrix(
int width = 0,
int height = 0);
42 {
return(_rows.isEmpty()); }
51 void setItemAt(
int row,
int column, T item);
104 bool isRegionEmpty(
int row,
int column,
int width,
int height)
const;
124 bool read(QDataStream &stream);
132 void write(QDataStream &stream)
const;
141 void setSize(
int rows,
int cols);
143 QList<QList<T>*> _rows;
146 #include <quark/MatrixImpl.h++> 158 matrix.
write(stream);
172 #endif // __libquark_gui_Matrix_hxx int rows() const
Returns the height of the matrix, in rows.
bool isEmpty() const
Tests if the matrix is empty.
Definition: Matrix.h++:41
Matrix(int width=0, int height=0)
Constructs a matrix with the given dimensions.
QPoint findEmptyRegion(int width, int height) const
Attempts to locate a rectangular region with the given dimensions in the matrix such that all cells i...
T getItemAt(int row, int column) const
Returns the item at the given row and column.
QDataStream & operator>>(QDataStream &stream, quark::gui::Matrix< T > &matrix)
Definition: Matrix.h++:166
A matrix data model.
Definition: Matrix.h++:19
QDataStream & operator<<(QDataStream &stream, const quark::gui::Matrix< T > &matrix)
Definition: Matrix.h++:155
Definition: BarChartView.h++:6
bool isRegionEmpty(int row, int column, int width, int height) const
Tests if the given region in the matrix contains only "empty" items.
bool read(QDataStream &stream)
Reads the matrix from a data stream.
virtual bool isEmptyValue(const T &value) const
Tests if a given item is to be considered "empty".
void insertColumns(int columnIndex, int columnCount)
Inserts new columns into the matrix.
void deleteRows(int rowIndex, int rowCount)
Deletes rows from the matrix.
int columns() const
Returns the width of the matrix, in columns.
void setItemAt(int row, int column, T item)
Sets the item at the given row and column.
void write(QDataStream &stream) const
Writes the matrix to a data stream.
void deleteColumns(int columnIndex, int columnCount)
Deletes columns from the matrix.
void insertRows(int rowIndex, int rowCount)
Inserts new rows into the matrix.