From: nds Date: Tue, 27 Dec 2005 08:14:02 +0000 (+0000) Subject: Correction: parent of Plot2d_ViewFrame can be not only class Plot2d_ViewWindow. X-Git-Tag: T_Before_Join_BR_3_1_0deb X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b7a0228e654675baeb0903e6a45fd39517755119;p=modules%2Fgui.git Correction: parent of Plot2d_ViewFrame can be not only class Plot2d_ViewWindow. --- 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; } /*!