ICS

QicsTable Documentation Set

QicsDataModel Class Reference

Abstract API for storing and retrieving table data. More...

#include <QicsDataModel.h>

Inherits QObject, and Qics.

Inherited by QicsDataModelDefault, and QicsDataModelQtModelAdapter.

List of all members.

Public Types

typedef QicsDataModel *(* Foundry )(int num_rows, int num_cols, QObject *parent)
typedef QicsDataModel *(* FoundryWithKey )(int num_rows, int num_cols, void *key)
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

virtual void setItem (int row, int col, const QicsDataItem &item)=0
virtual void setItem (int row, int col, int val)
virtual void setItem (int row, int col, long val)
virtual void setItem (int row, int col, qlonglong val)
virtual void setItem (int row, int col, float val)
virtual void setItem (int row, int col, double val)
virtual void setItem (int row, int col, const QString &val)
virtual void setItem (int row, int col, const char *val)
virtual void setItem (int row, int col, const QDate &val)
virtual void setItem (int row, int col, const QTime &val)
virtual void setItem (int row, int col, const QDateTime &val)
virtual void setItem (int row, int col, const bool &val)
virtual void insertRows (int number_of_rows, int starting_position)=0
virtual void insertColumns (int number_of_columns, int starting_position)=0
virtual void addRows (int rows)=0
virtual void addColumns (int num)=0
virtual void deleteRow (int row)=0
virtual void deleteRows (int num_rows, int start_row)=0
virtual void deleteColumn (int col)=0
virtual void deleteColumns (int num_cols, int start_col)=0
virtual void clearItem (int row, int col)=0
virtual void clearModel (void)=0

Signals

void modelChanged (QicsRegion reg)
void modelSizeChanged (int new_number_of_rows, int new_number_of_columns)
void modelSizeChanged (int position, int num_items_added_removed, Qics::QicsIndexType row_or_col)
void rowsInserted (int number_of_rows, int starting_position)
void columnsInserted (int number_of_columns, int starting_position)
void rowsDeleted (int number_of_rows, int starting_position)
void columnsDeleted (int number_of_columns, int starting_position)
void rowsAdded (int number_of_rows)
void columnsAdded (int number_of_columns)
void cellValueChanged (int row, int col)
void prepareForRowChanges (int num_rows, int start_row)
void prepareForColumnChanges (int num_cols, int start_col)

Public Member Functions

 QicsDataModel (int num_rows=0, int num_cols=0, QObject *parent=0)
int numRows (void) const
int numColumns (void) const
int lastRow (void) const
int lastColumn (void) const
bool contains (int row, int col) const
virtual const QicsDataItemitem (int row, int col) const =0
virtual QString itemString (int row, int col) const
const QicsDataItemoperator() (int row, int col)
virtual QicsDataModelRow rowItems (int row, int first_col=0, int last_col=-1) const =0
virtual QicsDataModelColumn columnItems (int col, int first_row=0, int last_row=-1) const =0
virtual void setRowItems (int row, const QicsDataModelRow &v)=0
virtual void setColumnItems (int col, const QicsDataModelColumn &v)=0
bool emitSignals (void) const
void setEmitSignals (bool b)
void notifyRegionChanged (QicsRegion reg)
virtual bool isRowEmpty (int) const
virtual bool isColumnEmpty (int) const
void readASCII (QTextStream &stream, const char separator= ';', int start_row=0, int start_col=0, bool clear_model=false, bool add_columns=true)
void writeASCII (QTextStream &stream, const char separator= ';', int start_row=0, int start_col=0, int nrows=-1, int ncols=-1)

Static Public Attributes

static const int QicsLAST_ROW = INT_MAX-1
static const int QicsLAST_COLUMN = INT_MAX-1

Protected Member Functions

void setNumRows (int nrows)
void setNumColumns (int ncols)

Protected Attributes

int myNumRows
int myNumColumns
bool myEmitSignalsFlag

Private Member Functions

 QicsDataModel (const QicsDataModel &)
QicsDataModeloperator= (const QicsDataModel &)


Detailed Description

Abstract API for storing and retrieving table data.

