#include <QicsGridInfo.h>
Inherits QObject, and Qics.
Public Types | |
| typedef QVector< QicsScreenGrid * > | QicsScreenGridPV |
| 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 Slots | |
| void | deleteRows (int how_many, int starting_position) |
| void | insertRow (int where) |
| void | moveRows (int target, const QVector< int > &rows) |
| void | moveColumns (int target, const QVector< int > &cols) |
| void | deleteColumns (int how_many, int starting_position) |
| void | insertColumn (int where) |
| void | redrawAllGrids () |
| void | updateAllGrids (bool redraw) |
| void | redrawAllGrids (Qics::QicsIndexType indexType) |
| virtual void | redrawModel (const QicsRegion &r, bool model=true) |
| virtual void | setCellValue (int row, int col, const QicsDataItem &itm) |
| virtual void | setCurrentCellValue (const QicsDataItem &itm) |
| void | setIgnoreModelSizeChanges (bool b) |
| void | setAllowPropagateChanges (bool b) |
| void | setAutoHeaderNamingMask (QString mask) |
| void | setHeaderDragStyle (const QicsHeaderDragStyle &style) |
Signals | |
| void | dataModelChanged (QicsDataModel *old_dm, QicsDataModel *new_dm) |
| void | styleManagerChanged (QicsStyleManager *old_sm, QicsStyleManager *new_sm) |
| void | dimensionManagerChanged (QicsDimensionManager *old_dm, QicsDimensionManager *new_dm) |
| void | selectionManagerChanged (QicsSelectionManager *old_sm, QicsSelectionManager *new_sm) |
| void | gridAdded (QicsScreenGrid *grid) |
| void | gridRemoved (QicsScreenGrid *grid) |
| void | globalSetRepaintBehaviorRequest (QicsRepaintBehavior behavior) |
| void | globalRevertRepaintBehaviorRequest (void) |
| void | modelReordered (Qics::QicsIndexType) |
| void | currentCellChanged (int new_row, int new_col) |
| void | cellValueChanged (int row, int col) |
| void | uneditRequest () |
| void | rowsMoved (int target, const QVector< int > &rows) |
| void | columnsMoved (int target, const QVector< int > &columns) |
| void | fillHandleEvent (QicsFillHandleEventType, QMouseEvent *, const QicsSelection *, const QicsSelection *) |
Public Member Functions | |
| QicsGridInfo (QicsGridType type) | |
| QicsGridType | gridType (void) const |
| QicsDataModel * | dataModel (void) const |
| void | setDataModel (QicsDataModel *dm) |
| QicsStyleManager * | styleManager (void) const |
| void | setStyleManager (QicsStyleManager *sm) |
| QicsMappedDimensionManager * | mappedDM (void) const |
| QicsDimensionManager * | dimensionManager (void) const |
| void | setDimensionManager (QicsDimensionManager *dm) |
| QicsSelectionManager * | selectionManager (void) const |
| void | setSelectionManager (QicsSelectionManager *sel_m) |
| QicsKeyboardManager * | keyboardManager (void) const |
| void | setKeyboardManager (QicsKeyboardManager *key_m) |
| QicsScreenGridPV | grids (void) const |
| void | connectGrid (QicsScreenGrid *grid) |
| void | disconnectGrid (QicsScreenGrid *grid) |
| virtual const QicsDataItem * | cellValue (int row, int col) const |
| void | setDefaultImagePath (const QString &path) |
| const QString & | defaultImagePath () const |
| Qics::QicsRepaintBehavior | gridRepaintBehavior (void) const |
| void | setGlobalRepaintBehavior (QicsRepaintBehavior behavior) |
| void | revertGlobalRepaintBehavior (void) |
| void | setGridRepaintBehavior (QicsRepaintBehavior behavior) |
| void | revertGridRepaintBehavior (void) |
| virtual void | controlColumnsOf (QicsGridInfo *grid) |
| virtual void | controlRowsOf (QicsGridInfo *grid) |
| int | modelColumnIndex (int column) const |
| int | modelRowIndex (int row) const |
| int | visualColumnIndex (int column) const |
| int | visualRowIndex (int row) const |
| QicsRegion | modelRegion (QicsRegion vis_region) const |
| QicsRegion | visualRegion (QicsRegion model_region) const |
| void | orderRowsBy (const QVector< int > &columns, QicsSortOrder order=Qics::Ascending, int from=0, int to=-1, DataItemComparator func=0, bool models=false) |
| void | orderColumnsBy (const QVector< int > &row, QicsSortOrder order=Qics::Ascending, int from=0, int to=-1, DataItemComparator func=0, bool models=false) |
| QicsSorter * | rowOrdering () const |
| QicsSorter * | columnOrdering () const |
| void | setSortingSensitivity (Qt::CaseSensitivity cs) |
| virtual QMimeData * | cutCopyData (QWidget *drag_widget=0, QicsICell *ref_cell=0, bool drag_single=true) |
| void | setCopyPolicy (int policy) |
| int | copyPolicy () const |
| void | setClearPolicy (int policy) |
| int | clearPolicy () const |
| QicsHeaderDragStyle | headerDragStyle () const |
| void | deleteSelected () |
| virtual void | finishCut (bool removeData) |
| void | paste (const QMimeData *md, const QicsICell &cell) |
| QicsICell | overlay (const QicsDataModel &dm, const QicsICell &start_cell, bool expand_model=false, bool clear_if_empty=true) |
| QicsICell | currentCell (bool model=false) const |
| virtual void | setCurrentCell (const QicsICell &cell) |
| int | firstNonHiddenRow (int startRow, int endRow) const |
| int | lastNonHiddenRow (int startRow, int endRow) const |
| int | firstNonHiddenColumn (int startColumn, int endColumn) const |
| int | lastNonHiddenColumn (int startColumn, int endColumn) const |
| bool | ignoreModelSizeChanges (void) const |
| bool | allowPropagateChanges (void) const |
| QString | autoHeaderNamingMask (void) const |
| bool | selectionInProgress (void) const |
| virtual void | reportSelection (QicsSelectionType stype, int anchor_row, int anchor_col, int cur_row, int cur_col) |
| void | reportFillHandleEvent (Qics::QicsFillHandleEventType type, QMouseEvent *, const QicsSelection *, const QicsSelection *) |
| bool | blockSelectionSignals () const |
| void | setBlockSelectionSignals (bool block) |
| void | computeSelectionRegion (QicsRegion ®) |
| QicsRowFilter * | rowFilter () const |
Static Public Attributes | |
| static const int | QicsLAST_ROW = INT_MAX-1 |
| static const int | QicsLAST_COLUMN = INT_MAX-1 |
Protected Slots | |
| void | removeGrid (QObject *obj) |
| void | handleSelectionChange (bool in_progress) |
| void | propagateChangesFromCell (int row, int col) |
Protected Member Functions | |
| void | connectDTtoSM (void) |
| void | connectDTtoDM (void) |
| void | connectDTtoGrid (QicsScreenGrid *grid) |
| void | connectSMtoGrid (QicsScreenGrid *grid) |
| void | connectDMtoGrid (QicsScreenGrid *grid) |
| void | connectSelMtoGrid (QicsScreenGrid *grid) |
| virtual QicsSelectionList * | cutCopySelection (const QicsICell *ref_cell) |
| void | reorganizeSpans (QicsSorter *sorter, int target, const QVector< int > &items) |
Protected Attributes | |
| QicsGridType | myType |
| QPointer< QicsDataModel > | myDataModel |
| QicsStyleManager * | myStyleMananager |
| QicsDimensionManager * | myDimensionManager |
| QicsMappedDimensionManager * | myMappedDM |
| QicsSelectionManager * | mySelM |
| QicsScreenGridPV | myGrids |
| QicsDataString | myCellValue |
| QicsRepaintBehavior | myPrevGridRepaintBehavior |
| QicsSelectionList * | myCutCopySelection |
| QicsICell | myCurrentCell |
| bool | myDoingSelectionFlag |
| QString | myAutoHeaderNamingMask |
| QicsKeyboardManager * | myKeyM |
| QPointer< QicsSorter > | myRowOrdering |
| QPointer< QicsSorter > | myColumnOrdering |
| QPointer< QicsGridInfo > | myRowOrderOwner |
| QPointer< QicsGridInfo > | myColumnOrderOwner |
| bool | myIgnoreModelSizeChanges |
| bool | myAllowPropagateChanges |
| bool | myIsOneCellMoving |
| QicsRowFilter * | myRowFilter |
| bool | myBlockSelectionSignals |
| int | myCopyPolicy |
| int | myClearPolicy |
| QString | myDefaultImagePath |
| QicsHeaderDragStyle | myHeaderDragStyle |
QicsGridInfo is a grouping of objects relating to a QicsGrid. QicsGridInfo automates the connections that are necesary between a grid and its associated objects. These objects include a QicsDataModel (used to help determine the size of the grid, as well as to retrieve the data to draw in the grid), a QicsStyleManager (used to retrieve visual and interactive information about the cells in the grid), and a QicsDimensionManager (used to determine the dimensions of the cells in the grid).
QicsGridInfo connects individual grid widgets to each of the above objects, and notifies the grids if any of the objects have changed.
Most QicsTable users should never need to use a QicsGridInfo object. These objects are automatically created by QicsTable and are used internally by the table components. If you are subclassing a grid or a cell display object, you may need to use this class.
| typedef QVector<QicsScreenGrid *> QicsGridInfo::QicsScreenGridPV |
A vector of pointers to QicsScreenGrid objects.
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.
| QicsGridType QicsGridInfo::gridType | ( | void | ) | const [inline] |
Returns the type of this object.
| QicsDataModel* QicsGridInfo::dataModel | ( | void | ) | const |
Returns the current data model object that has been assigned to this object.
| QicsScreenGridPV QicsGridInfo::grids | ( | void | ) | const [inline] |
Returns a copy of the list of grid widgets that are currently connected to this grid info object.
| virtual const QicsDataItem* QicsGridInfo::cellValue | ( | int | row, | |
| int | col | |||
| ) | const [virtual] |
Returns the value of cell (row, col ) [visual coordinates] in the data model object contained in this object, after mapping to model coordinates. If the grid info object is RowHeader and there is no value returned from the data model, returns a QicsDataInt object containing row. If the grid info object is ColumnHeader and there is no value returned from the data model, returns a QicsDataInt object containing col.
| void QicsGridInfo::setDefaultImagePath | ( | const QString & | path | ) |
Sets default path for pixmaps to path. Pixmaps will be searched at this path on load.
| const QString& QicsGridInfo::defaultImagePath | ( | ) | const [inline] |
| Qics::QicsRepaintBehavior QicsGridInfo::gridRepaintBehavior | ( | void | ) | const |
Returns the current repaint behavior of all grids in this table.
| void QicsGridInfo::setGlobalRepaintBehavior | ( | QicsRepaintBehavior | behavior | ) |
Set the repaint behavior of all grids in this table. Emits a signal that requests a change in global repaint behavior.
| void QicsGridInfo::revertGlobalRepaintBehavior | ( | void | ) |
Revert to the previous repaint behavior for all grids in this table. Emits a signal that requests a revert of global repaint behavior.
| void QicsGridInfo::setGridRepaintBehavior | ( | QicsRepaintBehavior | behavior | ) |
Set the repaint behavior of all grids using this object. Also, stores the previous repaint behavior value for use in revertGridRepaintBehavior.
| void QicsGridInfo::revertGridRepaintBehavior | ( | void | ) |
Revert to the previous repaint behavior for all grids using this object.
| int QicsGridInfo::modelColumnIndex | ( | int | column | ) | const [inline] |
Returns the physical column index into the data model for a given visual column
| int QicsGridInfo::modelRowIndex | ( | int | row | ) | const [inline] |
Returns the physical row index into the data model for a given visual row
| int QicsGridInfo::visualColumnIndex | ( | int | column | ) | const [inline] |
Returns the visual column index for a given model index
| int QicsGridInfo::visualRowIndex | ( | int | row | ) | const [inline] |
Returns visual row index for a given model index
| QicsRegion QicsGridInfo::modelRegion | ( | QicsRegion | vis_region | ) | const |
Returns a region that contains model row and column indices based on the visual region vis_region.
| QicsRegion QicsGridInfo::visualRegion | ( | QicsRegion | model_region | ) | const |
Returns a region that contains visual row and column indices based on the model coordinate region vis_region.
| void QicsGridInfo::setSortingSensitivity | ( | Qt::CaseSensitivity | cs | ) |
Sets case sensitivity while sorting to cs.
| virtual QMimeData* QicsGridInfo::cutCopyData | ( | QWidget * | drag_widget = 0, |
|
| QicsICell * | ref_cell = 0, |
|||
| bool | drag_single = true | |||
| ) | [virtual] |
Returns a drag object/mime source that represents data that is to be cut or copied from the table. The current selection list is used as the data to be cut or copied. If ref_cell is non-zero, it is used to find a contiguous selection from the selection list that contains ref_cell. If no such selection exists, the contents of ref_cell will be used as the data. If ref_cell is zero, the entire selection list is cut or copied.
If non-zero, drag_widget will be set as the drag object's source widget. If specified, ref_cell will be used to determine which part If drag_single parameter is true only current cell will be moved/copied in case if dragging began from current cell, otherwise whole selection will be moved/copied.
| void QicsGridInfo::setCopyPolicy | ( | int | policy | ) | [inline] |
Sets copying policy during copy/paste and drag/drop operations to policy. policy should be bitwise 'or' of QicsCopyPolicy values.
| int QicsGridInfo::copyPolicy | ( | ) | const [inline] |
Returns current copying policy during copy/paste and drag/drop operations as bitwise 'or' of QicsCopyPolicy values.
| void QicsGridInfo::setClearPolicy | ( | int | policy | ) | [inline] |
Sets clearing policy during cut and delete operations to policy. policy should be bitwise 'or' of QicsClearPolicy values.
| int QicsGridInfo::clearPolicy | ( | ) | const [inline] |
Returns current clearing policy during cut and delete operations as bitwise 'or' of QicsClearPolicy values.
| QicsHeaderDragStyle QicsGridInfo::headerDragStyle | ( | ) | const [inline] |
Returns current header drag style
| void QicsGridInfo::deleteSelected | ( | ) |
Deletes data from selected cells according to current clear policy.
| virtual void QicsGridInfo::finishCut | ( | bool | removeData | ) | [virtual] |
Finishes a cut operation. Option deletes data from the data model and then cleans up any cruft from the cutCopyData operation, according to current clear policy.
| removeData | Remove the data from the model. This would be done only after a successful dragMove operation. |
| void QicsGridInfo::paste | ( | const QMimeData * | md, | |
| const QicsICell & | cell | |||
| ) |
Pastes data from md into the table, starting at cell. Operates according to current copy policy.
| QicsICell QicsGridInfo::overlay | ( | const QicsDataModel & | dm, | |
| const QicsICell & | start_cell, | |||
| bool | expand_model = false, |
|||
| bool | clear_if_empty = true | |||
| ) |
Overlays data model dm onto the data model contained in this object. The overlay will start at cell start_cell in the main data model. If expand_model is true, the main data model will be expanded if necessary. If clear_if_empty is true, empty cells in dm will be "copied" to the main data model. If clear_if_empty is false, those cells will not be "copied" and the existing values in the main data model will be retained.
| QicsICell QicsGridInfo::currentCell | ( | bool | model = false |
) | const |
Returns the current cell of the grids associated with this object. Note that if there is no current cell (i.e. the user has not selected a cell) this method will return an invalid cell.
Referenced by QicsScreenGrid::currentCell().
| virtual void QicsGridInfo::setCurrentCell | ( | const QicsICell & | cell | ) | [virtual] |
Sets the current cell of the grids associated with this object.
Referenced by QicsScreenGrid::setCurrentCell().
| int QicsGridInfo::firstNonHiddenRow | ( | int | startRow, | |
| int | endRow | |||
| ) | const |
Returns the visual index of the first non hidden row in the region from startRow to endRow.
| int QicsGridInfo::lastNonHiddenRow | ( | int | startRow, | |
| int | endRow | |||
| ) | const |
Returns the visual index of the last non hidden row in the region from startRow to endRow.
| int QicsGridInfo::firstNonHiddenColumn | ( | int | startColumn, | |
| int | endColumn | |||
| ) | const |
Returns the visual index of the first non hidden column in the region from startColumn to endColumn.
| int QicsGridInfo::lastNonHiddenColumn | ( | int | startColumn, | |
| int | endColumn | |||
| ) | const |
Returns the visual index of the last non hidden column in the region from startColumn to endColumn.
| void QicsGridInfo::gridAdded | ( | QicsScreenGrid * | grid | ) | [signal] |
Signaled when a grid is added to the grid collection for this object.
| void QicsGridInfo::gridRemoved | ( | QicsScreenGrid * | grid | ) | [signal] |
Signaled when a grid is added from the grid collection for this object.
| void QicsGridInfo::globalSetRepaintBehaviorRequest | ( | QicsRepaintBehavior | behavior | ) | [signal] |
Signaled as a request to the table widget to change the repaint behavior for all grids in the table. This is commonly used by QicsRow, QicsColumn and QicsCell objects when they are performing complex changes that would otherwise result in many grid recalculations and redraws.
| void QicsGridInfo::globalRevertRepaintBehaviorRequest | ( | void | ) | [signal] |
Signaled as a request to the table widget to revert the repaint behavior all grids in the table to the value they had previous to the last repaint behavior change request. This is commonly used by QicsRow, QicsColumn and QicsCell objects when they are performing complex changes that would otherwise result in many grid recalculations and redraws.
| void QicsGridInfo::modelReordered | ( | Qics::QicsIndexType | ) | [signal] |
Signaled when the model is reordered in some way. Most grids should recompute things at that point
| void QicsGridInfo::currentCellChanged | ( | int | new_row, | |
| int | new_col | |||
| ) | [signal] |
This signal is emitted when the current cell of the grids associated with this object changes. The cell (new_row, new_col ) is the new current cell (in visual coordinates ).
| void QicsGridInfo::cellValueChanged | ( | int | row, | |
| int | col | |||
| ) | [signal] |
This signal is emitted when the value of a cell in a grid associated with this object changes. The cell (row, col ) is expressed in visual coordinates .
| void QicsGridInfo::uneditRequest | ( | ) | [signal] |
This signal is emitted when traversed to other cell.
| void QicsGridInfo::rowsMoved | ( | int | target, | |
| const QVector< int > & | rows | |||
| ) | [signal] |
This signal is emitted when rows moved. See moveRows() for more information.
| void QicsGridInfo::columnsMoved | ( | int | target, | |
| const QVector< int > & | columns | |||
| ) | [signal] |
This signal is emitted when columns moved. See moveColumns() method for more information.
| void QicsGridInfo::redrawAllGrids | ( | Qics::QicsIndexType | indexType | ) | [slot] |
Recompute and redraw vertical or horizontal grids.