00001 00002 00003 #ifndef GLGRAPHICSVIEW_H 00004 #define GLGRAPHICSVIEW_H 00005 00006 #include <avogadro/global.h> 00007 #include <QGraphicsView> 00008 00009 namespace Avogadro { 00010 00011 class GLWidget; 00012 00013 class A_EXPORT GLGraphicsView : public QGraphicsView 00014 { 00015 Q_OBJECT 00016 00017 public: 00018 GLGraphicsView(QWidget *parent = 0); 00019 explicit GLGraphicsView(GLWidget *widget, QWidget *parent = 0); 00020 explicit GLGraphicsView(QGraphicsScene *scene, QWidget *parent = 0); 00021 00022 void constructor(); 00023 00024 void resizeEvent(QResizeEvent *event); 00025 00026 GLWidget * glWidget(); 00027 00028 protected: 00029 virtual void drawBackground(QPainter *painter, const QRectF &rect); 00030 virtual bool event(QEvent *event); 00031 virtual void mouseMoveEvent(QMouseEvent *event); 00032 virtual void mousePressEvent(QMouseEvent *event); 00033 virtual void mouseReleaseEvent(QMouseEvent *event); 00034 virtual void wheelEvent(QWheelEvent * event); 00035 00036 private: 00037 GLWidget *m_glwidget; 00038 }; 00039 00040 } 00041 00042 #endif 00043