ICS

QicsTable Documentation Set

QicsGridInfo Class Reference

Information for QicsGrids. More...

#include <QicsGridInfo.h>

Inherits QObject, and Qics.

List of all members.

Public Types

typedef QVector< QicsScreenGrid * > QicsScreenGridPV
enum  QicsSortMode { QicsStableSort = 0, QicsQuickSort }
enum  QicsCellOverflowBehavior { Clip = 0, Overflow, ToolTip }
enum  QicsCurrentCellStyle { Spreadsheet = 0, NormalSelected }
enum  QicsGridCellClipping { AllowPartial = 0, NoDisplayOnPartial, UseClippedSymbol }
enum  QicsGridType { TableGrid = 0, RowHeaderGrid, ColumnHeaderGrid }
enum  QicsHeaderType { RowHeader = 0, ColumnHeader }
enum  QicsIndexType { RowIndex, ColumnIndex }
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, ScrollDown, ScrollLeft,
  ScrollRight, ScrollToRow, ScrollToColumn
}
enum  QicsSelectionPolicy {
  SelectNone = 0, SelectSingle, SelectMultiple, SelectSingleRow,
  SelectMultipleRow
}
enum  QicsSelectionType {
  SelectionNone = 0, SelectionBegin, SelectionDrag, SelectionEnd,
  SelectionExtend, SelectionAdd
}
enum  QicsSortOrder { Ascending = 0, Descending }
enum  QicsTableDisplayOption { DisplayNever = 0, DisplayAlways, DisplayFirstPage }
enum  QicsTraversalKeyEditBehavior { TraverseWithinCell = 0, TraverseBetweenCells }

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 ()
virtual void redrawModel (QicsRegion r)
virtual void setCellValue (int row, int col, const QicsDataItem &itm)
virtual void setCurrentCellValue (const QicsDataItem &itm)
void setIgnoreModelSizeChanges (bool b)
void setAllowPropagateChanges (bool b)

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 (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)

Public Member Functions

 QicsGridInfo (QicsGridType type)
QicsGridType gridType (void) const
QicsDataModeldataModel (void) const
void setDataModel (QicsDataModel *dm)
QicsStyleManager * styleManager (void) const
void setStyleManager (QicsStyleManager *sm)
QicsMappedDimensionManagermappedDM (void) const
QicsDimensionManager * dimensionManager (void) const
void setDimensionManager (QicsDimensionManager *dm)
QicsSelectionManagerselectionManager (void) const
void setSelectionManager (QicsSelectionManager *sel_m)
QicsScreenGridPV grids (void) const
void connectGrid (QicsScreenGrid *grid)
void disconnectGrid (QicsScreenGrid *grid)
virtual const QicsDataItemcellValue (int row, int col) 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 (QVector< int > columns, QicsSortOrder order=Qics::Ascending, int from=0, int to=-1, DataItemComparator func=0)
void orderColumnsBy (QVector< int > row, QicsSortOrder order=Qics::Ascending, int from=0, int to=-1, DataItemComparator func=0)
QicsSorter * rowOrdering () const
QicsSorter * columnOrdering () const
virtual QMimeData * cutCopyData (QWidget *drag_widget=0, QicsICell *ref_cell=0)
virtual void finishCut (bool removeData)
void paste (const QMimeData *md, const QicsICell &cell)
void overlay (const QicsDataModel &dm, const QicsICell &start_cell, bool expand_model=false, bool clear_if_empty=true)
QicsICell currentCell (void) 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
bool selectionInProgress (void) const
virtual void reportSelection (QicsSelectionType stype, int anchor_row, int anchor_col, int cur_row, int cur_col)

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 QicsSelectionListcutCopySelection (const QicsICell *ref_cell)

Protected Attributes

QicsGridType myType
QPointer< QicsDataModelmyDT
QicsStyleManager * mySM
QicsDimensionManager * myDM
QicsMappedDimensionManagermyMappedDM
QicsSelectionManagermySelM
QicsScreenGridPV myGrids
QicsDataInt myCellValue
QicsRepaintBehavior myPrevGridRepaintBehavior
QicsSelectionListmyCutCopySelection
QicsICell myCurrentCell
bool myDoingSelectionFlag

