X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSVTK%2FSVTK_InteractorStyle.cxx;h=cd5396b4261a85e212bf36b2c5376d81b5881216;hb=refs%2Fheads%2Fngr%2Fpython3_dev_pv5.4;hp=bc55113a3481007f78e154496e93c0368710d0ae;hpb=26ac7ca874ce9a796ff7ad43685f42afca635df9;p=modules%2Fgui.git diff --git a/src/SVTK/SVTK_InteractorStyle.cxx b/src/SVTK/SVTK_InteractorStyle.cxx index bc55113a3..cd5396b42 100644 --- a/src/SVTK/SVTK_InteractorStyle.cxx +++ b/src/SVTK/SVTK_InteractorStyle.cxx @@ -57,9 +57,10 @@ #include #include +#include + #include #include -#include #include #include @@ -1616,17 +1617,28 @@ void SVTK_InteractorStyle::DominantCombinedSwitch() */ void SVTK_InteractorStyle::drawRect() { - if ( !myRectBand ) { - myRectBand = new QRubberBand( QRubberBand::Rectangle, GetRenderWidget() ); - QPalette palette; - palette.setColor(myRectBand->foregroundRole(), Qt::white); - myRectBand->setPalette(palette); - } - myRectBand->hide(); + if ( !myRectBand ) + myRectBand = new QtxRectRubberBand( GetRenderWidget() ); + myRectBand->setUpdatesEnabled ( false ); QRect aRect = SUIT_Tools::makeRect(myPoint.x(), myPoint.y(), myOtherPoint.x(), myOtherPoint.y()); - myRectBand->setGeometry( aRect ); - myRectBand->setVisible( aRect.isValid() ); + myRectBand->initGeometry( aRect ); + + if ( !myRectBand->isVisible() ) + myRectBand->show(); + + myRectBand->setUpdatesEnabled ( true ); +} + +/*! + \brief Delete rubber band on the end on the dragging operation. +*/ +void SVTK_InteractorStyle::endDrawRect() +{ + if ( myRectBand ) { + myRectBand->clearGeometry(); + myRectBand->hide(); + } } bool isIntersect( const QPoint& theStart1, const QPoint& theEnd1, @@ -1754,17 +1766,6 @@ void SVTK_InteractorStyle::drawPolygon() } } -/*! - \brief Delete rubber band on the end on the dragging operation. -*/ -void SVTK_InteractorStyle::endDrawRect() -{ - if ( myRectBand ) myRectBand->hide(); - - delete myRectBand; - myRectBand = 0; -} - /*! \brief Delete rubber band on the end on the dragging operation. */