Changeset 8127 in ntrip for trunk/BNC/qwt/qwt_plot_zoomer.h
- Timestamp:
- May 10, 2017, 3:20:54 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/qwt/qwt_plot_zoomer.h
r4271 r8127 18 18 \brief QwtPlotZoomer provides stacked zooming for a plot widget 19 19 20 QwtPlotZoomer offers rubberband selections on the plot canvas, 21 translating the selected rectangles into plot coordinates and 22 adjusting the axes to them. Zooming can repeated as often as 23 possible, limited only by maxStackDepth() or minZoomSize(). 24 Each rectangle is pushed on a stack. 20 QwtPlotZoomer selects rectangles from user inputs ( mouse or keyboard ) 21 translates them into plot coordinates and adjusts the axes to them. 22 The selection is supported by a rubber band and optionally by displaying 23 the coordinates of the current mouse position. 25 24 26 Zoom rectangles can be selected depending on selectionFlags() using the 27 mouse or keyboard (QwtEventPattern, QwtPickerMachine). 28 QwtEventPattern::MouseSelect3,QwtEventPattern::KeyUndo, 29 or QwtEventPattern::MouseSelect6,QwtEventPattern::KeyRedo 30 walk up and down the zoom stack. 31 QwtEventPattern::MouseSelect2 or QwtEventPattern::KeyHome unzoom to 32 the initial size. 25 Zooming can be repeated as often as possible, limited only by 26 maxStackDepth() or minZoomSize(). Each rectangle is pushed on a stack. 27 28 The default setting how to select rectangles is 29 a QwtPickerDragRectMachine with the following bindings: 30 31 - QwtEventPattern::MouseSelect1\n 32 The first point of the zoom rectangle is selected by a mouse press, 33 the second point from the position, where the mouse is released. 34 35 - QwtEventPattern::KeySelect1\n 36 The first key press selects the first, the second key press 37 selects the second point. 38 39 - QwtEventPattern::KeyAbort\n 40 Discard the selection in the state, where the first point 41 is selected. 42 43 To traverse the zoom stack the following bindings are used: 44 45 - QwtEventPattern::MouseSelect3, QwtEventPattern::KeyUndo\n 46 Zoom out one position on the zoom stack 47 48 - QwtEventPattern::MouseSelect6, QwtEventPattern::KeyRedo\n 49 Zoom in one position on the zoom stack 50 51 - QwtEventPattern::MouseSelect2, QwtEventPattern::KeyHome\n 52 Zoom to the zoom base 53 54 The setKeyPattern() and setMousePattern() functions can be used 55 to configure the zoomer actions. The following example 56 shows, how to configure the 'I' and 'O' keys for zooming in and out 57 one position on the zoom stack. The "Home" key is used to 58 "unzoom" the plot. 59 60 \code 61 zoomer = new QwtPlotZoomer( plot ); 62 zoomer->setKeyPattern( QwtEventPattern::KeyRedo, Qt::Key_I, Qt::ShiftModifier ); 63 zoomer->setKeyPattern( QwtEventPattern::KeyUndo, Qt::Key_O, Qt::ShiftModifier ); 64 zoomer->setKeyPattern( QwtEventPattern::KeyHome, Qt::Key_Home ); 65 \endcode 33 66 34 67 QwtPlotZoomer is tailored for plots with one x and y axis, but it is 35 allowed to attach a second QwtPlotZoomer for the other axes. 68 allowed to attach a second QwtPlotZoomer ( without rubber band and tracker ) 69 for the other axes. 36 70 37 71 \note The realtime example includes an derived zoomer class that adds 38 72 scrollbars to the plot canvas. 73 74 \sa QwtPlotPanner, QwtPlotMagnifier 39 75 */ 40 76 … … 43 79 Q_OBJECT 44 80 public: 45 explicit QwtPlotZoomer( Q wtPlotCanvas*, bool doReplot = true );81 explicit QwtPlotZoomer( QWidget *, bool doReplot = true ); 46 82 explicit QwtPlotZoomer( int xAxis, int yAxis, 47 Q wtPlotCanvas*, bool doReplot = true );83 QWidget *, bool doReplot = true ); 48 84 49 85 virtual ~QwtPlotZoomer();
Note:
See TracChangeset
for help on using the changeset viewer.