Private Attributes

QicsSorter * myRowOrdering
QicsSorter * myColumnOrdering
QicsGridInfomyRowOrderOwner
QicsGridInfomyColumnOrderOwner
bool myIgnoreModelSizeChanges
bool myAllowPropagateChanges
bool myIsOneCellMoving


Detailed Description

Information for QicsGrids.

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.


Member Typedef Documentation

typedef QVector<QicsScreenGrid *> QicsGridInfo::QicsScreenGridPV
 

A vector of pointers to QicsScreenGrid objects.


Member Enumeration Documentation

enum Qics::QicsCellOverflowBehavior [inherited]
 

Denotes the behavior of grids when handling cells whose contents cannot be displayed in the boundaries of the cell.

  • Clip Cell contents are clipped at the edges of the cell
  • Overflow The grid will attempt to overflow into adjacent cells
  • ToolTip The full contents of the cell will be displayed in a tooltip when the mouse pointer is hovered over the cell

enum Qics::QicsCurrentCellStyle [inherited]
 

Denotes the visual style that the current cell of the table will be drawn with.

  • Spreadsheet The current cell will be drawn with a solid border and will always use the cell's background color.
  • NormalSelected The current cell will be drawn the same as all other selected cells. The border will be as specified in the cell's border properties, and the background will be the cell's selected color.

enum Qics::QicsGridCellClipping [inherited]
 

Denotes the policy for displaying text that is too long to fit in its cell

  • AllowPartial Shows as much of the text as possible
  • NoDisplayOnPartial Do not display text if it cannot fit in the cell
  • UseClippedSymbol Display a clipped symbol at the end of the partial text

enum Qics::QicsGridType [inherited]
 

Specifies a type of grid object.

  • TableGrid A grid used to display normal table data
  • RowHeaderGrid A grid used to display row header data
  • ColumnHeaderGrid A grid used to display column header data

enum Qics::QicsHeaderType [inherited]
 

Specifies the type of table header.

  • HeaderRow A row header
  • HeaderColumn A column header

enum Qics::QicsIndexType [inherited]
 

Specifies the type of table index.

  • RowIndex A row index
  • ColumnIndex A column index

enum Qics::QicsLineStyle [inherited]
 

Denotes the style of lines and borders in the table widget.

  • None No line or border
  • Plain A simple, plain line or border
  • Raised A raised line (using shadows)
  • Sunken A sunken line (using shadows)

enum Qics::QicsRepaintBehavior [inherited]
 

Specifies the recalculation and repainting behavior of tables and grids.

  • RepaintOff Do not perform any drawing or dimension calculations
  • RepaintOn Draw as needed, keep all dimensions up to date
  • RepaintCalcOnly Do not draw, but keep all dimensions up to date

enum Qics::QicsScrollBarMode [inherited]
 

Specifies the various modes of QicsTable's scroll bars.

  • Auto QicsTable shows a scroll bar when the content is too large to fit and not otherwise.
  • AlwaysOff QicsTable never shows a scroll bar.
  • AlwaysOn QicsTable always shows a scroll bar.

enum Qics::QicsScrollDirection [inherited]
 

Denotes a direction for scrolling operations, or that an absolute scroll should occur.

  • ScrollNone no scroll allowed
  • ScrollUp scrolling up on a certain number of rows
  • ScrollDown scrolling down on a certain number of rows
  • ScrollLeft scrolling left on a certain number of columns
  • ScrollRight scrolling right on a certain number of columns
  • ScrollToRow scrolling up or down to a certain row
  • ScrollToColumn scrolling left or right to a certain column

enum Qics::QicsSelectionPolicy [inherited]
 

Denotes the selection policy for the table.

  • SelectNone no selection allowed
  • SelectSingle single cell selection
  • SelectionMultiple multiple cell selection (including non-contiguous regions)
  • SelectSingleRow selecting a cell selects the entire row, only one row can be selected
  • SelectMultipleRow selecting a cell selects the entire row, multiple rows can be selected