QicsDataModel is an abstract class that defines the common API that all data model classes must implement. The data model is used for storage and/or retrieval of data that will be displayed in QicsTable widgets (and, later, other widgets). This abstract class has been designed so that programmers can subclass QicsDataModel and implement their own data storage. As an example, a programmer may already have data stored in C-style arrays or even in a database. Rather than have to extract each data item and add it to the default data model object (QicsDataModelDefault), the programmer can create a subclass of QicsDataModel that uses the data in place and simply implements the necessary data model methods. More information about implementing a new data model class can be found in Extending the QicsTable Data Model.

QicsDataModel represents a two dimensional array of data items. Each data item is an instance of a subclass of QicsDataItem. There are no restrictions on what type of data items can be in each row, column, or cell. That is, individual rows and columns may contain different types of data items. Row and column indices begin at 0 and end at lastRow() and lastColumn().

The default model constructor creates an empty model with no cells. The size of the model may be set at creation time by providing the desired number of rows and columns to the data model's constructor. After creation, the size of the model may be changed by inserting, adding, or deleting rows and columns. The size of the model may be retrieved by calling numRows() and numColumns().

Operations on the data model can take place on individual cells, rows, columns, and the entire table. The two most basic methods are item() and setItem(). Part or all of a row or column may be retrieved by calling rowItems() or columnItems(), and entire row or column item values may be set by calling setRowItems() or setColumnItems().


Member Typedef Documentation

typedef QicsDataModel*(* QicsDataModel::Foundry)(int num_rows, int num_cols, QObject *parent)

Foundry method to create new instances of a subclass of QicsDataModel. Subclasses of QicsDataModel should implement a similar method. Methods of this type can be passed to a QicsTable constructor in order to create custom data models for row and column headers.


Member Enumeration Documentation

enum Qics::QicsWideKeyAction [inherited]

Denotes global key actions available for the table grid.

  • Del_DeleteSelected Pressing Delete removes data from the selected cells.
  • CtrlA_SelectAll Pressing Control+A selects all the cells in the grid.

enum Qics::QicsBoxBorders [inherited]

Denotes the box borders of cell region.

  • TopBorder Top border of the region.
  • BottomBorder Bottom border of the region.
  • LeftBorder Left border of the region.
  • RightBorder Right border of the region.

enum Qics::QicsCopyPolicy [inherited]

Denotes the copying policy during copy/paste and drag/drop operations.

  • CopyData Copy data from cells.
  • CopyAttributes Copy cell attributes.
  • CopyDimensions Copy cell dimensions (width/height).
  • CopySpans Copy spanned cells.

enum Qics::QicsClearPolicy [inherited]

Denotes the clearing policy during cut and delete operations.

  • ClearData Clear data from cells.
  • ClearAttributes Clear cell attributes.
  • ClearSpans Clear spanned cells.

enum Qics::QicsSortMode [inherited]

Denotes the sort algorithm which is used.

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

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::QicsSelectionStyle [inherited]

  • Normal The selection will be drawn by the normal way.
  • Exclusive The selection will be drawn with border like in MS Excel.

  • Follow The current cell will follow the selection (QicsTable style).
  • Static The current cell will stay on selection anchor (MS Excel style).
    Since:
    2.3

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

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.

Specifies the behavior of drag&drop operations when it has began from current cell.

  • DragCurrent - only current cell is dragging.
  • DragSelection - whole selection is dragging.

enum Qics::QicsCellWidthMode [inherited]

Specifies the behavior of set cell font.

  • NoChange - does not change size of cells.
  • ChangeOnlyHeight - changing only height of the cell when new font is applies (cell width is not changed).
  • ChangeHeightWidth - changing height and width.

Specifies the cell decoration style for headers.

  • Flat Header cells are drawn flat, just like as ordinal cells.
  • Styled Header cells are drawn with different look.

enum Qics::QicsHeaderDragStyle [inherited]

Specifies row/column drag style for headers.

  • SimpleDrag Only drag cursor is used to indicate drag process.
  • StyledDrag Extended image is used to indicate drag process.

enum Qics::QicsAutoFitMode [inherited]

Specifies autofit modes.

  • Native It toggles between the user defined and minimal width (default).
  • Excel It is just setting the minimal width.


Constructor & Destructor Documentation

QicsDataModel::QicsDataModel ( int  num_rows = 0,
int  num_cols = 0,
QObject *  parent = 0 
)

