ICS

QicsTable Documentation Set

QicsDataItem Class Reference

A lightweight abstract wrapper class for a generic item. More...

#include <QicsDataItem.h>

Inherits Qics.

Inherited by QicsDataBool, QicsDataDate, QicsDataDateTime, QicsDataDouble, QicsDataFloat, QicsDataInt, QicsDataLong, QicsDataLongLong, QicsDataString, and QicsDataTime.

List of all members.

Public Types

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 Member Functions

virtual QicsDataItemcreate (void) const =0
virtual QicsDataItemclone (void) const =0
virtual bool setString (const QString &qs)=0
virtual const QString string (void) const =0
virtual QicsDataItemType type (void) const =0
virtual QString typeString (void) const =0
virtual QString format (const char *) const
virtual int compareTo (const QicsDataItem &x) const
virtual void encode (QDataStream &ds) const =0

Static Public Member Functions

static QicsDataItemfromString (const QString &str)
static QicsDataItemdecode (QDataStream &ds)
static void registerType (const QString type_name, QicsDataItemParser parser, QicsDataItemDecoder decoder)
static void registerTypeI (const QString type_name, QicsDataItemParser parser, QicsDataItemDecoderWithType decoder)
static void registerParser (QicsDataItemParser parser)


Detailed Description

A lightweight abstract wrapper class for a generic item.

QicsDataItem is an abstract class used to define a common inteface that all data items must implement. The programmer cannot create a QicsDataItem directly. Rather, s/he should create one of its subclasses.

A QicsDataItem is a piece of data that is stored by QicsDataModel objects. By using the abstract QicsDataItem class, the QicsDataModel does not have to know anything about the data it is storing. Similarly, the QicsTable can display data items without having any knowledge of the items' types (as long as the data type has implemented string() correctly).

There are subclasses defined that implement the QicsDataItem API for many built-in C++ and Qt data types. Sometimes it may be desirable to create new subclasses for additional data types. Information regarding adding a new data type can be found in Extending the QicsTable Data Model.


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 QicsDataItem* QicsDataItem::clone void   )  const [pure virtual]
 

A "virtual copy constructor". Returns a newly allocated copy of this object.

Implemented in QicsDataBool, QicsDataInt, QicsDataLong, QicsDataLongLong, QicsDataFloat, QicsDataDouble, QicsDataString, QicsDataDate, QicsDataTime, and QicsDataDateTime.

virtual int QicsDataItem::compareTo const QicsDataItem x  )  const [virtual]
 

Compare another data item x to me for the purpose of sorting. compareTo returns a value < 0 if this items is less than x, 0 if this item == x, and > 0 if this item is greater than x.

Reimplemented in QicsDataBool, QicsDataInt, QicsDataLong, QicsDataLongLong, QicsDataFloat, QicsDataDouble, QicsDataString, QicsDataDate, QicsDataTime, and QicsDataDateTime.

virtual QicsDataItem* QicsDataItem::create void   )  const [pure virtual]
 

A "virtual constructor". Returns an empty, newly allocated object of the same type as this object.

Implemented in QicsDataBool, QicsDataInt, QicsDataLong, QicsDataLongLong, QicsDataFloat, QicsDataDouble, QicsDataString, QicsDataDate, QicsDataTime, and QicsDataDateTime.

static QicsDataItem* QicsDataItem::decode QDataStream &  ds  )  [static]
 

Returns a new data item based on the encoded data in ds.

Reimplemented in QicsDataBool, QicsDataInt, QicsDataLong, QicsDataLongLong, QicsDataFloat, QicsDataDouble, QicsDataString, QicsDataDate, QicsDataTime, and QicsDataDateTime.

virtual void QicsDataItem::encode QDataStream &  ds  )  const [pure virtual]
 

Encodes the value of the data item onto stream ds.

Implemented in QicsDataBool, QicsDataInt, QicsDataLong, QicsDataLongLong, QicsDataFloat, QicsDataDouble, QicsDataString, QicsDataDate, QicsDataTime, and QicsDataDateTime.

virtual QString QicsDataItem::format const char *   )  const [inline, virtual]
 

Converts (if necessary) the contents of the data item to a formatted QString using the supplied formatting string, and returns the formatted string. The exact definition of the formatting string varies among data types.

Reimplemented in QicsDataBool, QicsDataInt, QicsDataLong, QicsDataLongLong, QicsDataFloat, QicsDataDouble, QicsDataString, QicsDataDate, QicsDataTime, and QicsDataDateTime.

static QicsDataItem* QicsDataItem::fromString const QString &  str  )  [static]
 

Returns a new data item based on the content of the string.

Reimplemented in QicsDataBool, QicsDataInt, QicsDataLong, QicsDataLongLong, QicsDataFloat, QicsDataDouble, QicsDataDate, QicsDataTime, and QicsDataDateTime.

static void QicsDataItem::registerParser QicsDataItemParser  parser  )  [static]
 

Used to register a new data item parser algorithm. This parser can be used to reimplement the default parsing "algorithm" of QicsDataItem. If a user defined parser method cannot successfully parse a string, it should return 0. If the user defined parser cannot parse a string, the default QicsDataItem parsing algorithm will be used. The default algorithm first tries any individual user defined type parsers (see registerType()), then attempts to parse the built in types.

Parameters:
parser the new data item parser method
See also:
registerType

static void QicsDataItem::registerType const QString  type_name,
QicsDataItemParser  parser,
QicsDataItemDecoder  decoder
[static]
 

Used to register a new, user-defined type so that the type can be used in streaming, drag and drop, and cut and paste operations. User-defined data item parsers will be called in the order that their types are registered.

Parameters:
type_name name of the new type
parser static member function of the new type that parses an item from a QString
decoder static member function of the new type that decodes an item from a QDataStream
See also:
registerParser

virtual bool QicsDataItem::setString const QString &  qs  )  [pure virtual]
 

Converts (if necessary) qs to the appropriate data type and sets the contents of the data item to that value.

Implemented in QicsDataBool, QicsDataInt, QicsDataLong, QicsDataLongLong, QicsDataFloat, QicsDataDouble, QicsDataString, QicsDataDate, QicsDataTime, and QicsDataDateTime.

virtual const QString QicsDataItem::string void   )  const [pure virtual]
 

Converts (if necessary) the contents of the data item to a QString and returns that string.

Implemented in QicsDataBool, QicsDataInt, QicsDataLong, QicsDataLongLong, QicsDataFloat, QicsDataDouble, QicsDataString, QicsDataDate, QicsDataTime, and QicsDataDateTime.

virtual QicsDataItemType QicsDataItem::type void   )  const [pure virtual]
 

Returns the type of the data item. All user-defined types should return QicsDataItem_UserDefined.

Implemented in QicsDataBool, QicsDataInt, QicsDataLong, QicsDataLongLong, QicsDataFloat, QicsDataDouble, QicsDataString, QicsDataDate, QicsDataTime, and QicsDataDateTime.

virtual QString QicsDataItem::typeString void   )  const [pure virtual]
 

Returns a string describing the type of the data item.

Implemented in QicsDataBool, QicsDataInt, QicsDataLong, QicsDataLongLong, QicsDataFloat, QicsDataDouble, QicsDataString, QicsDataDate, QicsDataTime, and QicsDataDateTime.


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.