Alex22
12th July 2016, 20:22
Hi,
I need to select an area with a RubberBand that returns QRectF::top, QRectF::bottom, QRectF::left, QRectF::right. For this I do this:
QwtPlotZoomer* zoomer = new QwtPlotZoomer( canvas );
zoomer->setRubberBandPen( QColor( Qt::red ) );
zoomer->setTrackerPen( QColor( Qt::green ) );
zoomer->setMousePattern( QwtEventPattern::MouseSelect2,
Qt::RightButton, Qt::ControlModifier );
zoomer->setMousePattern( QwtEventPattern::MouseSelect3,
Qt::RightButton );
and by using zoomed (const QRectF &rect) signal, rect can be obtain.
connect(zoomer, zoomed (QRectF), this, slot_pos(QRectF));
void MyClass::slot_pos(QRectF pos)
{
qDebug() << pos.top << pos.bottom << pos.left << pos.right;
}
now I have this problem:
Mouse LeftButton causes zooming. I want to to select an area with a RubberBand without zooming by for example LeftButton +ctrl.
I need to select an area with a RubberBand that returns QRectF::top, QRectF::bottom, QRectF::left, QRectF::right. For this I do this:
QwtPlotZoomer* zoomer = new QwtPlotZoomer( canvas );
zoomer->setRubberBandPen( QColor( Qt::red ) );
zoomer->setTrackerPen( QColor( Qt::green ) );
zoomer->setMousePattern( QwtEventPattern::MouseSelect2,
Qt::RightButton, Qt::ControlModifier );
zoomer->setMousePattern( QwtEventPattern::MouseSelect3,
Qt::RightButton );
and by using zoomed (const QRectF &rect) signal, rect can be obtain.
connect(zoomer, zoomed (QRectF), this, slot_pos(QRectF));
void MyClass::slot_pos(QRectF pos)
{
qDebug() << pos.top << pos.bottom << pos.left << pos.right;
}
now I have this problem:
Mouse LeftButton causes zooming. I want to to select an area with a RubberBand without zooming by for example LeftButton +ctrl.