Go to the documentation of this file.00001
00002
00003
00004
00005
00008
00009 #ifndef lgrZoomableWidget_H_
00010 #define lgrZoomableWidget_H_
00011
00012 #include "lgrGui.h"
00013 #include "qtFloatMath.h"
00014
00015 #include <QtGui/QWidget>
00016
00017 class QRectF;
00018 class QPoint;
00019 class QRect;
00020
00021 namespace MAKLogger
00022 {
00023 class DtLgrGuiModel;
00024
00026 class DT_DLL_LGRGUI DtLgrZoomableWidget : public QWidget
00027 {
00028 Q_OBJECT
00029
00030 public:
00031
00033 DtLgrZoomableWidget(QWidget* parent);
00034
00036 virtual ~DtLgrZoomableWidget();
00037
00040 QRectF scaledViewport(QRect orignalViewport,QPoint margins) const;
00041
00043 void drawCursor(QPainter& painter, double firstVisibleTime,
00044 double lastVisibleTime, double cursorTime, int xOffset,bool active);
00045
00047 QRect cursorBounds(double firstVisibleTime, double lastVisibleTime,
00048 double cursorTime, int xOffset);
00049
00051 double firstVisibleTime(double firstTime, double lastTime) const;
00052
00054 double firstVisibleTime( DtLgrGuiModel& model) const;
00055
00057 double lastVisibleTime(double firstTime, double lastTime) const;
00058
00060 double lastVisibleTime( DtLgrGuiModel& model) const;
00061
00064 float leftOffset() const { return myLeftOffset; };
00065
00068 float rightOffset() const { return myRightOffset; };
00069
00071 float horizontalMargin() const;
00072
00074 void setHorizontalMargin(float margin);
00075
00076
00077
00078 void setDrawTimes(DtLgrGuiModel& model);
00079
00080 public slots:
00081 virtual void setOffsets(float left,float right);
00082
00083 virtual void testForUpdate(DtLgrGuiModel& model);
00084
00085 signals:
00086 void offsetsChanged(float left,float right);
00087
00088 protected:
00089 float myLeftOffset;
00090 float myRightOffset;
00091 float myHorizontalMargin;
00092 double myDrawnFirstVisibleTime;
00093 double myDrawnLastVisibleTime;
00094 double myDrawnCurrentVisibleTime;
00095 };
00096
00097 }
00098
00099 #endif