Constructor for the class. Creates a new data model object with num_rows rows and num_cols columns. All cells in the data model are initially empty.


Member Function Documentation

int QicsDataModel::numRows ( void   )  const [inline]

Returns the number of rows in the model.

int QicsDataModel::numColumns ( void   )  const [inline]

Returns the number of columns in the model.

int QicsDataModel::lastRow ( void   )  const [inline]

Returns the index of the last row in the data model.

See also:
lastColumn()

int QicsDataModel::lastColumn ( void   )  const [inline]

Returns the index of the last column in the data model.

See also:
lastRow()

bool QicsDataModel::contains ( int  row,
int  col 
) const [inline]

Returns true if the position (row, col ) is a valid position in the data model. Returns false if the position is not valid in this model.

virtual const QicsDataItem* QicsDataModel::item ( int  row,
int  col 
) const [pure virtual]

Returns a const pointer to the QicsDataItem stored in (row, col). The object is not a copy, and must not be modified, as modifications will not be communicated to any widgets that are displaying data from this table. If there is no data item in that location, this method returns 0.

The value that is returned from this method is guaranteed to be valid only until the next call to QicsDataModel::item(). If you need to use the original item after this point, you should make a copy of the data item using QicsDataItem::clone().

A consequence of the above restriction is that if you are implementing this method in a subclass, you do not have to continually allocate new data items each time this method is called. You can allocate a single object and reuse it each time the method is called. See Example - Implementing a New Data Model for an example of this type of usage.

See also:
itemString()

Implemented in QicsDataModelDefault, and QicsDataModelQtModelAdapter.

virtual QString QicsDataModel::itemString ( int  row,
int  col 
) const [virtual]

Returns the string representation of the data item stored in (row, col), or the empty string if there is no data item at that location.

See also:
item()

const QicsDataItem* QicsDataModel::operator() ( int  row,
int  col 
) [inline]

This operator is equivalent to item(). It is included for the convenience of the programmer.

See also:
itemString()

virtual QicsDataModelRow QicsDataModel::rowItems ( int  row,
int  first_col = 0,
int  last_col = -1 
) const [pure virtual]

Returns a new vector which contains const pointers to each item from cell (row, first_col ) to (row, last_col ). If last_col = -1, the last column will be the value of lastColumn().

Implemented in QicsDataModelDefault, and QicsDataModelQtModelAdapter.

virtual QicsDataModelColumn QicsDataModel::columnItems ( int  col,
int  first_row = 0,
int  last_row = -1 
) const [pure virtual]

Returns a new vector which contains const pointers to each item from cell (first_row, col ) to (last_row, col ). If last_row = -1, the last row will be the value of lastRow().

Implemented in QicsDataModelDefault, and QicsDataModelQtModelAdapter.

virtual void QicsDataModel::setRowItems ( int  row,
const QicsDataModelRow v 
) [pure virtual]

Sets the data items in row row to the values contained in the vector of QicsDataItem pointers v. A copy of each data item is made, so the original items do not need to be maintained for the life of the data model.

The nth data item in the vector is put in position (row, n). If the vector of items contains less data items than there are columns in the model, the extra cells in the column are unset. If the vector of items contains more data items than there are columns in the model, the extra data items are ignored.

Implementers are required to emit the modelChanged signal in this method.

See also:
setColumnItems()

Implemented in QicsDataModelDefault, and QicsDataModelQtModelAdapter.

virtual void QicsDataModel::setColumnItems ( int  col,
const QicsDataModelColumn v 
) [pure virtual]

Sets the data items in column col to the values contained in the vector of QicsDataItem pointers v. A copy of each data item is made, so the original items do not need to be maintained for the life of the data model.

The nth data item in the vector is put in position (n, col). If the vector of items contains less data items than there are rows in the model, the extra cells in the column are unset. If the vector of items contains more data items than there are rows in the model, the extra data items are ignored.

Implementers are required to emit the modelChanged signal in this method.

See also:
setRowItems()

Implemented in QicsDataModelDefault, and QicsDataModelQtModelAdapter.

bool QicsDataModel::emitSignals ( void   )  const [inline]

