cprokopiak
3rd February 2011, 16:25
Hi,
I am trying to create a QwtPlotPicker class that can select left and right boundary points on my QwtPlot. My original idea was to have the left mouse button select the left boundary and the right mouse button to select the right. However, when trying to implement this, I've noticed that I can only get the selected( QwtDoublePoint point ) SIGNAL function to work with only a left mouse button click. Even a CTRL+left mouse button does not emit the signal. Is it possible to have multiple button events emit the selected SIGNAL, or is it only active for QwtEventPatter::MouseSelect1? If it's the latter, I guess I would need to have independent pickers for both the left and the right boundaries?
I am running Qwt 5.2.0.
Here is my code:
signalPicker = new PlotPicker( canvas() );
signalPicker->setSelectionFlags( QwtPicker::PointSelection | QwtPicker::ClickSelection );
signalPicker->setRubberBandPen( QColor( Qt::gray ) );
signalPicker->setMousePattern( QwtEventPattern::MouseSelect1, Qt::LeftButton );
signalPicker->setMousePattern( QwtEventPattern::MouseSelect2, Qt::LeftButton, Qt::ControlModifier );
signalPicker->setMousePattern( QwtEventPattern::MouseSelect3, Qt::RightButton );
signalPicker->setMousePattern( QwtEventPattern::MouseSelect4, Qt::RightButton, Qt::ControlModifier );
signalPicker->setEnabled( false );
connect( signalPicker, SIGNAL( selected( QwtDoublePoint) ), this, SLOT( setSelectedPoint( QwtDoublePoint ) ) );
connect( signalPicker, SIGNAL( setLeft() ), this, SLOT( setSignalLeft() ) );
connect( signalPicker, SIGNAL( setRight() ), this, SLOT( setSignalRight() ) );
connect( signalPicker, SIGNAL( clearLeft() ), this, SLOT( resetSignalLeft() ) );
connect( signalPicker, SIGNAL( clearRight() ), this, SLOT( resetSignalRight() ) );
Thanks for your time.
I am trying to create a QwtPlotPicker class that can select left and right boundary points on my QwtPlot. My original idea was to have the left mouse button select the left boundary and the right mouse button to select the right. However, when trying to implement this, I've noticed that I can only get the selected( QwtDoublePoint point ) SIGNAL function to work with only a left mouse button click. Even a CTRL+left mouse button does not emit the signal. Is it possible to have multiple button events emit the selected SIGNAL, or is it only active for QwtEventPatter::MouseSelect1? If it's the latter, I guess I would need to have independent pickers for both the left and the right boundaries?
I am running Qwt 5.2.0.
Here is my code:
signalPicker = new PlotPicker( canvas() );
signalPicker->setSelectionFlags( QwtPicker::PointSelection | QwtPicker::ClickSelection );
signalPicker->setRubberBandPen( QColor( Qt::gray ) );
signalPicker->setMousePattern( QwtEventPattern::MouseSelect1, Qt::LeftButton );
signalPicker->setMousePattern( QwtEventPattern::MouseSelect2, Qt::LeftButton, Qt::ControlModifier );
signalPicker->setMousePattern( QwtEventPattern::MouseSelect3, Qt::RightButton );
signalPicker->setMousePattern( QwtEventPattern::MouseSelect4, Qt::RightButton, Qt::ControlModifier );
signalPicker->setEnabled( false );
connect( signalPicker, SIGNAL( selected( QwtDoublePoint) ), this, SLOT( setSelectedPoint( QwtDoublePoint ) ) );
connect( signalPicker, SIGNAL( setLeft() ), this, SLOT( setSignalLeft() ) );
connect( signalPicker, SIGNAL( setRight() ), this, SLOT( setSignalRight() ) );
connect( signalPicker, SIGNAL( clearLeft() ), this, SLOT( resetSignalLeft() ) );
connect( signalPicker, SIGNAL( clearRight() ), this, SLOT( resetSignalRight() ) );
Thanks for your time.