File: ElementCollection.h

package info (click to toggle)
tulip 3.7.0dfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 39,428 kB
  • sloc: cpp: 231,403; php: 11,023; python: 1,128; sh: 671; yacc: 522; makefile: 315; xml: 63; lex: 55
file content (44 lines) | stat: -rwxr-xr-x 1,424 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef ELEMENTCOLLECTION_H
#define ELEMENTCOLLECTION_H

#include <tulip/tulipconf.h>
#include <vector>
#include <QtCore/QAbstractListModel>
#include <QtCore/QMap>
#include <QtGui/QIcon>
#include <QtCore/QStringList>
#include <QtCore/QList>


class ElementCollection : public QAbstractListModel {
  Q_OBJECT
public:
  enum ElementCollectionType {SelectionType = 33};

  explicit ElementCollection(QObject *parent = 0);
  ElementCollection(const QStringList &strings, QObject *parent = 0);
  ElementCollection(const ElementCollection& other);

  int rowCount(const QModelIndex &parent = QModelIndex()) const;
  QVariant data(const QModelIndex &index, int role) const;
  bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);

  Qt::ItemFlags flags(const QModelIndex &index) const;

  bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex());
  bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex());

  void addElement(const QString& label);

  void setAllElementSelection(bool selected);
  void setElementSelection(int element,bool selected);
  QList<int> selectedElement()const;

//            void sort(int column, Qt::SortOrder order = Qt::AscendingOrder);
  ElementCollection &operator=( const ElementCollection & );
private:
  QList<QMap<int,QVariant> > _data;

};

#endif // ELEMENTCOLLECTION_H