Returns the current value of the emitsSignals flag. If true, the model will emit modelChanged() signals when the model data is modified, and modelSizeChanged() signals when the size of the data model is changed. if false, no signals will be emitted.

void QicsDataModel::setEmitSignals ( bool  b  )  [inline]

Controls the output of QicsDataModel signals. If b is true, the model will emit modelChanged() signals when the model data is modified, and modelSizeChanged() signals when the size of the data model is changed.if b is false, no signals will be emitted.

void QicsDataModel::notifyRegionChanged ( QicsRegion  reg  )  [inline]

Forces model to emit modelChanged(reg) signal. It is intended for notifying about changes after complex updates rather than emit a bunch of signals for each cell being changed (which is too slow).

Since:
2.3

virtual bool QicsDataModel::isRowEmpty ( int   )  const [inline, virtual]

Returns true if row does not contain any data, false otherwise. Should be reimplemented in real data model.

Since:
2.2

Reimplemented in QicsDataModelDefault.

virtual bool QicsDataModel::isColumnEmpty ( int   )  const [inline, virtual]

Returns true if column does not contain any data, false otherwise. Should be reimplemented in real data model.

Since:
2.2

Reimplemented in QicsDataModelDefault.

void QicsDataModel::readASCII ( QTextStream &  stream,
const char  separator = ';',
int  start_row = 0,
int  start_col = 0,
bool  clear_model = false,
bool  add_columns = true 
)

Reads delimited ASCII data from a stream into the model. The data must be in the format of one line per row, with each column in the row separated by a delimiter character.

  • stream The stream to read from.
  • separator The character that separates each piece of data.
  • start_row Row index of the cell where the data will be loaded. The first line of data will be loaded into cells beginning at this row, with subsequent lines loaded into rows below.
  • start_col Column index of the cell where the data will be loaded. The first item of each line of data will be loaded into cells beginning at this column, with subsequent items loaded into columns to the right.
  • clear_model Specifies if the entire model should be cleared before loading the data.
  • add_columns Specifies if the model should extend its column count if readed more from a row.

void QicsDataModel::writeASCII ( QTextStream &  stream,
const char  separator = ';',
int  start_row = 0,
int  start_col = 0,
int  nrows = -1,
int  ncols = -1 
)

Writes delimited ASCII data from a data model to a stream. The data is output one line per row, with each column in the row separated by a configurable delimiter character.

  • stream The stream to write to.
  • separator The character that separates each piece of data.
  • start_row Row index of the starting cell to be output.
  • start_col Column index of the starting cell to be output.
  • nrows Number of rows to output.
  • ncols Number of columns to output.

virtual void QicsDataModel::setItem ( int  row,
int  col,
const QicsDataItem item 
) [pure virtual, slot]

Sets the value of cell (row, col) to item. This method makes a new copy of item and stores it in the model, so the original item does not need to be maintained for the life of the data model.

Implementers are required to emit the modelChanged signal in this method.

Implemented in QicsDataModelDefault, and QicsDataModelQtModelAdapter.

virtual void QicsDataModel::setItem ( int  row,
int  col,
int  val 
) [inline, virtual, slot]

This method is essentially equivalent to the previous method. val is used to create a new QicsDataItem of the appropriate type, and that data item is placed in cell (row, col ).

If this method is reimplemented, implementers are required to emit the modelChanged signal.

virtual void QicsDataModel::setItem ( int  row,
int  col,
long  val 
) [inline, virtual, slot]

This method is essentially equivalent to the previous method. val is used to create a new QicsDataItem of the appropriate type, and that data item is placed in cell (row, col ).

If this method is reimplemented, implementers are required to emit the modelChanged signal.

virtual void QicsDataModel::setItem ( int  row,
int  col,
qlonglong  val 
) [inline, virtual, slot]

This method is essentially equivalent to the previous method. val is used to create a new QicsDataItem of the appropriate type, and that data item is placed in cell (row, col ).

If this method is reimplemented, implementers are required to emit the modelChanged signal.

virtual void QicsDataModel::setItem ( int  row,
int  col,
float  val 
) [inline, virtual, slot]

This method is essentially equivalent to the previous method. val is used to create a new QicsDataItem of the appropriate type, and that data item is placed in cell (row, col ).

If this method is reimplemented, implementers are required to emit the modelChanged signal.

