}
break;
}
+ case QEvent::ContextMenu:
+ // Fix from SLN
+ // Do nothing because context menu is called from MouseRelease
+ return true;
}
}
return QWidget::eventFilter( watched, e );
}
fitAll();
//myPlot->setUpdatesEnabled( true );
-// update legend
+ // update legend
if ( update )
myPlot->replot();
}
myPlot->setAxisScale( QwtPlot::yRight, y2min, y2max );
}
myPlot->replot();
+ if ( myPlot->zoomer() ) myPlot->zoomer()->setZoomBase();
}
/*!
myPlot->invTransform( QwtPlot::xBottom, rect.left() ),
myPlot->invTransform( QwtPlot::xBottom, rect.right() ) );
myPlot->replot();
+ if ( myPlot->zoomer() ) myPlot->zoomer()->setZoomBase();
}
/*!
if ( mode == 0 || mode == 1 )
myPlot->setAxisScale( QwtPlot::xBottom, xMin, xMax );
myPlot->replot();
+ if ( myPlot->zoomer() ) myPlot->zoomer()->setZoomBase();
}
/*!
{
myLegendPos = pos;
QwtLegend* legend = myPlot->legend();
- switch( pos ) {
- case 0:
- myPlot->insertLegend( legend, QwtPlot::LeftLegend );
- break;
- case 1:
- myPlot->insertLegend( legend, QwtPlot::RightLegend );
- break;
- case 2:
- myPlot->insertLegend( legend, QwtPlot::TopLegend );
- break;
- case 3:
- myPlot->insertLegend( legend, QwtPlot::BottomLegend );
- break;
+ if ( legend ) {
+ switch( pos ) {
+ case 0:
+ myPlot->insertLegend( legend, QwtPlot::LeftLegend );
+ break;
+ case 1:
+ myPlot->insertLegend( legend, QwtPlot::RightLegend );
+ break;
+ case 2:
+ myPlot->insertLegend( legend, QwtPlot::TopLegend );
+ break;
+ case 3:
+ myPlot->insertLegend( legend, QwtPlot::BottomLegend );
+ break;
+ }
}
}
: QwtPlot( parent ),
myIsPolished( false )
{
+ // Create alternative scales
+ setAxisScaleDraw( QwtPlot::yLeft, new Plot2d_ScaleDraw() );
+ setAxisScaleDraw( QwtPlot::xBottom, new Plot2d_ScaleDraw() );
+ setAxisScaleDraw( QwtPlot::yRight, new Plot2d_ScaleDraw() );
+
myPlotZoomer = new Plot2d_QwtPlotZoomer( QwtPlot::xBottom, QwtPlot::yLeft, canvas() );
myPlotZoomer->setSelectionFlags( QwtPicker::DragSelection | QwtPicker::CornerToCorner );
myPlotZoomer->setTrackerMode( QwtPicker::AlwaysOff );
defaultPicker();
- // Create alternative scales
- setAxisScaleDraw( QwtPlot::yLeft, new Plot2d_ScaleDraw() );
- setAxisScaleDraw( QwtPlot::xBottom, new Plot2d_ScaleDraw() );
- setAxisScaleDraw( QwtPlot::yRight, new Plot2d_ScaleDraw() );
-
// auto scaling by default
setAxisAutoScale( QwtPlot::yLeft );
setAxisAutoScale( QwtPlot::yRight );
{
QwtPlotCurve::updateLegend( legend );
- QWidget* widget = legend->find( this );
- if( Plot2d_QwtLegendItem* anItem = dynamic_cast<Plot2d_QwtLegendItem*>( widget ) ) {
- int aMode = Plot2d_QwtLegendItem::IM_None;
- if( myYAxisIdentifierEnabled )
- aMode = myYAxis == QwtPlot::yRight ?
- Plot2d_QwtLegendItem::IM_Right :
- Plot2d_QwtLegendItem::IM_Left;
- anItem->setYAxisIdentifierMode( aMode );
+ if ( legend ) {
+ QWidget* widget = legend->find( this );
+ if( Plot2d_QwtLegendItem* anItem = dynamic_cast<Plot2d_QwtLegendItem*>( widget ) ) {
+ int aMode = Plot2d_QwtLegendItem::IM_None;
+ if( myYAxisIdentifierEnabled )
+ aMode = myYAxis == QwtPlot::yRight ?
+ Plot2d_QwtLegendItem::IM_Right :
+ Plot2d_QwtLegendItem::IM_Left;
+ anItem->setYAxisIdentifierMode( aMode );
+ }
}
}