DISPLACE  1.0
A spatial model of fisheries to help sustainable fishing and maritime spatial planning
interestinglistwithspecialvalues.h
Go to the documentation of this file.
1 #ifndef INTERESTINGLISTWITHSPECIALVALUES_H
2 #define INTERESTINGLISTWITHSPECIALVALUES_H
3 
5 
6 template <typename T>
8  QList<bool> mSpecialValues;
9  QList<QString> mSpecialValuesName;
10  QString mGroupFormatString;
11 
12 public:
14  : InterestingList<T>() {
15  }
16 
17  void setValuesFormatString(QString groupFormatString) {
18  mGroupFormatString = groupFormatString;
19  }
20 
21  void addSpecialValue(QString name, bool selected = false) {
22  mSpecialValuesName.push_back(name);
23  mSpecialValues.push_back(selected);
24  }
25 
26  bool isSpecialValueSelected (int idx) const {
27  return mSpecialValues[idx];
28  }
29 
30  void setSpecialValueSelected (int idx, bool selected) {
31  mSpecialValues[idx] = selected;
32  }
33 
34  size_t getSpecialValuesCount() const {
35  return mSpecialValues.size();
36  }
37 
38  QString getSpecialName (int idx) const {
39  return mSpecialValuesName[idx];
40  }
41 
42  QString getFormatString () const {
43  return mGroupFormatString;
44  }
45 };
46 
47 #endif // INTERESTINGLISTWITHSPECIALVALUES_H
QString getSpecialName(int idx) const
Definition: interestinglistwithspecialvalues.h:38
size_t getSpecialValuesCount() const
Definition: interestinglistwithspecialvalues.h:34
Definition: interestinglist.h:7
Definition: interestinglistwithspecialvalues.h:7
QString getFormatString() const
Definition: interestinglistwithspecialvalues.h:42
InterestingListWithSpecialValues()
Definition: interestinglistwithspecialvalues.h:13
void addSpecialValue(QString name, bool selected=false)
Definition: interestinglistwithspecialvalues.h:21
void setSpecialValueSelected(int idx, bool selected)
Definition: interestinglistwithspecialvalues.h:30
bool isSpecialValueSelected(int idx) const
Definition: interestinglistwithspecialvalues.h:26
void setValuesFormatString(QString groupFormatString)
Definition: interestinglistwithspecialvalues.h:17