map2d_widget
mousewheelzoomtype.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 #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  {
46 
52 
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 
zooms map to current view center
Definition: mousewheelzoomtype.h:56
static QString StrByType(Types const &value)
Definition: mousewheelzoomtype.h:58
static Types TypeByStr(QString const &value)
Definition: mousewheelzoomtype.h:65
Types
Definition: mousewheelzoomtype.h:40
Definition: mousewheelzoomtype.h:35
static QStringList TypesList()
Definition: mousewheelzoomtype.h:72
zooms map to current mouse position and makes it map center
Definition: mousewheelzoomtype.h:45
zooms to current mouse position, but doesn't make it map center, google/bing style ;} ...
Definition: mousewheelzoomtype.h:51