19 #include <QMouseEvent> 21 #include <qwt/qwt_painter.h> 22 #include <qwt/qwt_plot_canvas.h> 35 QwtPlotZoomer(canvas, doReplot) {
51 if ((stateMachine()->selectionType() == QwtPickerMachine::RectSelection) &&
52 (rubberBand() == RectRubberBand)) {
53 if (pickedPoints().count() < 2)
56 QPoint p1 = pickedPoints()[0];
57 QPoint p2 = pickedPoints()[pickedPoints().count()-1];
59 QRect rect = QRect(p1, p2).normalized();
60 rect.adjust(0, 0, -1, -1);
62 QwtPainter::drawRect(painter, rect);
65 QwtPlotZoomer::drawRubberBand(painter);
69 if (mouseMatch(MouseSelect2, event))
72 QwtPlotZoomer::widgetMousePressEvent(event);
76 if (mouseMatch(MouseSelect2, event)) {
81 QwtPlotZoomer::widgetMouseReleaseEvent(event);
void widgetMouseReleaseEvent(QMouseEvent *event)
void drawRubberBand(QPainter *painter) const
PlotZoomer(QwtPlotCanvas *canvas, bool doReplot=true)
void widgetMousePressEvent(QMouseEvent *event)