GlobeEngine
MobileGLWidget.h
Go to the documentation of this file.
1 #ifndef MOBILEGLWIDGET_H
2 #define MOBILEGLWIDGET_H
3 
4 #include "MobileCoreEngine.h"
5 //#include <QOpenGLWidget>
6 //#include <QOpenGLFunctions>
7 //
8 
9 #include <QGLWidget>
10 #include <QVector2D>
11 
12 class MobileGLWidget : public QGLWidget
13 //class MobileGLWidget : public QOpenGLWidget, protected QOpenGLFunctions
14 {
15  Q_OBJECT
16 
17 public:
18  explicit MobileGLWidget(QWidget *parent = 0);
20 
21 protected:
22  void initializeGL() Q_DECL_OVERRIDE;
23  void paintGL() Q_DECL_OVERRIDE;
24  void resizeGL(int w, int h) Q_DECL_OVERRIDE;
25 
26  void keyPressEvent(QKeyEvent *e) Q_DECL_OVERRIDE;
27  void keyReleaseEvent(QKeyEvent *e) Q_DECL_OVERRIDE;
28 
29  void leaveEvent(QEvent * event ) Q_DECL_OVERRIDE;
30  void enterEvent(QEvent * event ) Q_DECL_OVERRIDE;
31  bool event(QEvent *event) Q_DECL_OVERRIDE;
32  void mousePressEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
33  void mouseReleaseEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
34  void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
35  //void timerEvent(QTimerEvent *e) Q_DECL_OVERRIDE;
36  void wheelEvent(QWheelEvent* event);
37 
38 //#ifdef __ARM__
39  bool gestureEvent(QGestureEvent *event);
40  void panTriggered(QPanGesture *gesture);
41  void pinchTriggered(QPinchGesture *gesture);
42  void swipeTriggered(QSwipeGesture *gesture);
43 //#endif
44 
45 private:
46  MobileCoreEngine mobileengine;
47 
48  QVector2D mousePressPosition;
49  bool altPressed;
50  bool mouseInWidget;
51  int posParentX;
52  int posParentY;
53 
54  //QBasicTimer timer;
55  bool test;
56 };
57 
58 #endif
void mouseReleaseEvent(QMouseEvent *e) Q_DECL_OVERRIDE
Definition: MobileGLWidget.cpp:48
MobileGLWidget(QWidget *parent=0)
Definition: MobileGLWidget.cpp:12
void keyPressEvent(QKeyEvent *e) Q_DECL_OVERRIDE
Definition: MobileGLWidget.cpp:53
void pinchTriggered(QPinchGesture *gesture)
Definition: MobileGLWidget.cpp:212
bool event(QEvent *event) Q_DECL_OVERRIDE
Definition: MobileGLWidget.cpp:135
void leaveEvent(QEvent *event) Q_DECL_OVERRIDE
Definition: MobileGLWidget.cpp:75
void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE
Definition: MobileGLWidget.cpp:88
void paintGL() Q_DECL_OVERRIDE
Definition: MobileGLWidget.cpp:274
Definition: MobileGLWidget.h:12
void initializeGL() Q_DECL_OVERRIDE
Definition: MobileGLWidget.cpp:250
void wheelEvent(QWheelEvent *event)
Definition: MobileGLWidget.cpp:129
void keyReleaseEvent(QKeyEvent *e) Q_DECL_OVERRIDE
Definition: MobileGLWidget.cpp:64
void swipeTriggered(QSwipeGesture *gesture)
Definition: MobileGLWidget.cpp:236
void panTriggered(QPanGesture *gesture)
Definition: MobileGLWidget.cpp:190
~MobileGLWidget()
Definition: MobileGLWidget.cpp:36
Definition: MobileCoreEngine.h:28
void resizeGL(int w, int h) Q_DECL_OVERRIDE
Definition: MobileGLWidget.cpp:269
void enterEvent(QEvent *event) Q_DECL_OVERRIDE
Definition: MobileGLWidget.cpp:82
void mousePressEvent(QMouseEvent *e) Q_DECL_OVERRIDE
Definition: MobileGLWidget.cpp:42
bool gestureEvent(QGestureEvent *event)
Definition: MobileGLWidget.cpp:179