dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
mousewheelzoomtype.h
Go to the documentation of this file.
1 
13 /*
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 3 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful, but
20 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
21 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 * for more details.
23 *
24 * You should have received a copy of the GNU General Public License along
25 * with this program; if not, see <http://www.gnu.org/licenses/>
26 */
27 #ifndef MOUSEWHEELZOOMTYPE_H
28 #define MOUSEWHEELZOOMTYPE_H
29 #include <QObject>
30 #include <QStringList>
31 #include <QMetaType>
32 #include <QMetaObject>
33 #include <QMetaEnum>
34 namespace internals {
35  class MouseWheelZoomType:public QObject
36  {
37  Q_OBJECT
38  Q_ENUMS(Types)
39  public:
40  enum Types
41  {
45  MousePositionAndCenter,
46 
51  MousePositionWithoutCenter,
52 
56  ViewCenter
57  };
58  static QString StrByType(Types const& value)
59  {
60  QMetaObject metaObject = MouseWheelZoomType().staticMetaObject;
61  QMetaEnum metaEnum= metaObject.enumerator( metaObject.indexOfEnumerator("Types"));
62  QString s=metaEnum.valueToKey(value);
63  return s;
64  }
65  static Types TypeByStr(QString const& value)
66  {
67  QMetaObject metaObject = MouseWheelZoomType().staticMetaObject;
68  QMetaEnum metaEnum= metaObject.enumerator( metaObject.indexOfEnumerator("Types"));
69  Types s=(Types)metaEnum.keyToValue(value.toLatin1());
70  return s;
71  }
72  static QStringList TypesList()
73  {
74  QStringList ret;
75  QMetaObject metaObject = MouseWheelZoomType().staticMetaObject;
76  QMetaEnum metaEnum= metaObject.enumerator( metaObject.indexOfEnumerator("Types"));
77  for(int x=0;x<metaEnum.keyCount();++x)
78  {
79  ret.append(metaEnum.key(x));
80  }
81  return ret;
82  }
83 
84 };
85 
86 }
87 Q_DECLARE_METATYPE(internals::MouseWheelZoomType::Types)
88 #endif // MOUSEWHEELZOOMTYPE_H
89 
Q_DECLARE_METATYPE(Core::Internal::MenuActionContainer *) using namespace Core
x
Definition: OPPlots.m:100