GlobeEngine
LegendComboBoxModel.h
Go to the documentation of this file.
1 #ifndef GE_LegendComboBoxModel_H
2 #define GE_LegendComboBoxModel_H
3 
4 #include "OpenGL_Includes.h"
5 #include "FeatureObject.h"
6 #include <QObject>
7 #include <QStringList>
8 
9 namespace geViewer {
10 
12  {
13  int index;
14  std::string field;
15  };
16 
17  class LegendComboBoxModel : public QObject
18  {
19  Q_OBJECT
20 
21  Q_PROPERTY(QStringList comboList READ comboList WRITE setComboList NOTIFY comboListChanged)
22  Q_PROPERTY(int count READ count WRITE setCount NOTIFY countChanged)
23  Q_PROPERTY(QString fieldType READ fieldType WRITE setFieldType NOTIFY fieldTypeChanged)
24 
25  public:
26  LegendComboBoxModel(QObject *parent = 0);
27  LegendComboBoxModel(const QStringList &list, int count, QObject *parent = 0);
28 
29  // property bindings
30  const QStringList comboList();
31  int count();
32  QString fieldType();
33 
34  void setComboList(const QStringList& _comboList);
35  void setCount(int cnt);
36  void setFieldType(QString _type);
37 
38  Q_INVOKABLE void addElement(const QString &element);
39  Q_INVOKABLE void removeElement(int index);
40  Q_INVOKABLE const QString get(int index);
41 
42  signals:
43 
44  void comboListChanged();
45  void countChanged();
46  void fieldTypeChanged();
47 
49 
50  public slots:
51 
52  private:
53 
54  QStringList listofElements;
55  int numberOfElements;
56  QString attributeType;
57  };
58 }
59 #endif
int index
Definition: LegendComboBoxModel.h:13
std::string field
Definition: LegendComboBoxModel.h:14
Definition: LegendComboBoxModel.h:17
Definition: FeaturePanel.h:10
Q_INVOKABLE void removeElement(int index)
Definition: LegendComboBoxModel.cpp:71
void setCount(int cnt)
Definition: LegendComboBoxModel.cpp:49
Q_INVOKABLE void addElement(const QString &element)
Definition: LegendComboBoxModel.cpp:58
void setComboList(const QStringList &_comboList)
Definition: LegendComboBoxModel.cpp:33
Definition: LegendComboBoxModel.h:11
const QStringList comboList()
Q_INVOKABLE const QString get(int index)
Definition: LegendComboBoxModel.cpp:87
void selectionChanged(LegendAttributeSelection)
void setFieldType(QString _type)
Definition: LegendComboBoxModel.cpp:43