00001 #ifndef STACKEDGRAPHVIEW_H 00002 #define STACKEDGRAPHVIEW_H 00003 00004 #include <QGraphicsView> 00005 #include <QGraphicsScene> 00006 00010 class StackedGraphView : public QGraphicsView 00011 { 00012 Q_OBJECT 00013 00014 public: 00015 StackedGraphView(QGraphicsScene* scene, QWidget* parent); 00016 ~StackedGraphView(); 00017 00018 bool hasGLAA() {return hasGLSampleBuffer;} 00019 00020 signals: 00021 void toolTipChanged(QGraphicsItem* item, QPoint pos); 00022 00023 public slots: 00024 void showWholeGraph(); 00025 00029 void setGLViewport(bool openGL); 00034 void setAutoGLViewport(bool autoGL) {autoGLViewport = autoGL; checkGLViewport();} 00035 00036 protected: 00037 void wheelEvent(QWheelEvent* event); 00038 void mouseReleaseEvent(QMouseEvent* event); 00039 00040 private slots: 00041 void resetView() {this->fitInView(this->sceneRect(),Qt::KeepAspectRatio);} 00042 void resetPixelScale(); 00043 00044 private: 00045 void checkGLViewport(); 00046 00047 bool hasGLSampleBuffer; 00048 bool hasGLViewport; 00049 bool autoGLViewport; 00050 double pixelScale; 00051 }; 00052 00053 #endif