This is your initial sequence to get something started:
picker
->setRubberBandPen
( QColor( Qt
::red ) );
picker
->setTrackerPen
( QColor( Qt
::green ) );
connect( picker,
SIGNAL( selected
( const QRectF &rect
) ), ...
);
QwtPlotPicker* picker= new QwtPlotPicker( plot->canvas() );
picker->setStateMachine( new QwtPickerDragRectMachine() );
picker->setRubberBand( QwtPlotPicker::RectRubberBand );
picker->setRubberBandPen( QColor( Qt::red ) );
picker->setTrackerPen( QColor( Qt::green ) );
picker->setTrackerMode( QwtPlotPicker::ActiveOnly );
connect( picker, SIGNAL( selected( const QRectF &rect ) ), ... );
To copy to clipboard, switch view to plain text mode
Choose the type of state machine you like and check its docs, what type of event patterns are used by it. In case of the rectangle machines it is using QwtEventPattern::MouseSelect1 and QwtEventPattern::KeySelect1 - what means changing QwtEventPattern::MouseSelect2 ( like in your code snippet ) will have no effect.
Uwe
Bookmarks