virtual void QicsDataModel::setItem ( int  row,
int  col,
double  val 
) [inline, virtual, slot]

This method is essentially equivalent to the previous method. val is used to create a new QicsDataItem of the appropriate type, and that data item is placed in cell (row, col ).

If this method is reimplemented, implementers are required to emit the modelChanged signal.

virtual void QicsDataModel::setItem ( int  row,
int  col,
const QString &  val 
) [inline, virtual, slot]

This method is essentially equivalent to the previous method. val is used to create a new QicsDataItem of the appropriate type, and that data item is placed in cell (row, col ).

If this method is reimplemented, implementers are required to emit the modelChanged signal.

virtual void QicsDataModel::setItem ( int  row,
int  col,
const char *  val 
) [inline, virtual, slot]

This method is essentially equivalent to the previous method. val is used to create a new QicsDataItem of the appropriate type, and that data item is placed in cell (row, col ).

If this method is reimplemented, implementers are required to emit the modelChanged signal.

virtual void QicsDataModel::setItem ( int  row,
int  col,
const QDate &  val 
) [inline, virtual, slot]

This method is essentially equivalent to the previous method. val is used to create a new QicsDataItem of the appropriate type, and that data item is placed in cell (row, col ).

If this method is reimplemented, implementers are required to emit the modelChanged signal.

virtual void QicsDataModel::setItem ( int  row,
int  col,
const QTime &  val 
) [inline, virtual, slot]

This method is essentially equivalent to the previous method. val is used to create a new QicsDataItem of the appropriate type, and that data item is placed in cell (row, col ).

If this method is reimplemented, implementers are required to emit the modelChanged signal.

virtual void QicsDataModel::setItem ( int  row,
int  col,
const QDateTime &  val 
) [inline, virtual, slot]

This method is essentially equivalent to the previous method. val is used to create a new QicsDataItem of the appropriate type, and that data item is placed in cell (row, col ).

If this method is reimplemented, implementers are required to emit the modelChanged signal.

virtual void QicsDataModel::setItem ( int  row,
int  col,
const bool &  val 
) [inline, virtual, slot]

This method is essentially equivalent to the previous method. val is used to create a new QicsDataItem of the appropriate type, and that data item is placed in cell (row, col ).

If this method is reimplemented, implementers are required to emit the modelChanged signal.

virtual void QicsDataModel::insertRows ( int  number_of_rows,
int  starting_position 
) [pure virtual, slot]

Inserts number_of_rows rows in to the model, beginning at starting_position. Initially, the new rows have no data. To populate the new rows, the programmer should call either setItem() for each item, or setRowItems() for entire rows.

Implementers are required to emit rowsInserted and modelSizeChanged signals.

Implemented in QicsDataModelDefault, and QicsDataModelQtModelAdapter.

virtual void QicsDataModel::insertColumns ( int  number_of_columns,
int  starting_position 
) [pure virtual, slot]

Inserts number_of_columns columns in to the model, beginning at starting_position. Initially, the new columns have no data. To populate the new columns, the programmer should call either setItem() for each item, or setColumnItems() for entire columns.

Implementers are required to emit columnsInserted and modelSizeChanged signals.

Implemented in QicsDataModelDefault, and QicsDataModelQtModelAdapter.

virtual void QicsDataModel::addRows ( int  rows  )  [pure virtual, slot]

Increases size of the model by num rows. Initially, the new rows have no data. To populate the new rows, the programmer should call either setItem() for each item, or setRowItems() for entire rows.

Implementers are required to emit rowsAdded and modelSizeChanged signals.

Implemented in QicsDataModelDefault, and QicsDataModelQtModelAdapter.

virtual void QicsDataModel::addColumns ( int  num  )  [pure virtual, slot]

Increases size of the model by num columns. Initially, the new columns have no data. To populate the new columns, the programmer should call either setItem() for each item, or setColumnItems() for entire columns.

Implementers are required to emit columnsAdded and modelSizeChanged signals.

Implemented in QicsDataModelDefault, and QicsDataModelQtModelAdapter.

virtual void QicsDataModel::deleteRow ( int  row  )  [pure virtual, slot]

Removes row row from the model. All rows below the deleted row are moved up.

