#include <QicsGrid.h>
Inherits Qics.
Inherited by QicsPrintGrid, and QicsScreenGrid.
Public Types | |
| enum | QicsWideKeyAction { Del_DeleteSelected, CtrlA_SelectAll, CtrlC_Copy, CtrlV_Paste, CtrlX_Cut } |
| enum | QicsBoxBorders { TopBorder = 1, BottomBorder = 2, LeftBorder = 4, RightBorder = 8, AllBorders = 1+2+4+8 } |
| enum | QicsCopyPolicy { CopyData = 1, CopyAttributes = 2, CopyDimensions = 4, CopySpans = 8, CopyAll = 1+2+4+8 } |
| enum | QicsClearPolicy { ClearData = 1, ClearAttributes = 2, ClearSpans = 4, ClearAll = 1+2+4 } |
| enum | QicsSortMode { QicsStableSort = 0, QicsQuickSort } |
| enum | QicsCellOverflowBehavior { Clip = 0, Overflow, ToolTip } |
| enum | QicsCurrentCellStyle { Spreadsheet = 0, NormalSelected } |
| enum | QicsSelectionStyle { Normal = 0, Exclusive } |
| enum | QicsSelectCurrentCellPolicy { Follow = 0, Static } |
| enum | QicsFillHandleEventType { FillHandlePressed = 0, FillHandleReleased, FillHandleDoubleClicked, FillHandleDragged } |
| enum | QicsGridCellClipping { AllowPartial = 0, NoDisplayOnPartial, UseClippedSymbol } |
| enum | QicsGridType { TableGrid = 0, RowHeaderGrid, ColumnHeaderGrid } |
| enum | QicsHeaderType { RowHeader = 0, ColumnHeader } |
| enum | QicsIndexType { NoIndex = 0, RowIndex, ColumnIndex, RowAndColumnIndex } |
| enum | QicsLineStyle { None = 0, Plain, Raised, Sunken } |
| enum | QicsRepaintBehavior { RepaintOff = 0, RepaintOn = 1, RepaintCalcOnly = 2 } |
| enum | QicsScrollBarMode { Auto = 0, AlwaysOff, AlwaysOn } |
| enum | QicsScrollDirection { ScrollNone = 0, ScrollUp = 1, ScrollDown = 2, ScrollLeft = 4, ScrollRight = 8, ScrollToRow = 16, ScrollToColumn = 32 } |
| enum | QicsSelectionPolicy { SelectNone = 0, SelectSingle, SelectMultiple, SelectSingleRow, SelectMultipleRow } |
| enum | QicsSelectionType { SelectionNone = 0, SelectionBegin, SelectionDrag, SelectionEnd, SelectionExtend, SelectionAdd, SelectionReplace } |
| enum | QicsSortOrder { Ascending = 0, Descending } |
| enum | QicsTableDisplayOption { DisplayNever = 0, DisplayAlways, DisplayFirstPage } |
| enum | QicsTraversalKeyEditBehavior { TraverseWithinCell = 0, TraverseBetweenCells } |
| enum | QicsCurrentCellDraggingPolicy { DragCurrent = 0, DragSelection } |
| enum | QicsCellWidthMode { NoChange = 0, ChangeOnlyHeight, ChangeHeightWidth } |
| enum | QicsCellDecorationStyle { Flat = 0, Styled = 1 } |
| enum | QicsHeaderDragStyle { SimpleDrag = 0, StyledDrag = 1 } |
| enum | QicsAutoFitMode { Native = 0, Excel } |
Public Member Functions | |
| QicsGrid (QicsGridInfo &info, int top_row=0, int left_column=0) | |
| virtual | ~QicsGrid () |
| QicsGridInfo & | gridInfo (void) const |
| virtual void | setViewport (const QicsRegion ®) |
| virtual QicsRegion | viewport (void) const |
| virtual QicsRegion | currentViewport (void) const |
| QicsRegion | screenViewport (void) const |
| bool | isCellValid (int row, int col) const |
| QRect | cellDimensions (int row, int col, bool with_spans) const |
| QRect | cellDimensions (const QicsICell &cell, bool with_spans) const |
| int | modelColumnIndex (int column) const |
| int | modelRowIndex (int row) const |
| virtual void | orderRowsBy (const QVector< int > &columns, QicsSortOrder order=Qics::Ascending, DataItemComparator func=0) |
| virtual void | orderColumnsBy (const QVector< int > &rows, QicsSortOrder order=Qics::Ascending, DataItemComparator func=0) |
Static Public Attributes | |
| static const int | QicsLAST_ROW = INT_MAX-1 |
| static const int | QicsLAST_COLUMN = INT_MAX-1 |
Protected Member Functions | |
| QicsDataModel * | dataModel (void) const |
| QicsStyleManager & | styleManager (void) const |
| QicsDimensionManager & | dimensionManager (void) const |
| QicsMappedDimensionManager & | mappedDM (void) const |
| QicsSelectionManager & | selectionManager (void) const |
| virtual QRect | drawRegion (const QicsRegion ®ion, QPainter *painter, bool drawCellBordersOnly) |
| virtual void | drawGridLines (const QicsRegion ®, QPainter *painter) |
| virtual QRect | drawCell (int row, int col, int x, int y, bool look_for_overflower, QPainter *painter, bool drawBorderOnly) |
| virtual QRect | drawCell (int row, int col, QRect rect, QPainter *painter, bool drawCellBordersOnly) |
| virtual bool | prepareToDraw (int row, int col, const QRect &rect, QPainter *painter) |
| virtual const QicsDataItem * | cellValue (int row, int col) const |
| QicsICell | computeCellPositions (const QRect &bounds, const QicsICell &start, Qics::QicsIndexType indexType=Qics::RowAndColumnIndex) |
| QicsCellDisplay * | cellDisplay (int row, int col) const |
| virtual const QRect | boundRect () const |
Protected Attributes | |
| QicsGridInfo & | myInfo |
| QicsRegion | myViewport |
| QicsPositionList | myRowPositions |
| QicsPositionList | myColumnPositions |
| QicsICellQVL | myAlreadyDrawnCells |
| QicsMainGrid * | myMainGrid |
| QicsCell * | myCell |
| QicsRow * | myRow |
| QicsColumn * | myColumn |
| int | myTopRow |
| int | myLeftColumn |
| int | myBottomRow |
| int | myFullyVisibleBottomRow |
| int | myRightColumn |
| int | myFullyVisibleRightColumn |
| int | myExSelLeft |
| int | myExSelRight |
| int | myExSelTop |
| int | myExSelBottom |
| int | myTraversalRow |
| int | myTraversalColumn |
QicsGrid is used to display information in a grid format. The grid object is responsible for laying out the cells based on a given rectangle and based on various properties that are stored in the QicsStyleManager. The grid draws only the lines between the cells, the cells themselves are drawn by the appropriate QicsCellDisplay object.
Most users of the QicsTable product should not need to create or modify QicsGrid objects directly. The QicsTable widget automatically creates the necessary grid objects when needed. One instance where a user may need to modify a grid is to change the mouse and/or keyboard behavior of the grids. In this case, please look at QicsScreenGrid and its subclasses.
It is important to note that QicsGrid is not a widget. It is equally capable of layout for a widget or for a printer, and serves as a superclass for both purposes. See QicsScreenGrid for the grid widget hierarchy, or see QicsPrintGrid for grid printing.
enum Qics::QicsWideKeyAction [inherited] |
Denotes global key actions available for the table grid.
enum Qics::QicsBoxBorders [inherited] |
Denotes the box borders of cell region.
enum Qics::QicsCopyPolicy [inherited] |
Denotes the copying policy during copy/paste and drag/drop operations.
enum Qics::QicsClearPolicy [inherited] |
Denotes the clearing policy during cut and delete operations.
enum Qics::QicsSortMode [inherited] |
Denotes the sort algorithm which is used.
enum Qics::QicsCellOverflowBehavior [inherited] |
Denotes the behavior of grids when handling cells whose contents cannot be displayed in the boundaries of the cell.
enum Qics::QicsCurrentCellStyle [inherited] |
Denotes the visual style that the current cell of the table will be drawn with.
enum Qics::QicsSelectionStyle [inherited] |
enum Qics::QicsSelectCurrentCellPolicy [inherited] |
enum Qics::QicsGridCellClipping [inherited] |
Denotes the policy for displaying text that is too long to fit in its cell.
enum Qics::QicsGridType [inherited] |
Specifies a type of grid object.
enum Qics::QicsHeaderType [inherited] |
Specifies the type of table header.
enum Qics::QicsIndexType [inherited] |
Specifies the type of table index.
enum Qics::QicsLineStyle [inherited] |
Denotes the style of lines and borders in the table widget.
enum Qics::QicsRepaintBehavior [inherited] |
Specifies the recalculation and repainting behavior of tables and grids.
enum Qics::QicsScrollBarMode [inherited] |
enum Qics::QicsScrollDirection [inherited] |
Denotes a direction for scrolling operations, or that an absolute scroll should occur.
enum Qics::QicsSelectionPolicy [inherited] |
Denotes the selection policy for the table.
enum Qics::QicsSortOrder [inherited] |
Specifies whenever ordering should be ascending or descending.
enum Qics::QicsTableDisplayOption [inherited] |
Specifies a printing display policy for elements of the table.
enum Qics::QicsTraversalKeyEditBehavior [inherited] |
Specifies the behavior of the traversal keys. (left, right, up, down, etc) while editing a cell.
enum Qics::QicsCurrentCellDraggingPolicy [inherited] |
Specifies the behavior of drag&drop operations when it has began from current cell.
enum Qics::QicsCellWidthMode [inherited] |
Specifies the behavior of set cell font.
enum Qics::QicsCellDecorationStyle [inherited] |
Specifies the cell decoration style for headers.
enum Qics::QicsHeaderDragStyle [inherited] |
Specifies row/column drag style for headers.
enum Qics::QicsAutoFitMode [inherited] |
Specifies autofit modes.
| QicsGrid::QicsGrid | ( | QicsGridInfo & | info, | |
| int | top_row = 0, |
|||
| int | left_column = 0 | |||
| ) |
Constructor for the class.
| info | used for style and dimension information, as well as the associated data model. |
| virtual QicsGrid::~QicsGrid | ( | ) | [virtual] |
The destructor
| QicsGridInfo& QicsGrid::gridInfo | ( | void | ) | const [inline] |
Returns the grid info object associated with the grid.
Referenced by QicsScreenGrid::currentCell(), and QicsScreenGrid::setCurrentCell().
| virtual void QicsGrid::setViewport | ( | const QicsRegion & | reg | ) | [virtual] |
Restricts the grid to show a subset of the data model values. reg specifies an area of the table that is allowed to be displayed.
Reimplemented in QicsScreenGrid.
| virtual QicsRegion QicsGrid::viewport | ( | void | ) | const [virtual] |
Returns the current viewport of the grid. The viewport specifies an area of the table that is allowed to be displayed.
| virtual QicsRegion QicsGrid::currentViewport | ( | void | ) | const [virtual] |
Computes the intersection of the data model dimensions and the viewport dimensions. Because the current viewport can contain values that greater than the number of rows and columns in the data model, it is often necessary for the grid to determine the current viewport.
Reimplemented in QicsHeaderGrid.
| QicsRegion QicsGrid::screenViewport | ( | void | ) | const [inline] |
| bool QicsGrid::isCellValid | ( | int | row, | |
| int | col | |||
| ) | const |
Returns true if the cell (row, col ) is within the current viewport, false otherwise.
| QRect QicsGrid::cellDimensions | ( | int | row, | |
| int | col, | |||
| bool | with_spans | |||
| ) | const |
Returns a rectangle specifying the current location and dimension of cell (row, col ). If with_spans is true, the cell dimension will include any cells that this cell spans. If the cell is not currently on the screen, the rectangle will be invalid.
| QRect QicsGrid::cellDimensions | ( | const QicsICell & | cell, | |
| bool | with_spans | |||
| ) | const [inline] |
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
References QicsICell::column(), and QicsICell::row().
| int QicsGrid::modelColumnIndex | ( | int | column | ) | const |
This method should be called only by QicsCellDisplay objects when trying to draw a cell. If the contents of the cell are too large to fit in the cell, the cell display object may ask to overflow into the next cell.
| cur_area | the visual coordinates of the cell. | |
| cur_rect | the current screen coordinates of the region. | |
| new_area | the region we are allowed to draw into. | |
| new_rect | the screen coordinates of that region. |
Returns the physical column index into the data model for a given visual column
| int QicsGrid::modelRowIndex | ( | int | row | ) | const |
Returns the physical row index into the data model for a given visual row
| virtual void QicsGrid::orderRowsBy | ( | const QVector< int > & | columns, | |
| QicsSortOrder | order = Qics::Ascending, |
|||
| DataItemComparator | func = 0 | |||
| ) | [virtual] |
Reorder the presentation of the rows of a data model based on a columns. Note that the data model itself is not changed, only the presentation order shown in this grid and its slaves.
| columns | the column to sort on | |
| order | sort direction | |
| func | user defined comparator function. |
Reimplemented in QicsScreenGrid.
| virtual void QicsGrid::orderColumnsBy | ( | const QVector< int > & | rows, | |
| QicsSortOrder | order = Qics::Ascending, |
|||
| DataItemComparator | func = 0 | |||
| ) | [virtual] |
Reorder the presentation of the columns of the data model based on a rows. See orderRowsBy for usage description.
Reimplemented in QicsScreenGrid.