Changeset 204 for Evidence/Edd/Edd.h
- Timestamp:
- 05/03/10 17:37:03 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Evidence/Edd/Edd.h
r174 r204 8 8 #include <qwt_plot_grid.h> 9 9 #include <qwt_plot_zoomer.h> 10 #include <qwt_plot_magnifier.h> 10 11 #include <qwt_plot_panner.h> 11 12 #include <qwt_scale_engine.h> … … 16 17 #include <qwt_legend_item.h> 17 18 #include <qwt_symbol.h> 19 #include <qwt_plot_marker.h> 18 20 19 21 #include <limits.h> … … 25 27 #define SVN_REVISION "$Revision$" 26 28 29 const QColor EddPlotBackgroundColor(Qt::yellow); 30 27 31 QWidget *OpenHistory(char *, int); 28 32 29 33 // Time scale for axis 30 class TimeScale: public QwtScaleDraw { 31 public: 32 TimeScale() { } 34 class EddTimeScale: public QwtScaleDraw { 35 36 public: 37 EddTimeScale() {} 38 33 39 virtual QwtText label(double v) const { 34 QDateTime t = QDateTime::fromTime_t((int) v); 35 return t.toString("dMMM'\n'hh:mm:ss"); 40 41 // Adapt text format to time span 42 QString Format; 43 if (scaleDiv().range() < 60*60) Format = "hh' h\n'mm:ss"; 44 else if (scaleDiv().range() < 24*60*60) Format = "hh:mm"; 45 else if (scaleDiv().range() < 30*24*60*60) Format = "h' h\n'd-MMM"; 46 else Format = "d-MMM'\n'yyyy"; 47 48 // Generate text 49 QwtText Text = QDateTime::fromTime_t((int) v).toString(Format); 50 QFont Font = Text.font(); 51 Font.setPointSize(7); 52 Text.setFont(Font); 53 54 return Text; 36 55 } 37 56 }; … … 89 108 QAction *NormAction; 90 109 QAction *StyleAction; 110 QAction *StripAction; 91 111 92 112 QwtPlotPanner *Panner; 93 113 QwtPlotGrid *Grid; 94 114 QwtPlotZoomer *Zoomer; 95 QwtLegend *Legend; 96 115 QwtPlotMagnifier *Magnifier; 116 QwtPicker *Picker; 117 QwtLegend *Legend; 118 QwtDoubleRect BBox; 119 97 120 void dragEnterEvent(QDragEnterEvent *); 98 121 void dropEvent(QDropEvent *); 99 122 void paintEvent(QPaintEvent *); 123 100 124 public: 101 125 EddPlot(QString = QString(), int = 0, QWidget * = NULL); … … 108 132 109 133 void HandleZoom(const QwtDoubleRect &); 110 void contextMenuEvent(QContextMenuEvent *); 134 void MouseSelection(const QwtPolygon &); 135 void contextMenuEvent(QContextMenuEvent *); 111 136 void LegendClicked(QwtPlotItem *); 112 137 void MenuZoomOut(); … … 116 141 void MenuPrint(); 117 142 void MenuPasteService(); 143 void MenuPlotHelp(); 118 144 }; 119 145
Note:
See TracChangeset
for help on using the changeset viewer.