enum Qics::QicsSortMode [inherited]
 

Denotes the sort algorithm which is used

  • QicsStableSort Used non distructive, stable sort algorithm
  • QicsQuickSort Default quick sort algorithm.

enum Qics::QicsSortOrder [inherited]
 

Specifies whenever ordering should be ascending or descending.

  • Ascending Ascending order
  • Descending Descending order

enum Qics::QicsTableDisplayOption [inherited]
 

Specifies a printing display policy for elements of the table

  • DisplayNever Do not display the element when printing
  • DisplayAlways Always display the element when printing
  • DisplayFirstPage Display the element only when printing the first page of the table

enum Qics::QicsTraversalKeyEditBehavior [inherited]
 

Specifies the behavior of the traversal keys (left, right, up, down, etc) while editing a cell.

  • TraverseWithinCell Traversal keys move the text cursor within the edited cell.
  • TraverseBetweenCells Traversal keys move the current cell highlight between cells in the table.


Member Function Documentation

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::cellValueChanged int  row,
int  col
[signal]
 

This signal is emitted when a the value of a cell in a grid associated with this object changes. The cell (row, col ) is expressed in visual coordinates .

void QicsGridInfo::columnsMoved int  target,
const QVector< int > &  columns
[signal]
 

This signal is emitted when columns moved. See moveColumns() method for more information.

QicsICell QicsGridInfo::currentCell void   )  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.

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 ).

virtual QMimeData* QicsGridInfo::cutCopyData QWidget *  drag_widget = 0,
QicsICell ref_cell = 0
[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

QicsDataModel* QicsGridInfo::dataModel void   )  const
 

Returns the current data model object that has been assigned to this object.

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 cudCopyData operation.

Parameters:
removeData Remove the data from the model. This would be done only after a successful dragMove operation.

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::firstNonHiddenRow int  startRow,
int  endRow
const
 

Returns the visual index of the first non hidden row in the region from startRow to endRow.

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::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::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.

Qics::QicsRepaintBehavior QicsGridInfo::gridRepaintBehavior void   )  const
 

Returns the current repaint behavior of all grids in this table.

QicsScreenGridPV QicsGridInfo::grids void   )  const [inline]
 

Returns a copy of the list of grid widgets that are currently connected to this grid info object.

QicsGridType QicsGridInfo::gridType void   )  const [inline]
 

Returns the type of this object.

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.

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::modelColumnIndex int  column  )  const [inline]
 

Returns the physical column index into the data model for a given visual column

QicsRegion QicsGridInfo::modelRegion QicsRegion  vis_region  )  const
 

Returns a region that contains model row and column indices based on the visual region vis_region.

void QicsGridInfo::modelReordered QicsIndexType   )  [signal]
 

Signaled when the model is reordered in some way. Most grids should recompute things at that point

int QicsGridInfo::modelRowIndex int  row  )  const [inline]
 

Returns the physical row index into the data model for a given visual row

void 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.

void QicsGridInfo::paste const QMimeData *  md,
const QicsICell cell
 

Pastes data from md into the table, starting at cell.

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::revertGridRepaintBehavior void   ) 
 

Revert to the previous repaint behavior for all grids using this object.

void QicsGridInfo::rowsMoved int  target,
const QVector< int > &  rows
[signal]
 

This signal is emitted when rows moved. See moveRows() for more information.

virtual void QicsGridInfo::setCurrentCell const QicsICell cell  )  [virtual]
 

Sets the current cell of the grids associated with this object.

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::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::uneditRequest  )  [signal]
 

This signal is emitted when traversed to other cell.

int QicsGridInfo::visualColumnIndex int  column  )  const [inline]
 

Returns the visual column index for a given model index

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.

int QicsGridInfo::visualRowIndex int  row  )  const [inline]
 

Returns visual row index for a given model index


The documentation for this class was generated from the following file:

All trademarks and copyrights on this page are properties of their respective owners.
The rest is copyright 1999-2006 Integrated Computer Solutions, Inc.