From b7a0228e654675baeb0903e6a45fd39517755119 Mon Sep 17 00:00:00 2001 From: nds Date: Tue, 27 Dec 2005 08:14:02 +0000 Subject: [PATCH] Correction: parent of Plot2d_ViewFrame can be not only class Plot2d_ViewWindow. --- src/Plot2d/Plot2d_ViewFrame.cxx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Plot2d/Plot2d_ViewFrame.cxx b/src/Plot2d/Plot2d_ViewFrame.cxx index 999e62403..e43e40cee 100755 --- a/src/Plot2d/Plot2d_ViewFrame.cxx +++ b/src/Plot2d/Plot2d_ViewFrame.cxx @@ -1390,7 +1390,9 @@ bool Plot2d_ViewFrame::isModeVerLinear() */ void Plot2d_ViewFrame::plotMousePressed(const QMouseEvent& me ) { - ((Plot2d_ViewWindow*)parent())->putInfo(getInfo(me.pos())); + Plot2d_ViewWindow* aParent = dynamic_cast(parent()); + if (aParent) + aParent->putInfo(getInfo(me.pos())); if ( myOperation == NoOpId ) myOperation = testOperation( me ); if ( myOperation != NoOpId ) { @@ -1471,7 +1473,9 @@ void Plot2d_ViewFrame::plotMouseMoved( const QMouseEvent& me ) } } else { - ((Plot2d_ViewWindow*)parent())->putInfo(getInfo(me.pos())); + Plot2d_ViewWindow* aParent = dynamic_cast(parent()); + if (aParent) + aParent->putInfo(getInfo(me.pos())); } } /*! @@ -1493,7 +1497,9 @@ void Plot2d_ViewFrame::plotMouseReleased( const QMouseEvent& me ) myPlot->canvas()->setCursor( QCursor( Qt::CrossCursor ) ); myPlot->setOutlineStyle( Qwt::Triangle ); - ((Plot2d_ViewWindow*)parent())->putInfo(tr("INF_READY")); + Plot2d_ViewWindow* aParent = dynamic_cast(parent()); + if (aParent) + aParent->putInfo(tr("INF_READY")); myOperation = NoOpId; } /*! -- 2.39.2