SpikeStream Application Library  0.2
NeuronGroupSelectionModel.h
Go to the documentation of this file.
00001 #ifndef NEURONGROUPSELECTIONMODEL_H
00002 #define NEURONGROUPSELECTIONMODEL_H
00003 
00004 //SpikeStream includes
00005 #include "NeuronGroup.h"
00006 using namespace spikestream;
00007 
00008 //Qt includes
00009 #include <QAbstractTableModel>
00010 #include <QStringList>
00011 
00012 namespace spikestream {
00013 
00015         class NeuronGroupSelectionModel : public QAbstractTableModel {
00016                 Q_OBJECT
00017 
00018                 public:
00019                         NeuronGroupSelectionModel(QList<NeuronGroup*> neuronGroupList);
00020                         ~NeuronGroupSelectionModel();
00021                         int columnCount(const QModelIndex& parent = QModelIndex()) const;
00022                         QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const;
00023                         QList<NeuronGroup*> getSelectedNeuronGroups();
00024                         QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
00025                         int rowCount(const QModelIndex& parent = QModelIndex()) const;
00026                         void selectAllOrNone();
00027                         bool setData(const QModelIndex& index, const QVariant& value, int role=Qt::EditRole);
00028 
00029                         friend class NeuronGroupSelectionView;
00030 
00031 
00032                 private:
00033                         //====================  VARIABLES  ====================
00036                         QList<NeuronGroup*> neurGrpList;
00037 
00039                         QHash<unsigned, bool> selectionMap;
00040 
00041                         static const int NUM_COLS = 3;
00042                         static const int SELECT_COL = 0;
00043                         static const int NAME_COL = 1;
00044                         static const int ID_COL = 2;
00045                 };
00046 
00047 }
00048 
00049 #endif//NEURONGROUPSELECTIONMODEL_H
00050 
 All Classes Files Functions Variables Typedefs Friends Defines