A grid view consists of a number of abstract cells organized in rows and columns. The cells have a fixed size and are identified with a row index and a column index. The top-left cell is in row 0, column 0. The bottom-right cell is in row numRows()-1, column numCols()-1.
.PP
You can define numRows, numCols, cellWidth and cellHeight. Reimplement the pure virtual function paintCell() to draw the contents of a cell.
.PP
With ensureCellVisible(), you can ensure a certain cell is visible. With rowAt() and columnAt() you can find a cell based on the given x- and y-coordinates.
.PP
If you need to monitor changes to the grid's dimensions (i.e. when numRows or numCols is changed), reimplement the dimensionChange() change handler.
.PP
Note: the row and column indices are always given in the order, row (vertical offset) then column (horizontal offset). This order is the opposite of all pixel operations, which are given in the order x (horizontal offset), y (vertical offset).
TQGridView is a very simple abstract class based on TQScrollView. It is designed to simplify the task of drawing many cells of the same size in a potentially scrollable canvas. If you need rows and columns with different sizes, use a TQTable instead. If you need a simple list of items, use a TQListBox. If you need to present hierachical data use a TQListView, and if you need random objects at random positions, consider using either a TQIconView or a TQCanvas.
Returns the geometry of a cell in a cell's coordinate system. This is a convenience function useful in paintCell(). It is equivalent to TQRect( 0, 0, cellWidth(), cellHeight() ).
This change handler is called whenever any of the grid's dimensions change. \fIoldNumRows\fR and \fIoldNumCols\fR contain the old dimensions, numRows() and numCols() contain the new dimensions.
This pure virtual function is called to paint the single cell at (\fIrow\fR, \fIcol\fR) using painter \fIp\fR. The painter must be open when paintCell() is called and must remain open.
.PP
The coordinate system is translated so that the origin is at the top-left corner of the cell to be painted, i.e. \fIcell\fR coordinates. Do not scale or shear the coordinate system (or if you do, restore the transformation matrix before you return).
.PP
The painter is not clipped by default in order to get maximum efficiency. If you want clipping, use
This function fills the \fIcw\fR pixels wide and \fIch\fR pixels high rectangle starting at position (\fIcx\fR, \fIcy\fR) with the background color using the painter \fIp\fR.
.PP
paintEmptyArea() is invoked by drawContents() to erase or fill unused areas.