Implementers are required to emit rowsDeleted and modelSizeChanged signals.

See also:
deleteColumn()

Implemented in QicsDataModelDefault, and QicsDataModelQtModelAdapter.

virtual void QicsDataModel::deleteRows ( int  num_rows,
int  start_row 
) [pure virtual, slot]

Removes num_rows rows from the model, beginning at row start_row. All rows below the deleted rows are moved up.

See also:
deleteColumns()
Implementers are required to emit rowsDeleted and modelSizeChanged signals.

Implemented in QicsDataModelDefault, and QicsDataModelQtModelAdapter.

virtual void QicsDataModel::deleteColumn ( int  col  )  [pure virtual, slot]

Removes column col from the model. All columns below the deleted column are moved left.

Implementers are required to emit columnsDeleted and modelSizeChanged signals.

See also:
deleteRow()

Implemented in QicsDataModelDefault, and QicsDataModelQtModelAdapter.

virtual void QicsDataModel::deleteColumns ( int  num_cols,
int  start_col 
) [pure virtual, slot]

Removes num_cols columns from the model, beginning at column start_col. All columns below the deleted columns are moved left.

Implementers are required to emit columnsDeleted and modelSizeChanged signals.

See also:
deleteRows()

Implemented in QicsDataModelDefault, and QicsDataModelQtModelAdapter.

virtual void QicsDataModel::clearItem ( int  row,
int  col 
) [pure virtual, slot]

Removes the QicsDataItem at positon ( row , col ) by destroying it. If there is no value stored at that location, the method does nothing.

Implementers are required to emit the modelChanged signal in this method.

Implemented in QicsDataModelDefault, and QicsDataModelQtModelAdapter.

virtual void QicsDataModel::clearModel ( void   )  [pure virtual, slot]

Clears all of the data items in the model.

Implementers are required to emit the modelChanged and modelSizeChanged signals in this method.

Implemented in QicsDataModelDefault, and QicsDataModelQtModelAdapter.

void QicsDataModel::modelChanged ( QicsRegion  reg  )  [signal]

This signal is emitted when any data item in the model changes value. it is not emitted on creation or destruction of the model. It is not emitted if the model changes size. The argument is the region of the data model that changed value.

See also:
modelSizeChanged

void QicsDataModel::modelSizeChanged ( int  new_number_of_rows,
int  new_number_of_columns 
) [signal]

This signal is emitted when the data model changes size.

void QicsDataModel::modelSizeChanged ( int  position,
int  num_items_added_removed,
Qics::QicsIndexType  row_or_col 
) [signal]

This signal is emitted when the data model changes size. Cause smart redraw.

void QicsDataModel::rowsInserted ( int  number_of_rows,
int  starting_position 
) [signal]

This signal is emitted when rows are inserted into the model.

void QicsDataModel::columnsInserted ( int  number_of_columns,
int  starting_position 
) [signal]

This signal is emitted when columns are inserted into the model.

void QicsDataModel::rowsDeleted ( int  number_of_rows,
int  starting_position 
) [signal]

This signal is emitted when rows are deleted from the model.

void QicsDataModel::columnsDeleted ( int  number_of_columns,
int  starting_position 
) [signal]

This signal is emitted when columns are deleted from the model.

void QicsDataModel::rowsAdded ( int  number_of_rows  )  [signal]

This signal is emitted when rows are added to the end of the model.

void QicsDataModel::columnsAdded ( int  number_of_columns  )  [signal]

This signal is emitted when rows are added to the end of the model.

void QicsDataModel::cellValueChanged ( int  row,
int  col 
) [signal]

This signal is emitted when value of the particular cell is changed.

void QicsDataModel::prepareForRowChanges ( int  num_rows,
int  start_row 
) [signal]

This signal is emitted when data in the model start to change rows size. it is not emitted on creation or destruction of the model. If num_rows < 0 rows ere preparing for deletion, otherwise inserting.

void QicsDataModel::prepareForColumnChanges ( int  num_cols,
int  start_col 
) [signal]

This signal is emitted when data in the model start to change columns size. it is not emitted on creation or destruction of the model. If num_cols < 0 columns are preparing for deletion, otherwise inserting.


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-2007 Integrated Computer Solutions, Inc.