ICS

QicsTable Documentation Set

QicsDataModelDefault.h

Go to the documentation of this file.
00001 /*********************************************************************
00002 **
00003 ** Copyright (C) 2002-2006 Integrated Computer Solutions, Inc
00004 ** All rights reserved.
00005 **
00006 ** This file is part of the QicsTable Product.
00007 **
00008 **********************************************************************/
00009 
00010 #ifndef _QicsDataModelDefault_H
00011 #define _QicsDataModelDefault_H
00012 
00013 #include <QicsDataModel.h>
00014 #include <QicsDataItem.h>
00015 
00016 #include <QString>
00017 #include <QVector> 
00018 
00019 typedef QVector<QicsDataItem *> QicsDataItemPV;
00020 typedef QVector<QicsDataItemPV *> QicsDataItemPVPV;
00021 
00022 
00058 
00059 
00062 
00063 
00064 class QICS_EXPORT QicsDataModelDefault: public QicsDataModel 
00065 {
00066     Q_OBJECT
00067 
00068 public:
00072     QicsDataModelDefault(int num_rows = 0, int num_cols = 0,
00073              QObject *parent = 0);
00074     virtual ~QicsDataModelDefault();
00075 
00076     virtual const QicsDataItem *item(int row, int col) const;
00077     virtual QicsDataModelRow rowItems(int row, int first_col, int last_col) const;
00078     virtual QicsDataModelColumn columnItems(int col, int first_row, int last_row) const;
00079 
00080     virtual void setColumnItems(int col, const QicsDataModelColumn &v);
00081     virtual void setRowItems(int row, const QicsDataModelRow &v);
00082 
00083     virtual bool isRowEmpty(int row) const;
00084     virtual bool isColumnEmpty(int column) const;
00085 
00093     static QicsDataModel *create(int num_rows = 0 , int num_cols = 0);
00094 
00095 public slots:
00096 
00097 #ifdef NOTDEF // Is this necessary?
00098 #if !defined(__GNUC__) || (__GNUC__ >= 3)
00099     // need this or else setItem() hides other setItem methods in superclass
00100     using QicsDataModel::setItem;
00101 #endif
00102 #endif
00103 
00104     virtual void setItem(int row, int col, const QicsDataItem &item);
00105 
00106     virtual void insertColumns(int number_of_columns, int starting_position);
00107     virtual void insertRows(int number_of_rows, int starting_position);
00108     virtual void addColumns(int num);
00109     virtual void addRows(int num);
00110         
00111     virtual void clearItem (int row, int col);
00112     virtual void clearModel(void);
00113     virtual void deleteRow (int row);
00114     virtual void deleteColumn (int col);
00115     virtual void deleteRows(int num_rows, int start_row);
00116     virtual void deleteColumns(int num_cols, int start_col);
00117     
00118 protected:
00119     
00126     virtual void clearRow(int rownum);
00127     
00133     QicsDataItemPVPV myVectorOfRowPointers; 
00134 };
00135 
00136 #endif /*_QicsDataModelDefault_H --- Do not add anything past this line */
00137 

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