map2d_widget
uavtrailtype.h
Go to the documentation of this file.
1 
12 /*
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 3 of the License, or
16 * (at your option) any later version.
17 *
18 * This program is distributed in the hope that it will be useful, but
19 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
20 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 * for more details.
22 *
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 */
27 
28 #ifndef UAVTRAILTYPE_H
29 #define UAVTRAILTYPE_H
30 #include <QObject>
31 #include <QMetaObject>
32 #include <QMetaEnum>
33 #include <QStringList>
34 namespace mapcontrol {
35  class UAVTrailType:public QObject
36  {
37  Q_OBJECT
38  Q_ENUMS(Types)
39  public:
40  enum Types
41  {
60  };
61  static QString StrByType(Types const& value)
62  {
63  QMetaObject metaObject = UAVTrailType().staticMetaObject;
64  QMetaEnum metaEnum= metaObject.enumerator( metaObject.indexOfEnumerator("Types"));
65  QString s=metaEnum.valueToKey(value);
66  return s;
67  }
68  static Types TypeByStr(QString const& value)
69  {
70  QMetaObject metaObject = UAVTrailType().staticMetaObject;
71  QMetaEnum metaEnum= metaObject.enumerator( metaObject.indexOfEnumerator("Types"));
72  Types s=(Types)metaEnum.keyToValue(value.toLatin1());
73  return s;
74  }
75  static QStringList TypesList()
76  {
77  QStringList ret;
78  QMetaObject metaObject = UAVTrailType().staticMetaObject;
79  QMetaEnum metaEnum= metaObject.enumerator( metaObject.indexOfEnumerator("Types"));
80  for(int x=0;x<metaEnum.keyCount();++x)
81  {
82  ret.append(metaEnum.key(x));
83  }
84  return ret;
85  }
86 
87  };
88 }
89 
90 #endif // UAVTRAILTYPE_H
Definition: uavtrailtype.h:53
static QString StrByType(Types const &value)
Definition: uavtrailtype.h:61
static Types TypeByStr(QString const &value)
Definition: uavtrailtype.h:68
Types
Definition: uavtrailtype.h:40
Definition: uavtrailtype.h:59
Definition: uavtrailtype.h:47
Definition: uavtrailtype.h:35
static QStringList TypesList()
Definition: uavtrailtype.h:75