From a9382a9548e8890560b0d6bcf246a4a860c5235f Mon Sep 17 00:00:00 2001 From: ouv Date: Tue, 2 Sep 2008 11:53:13 +0000 Subject: [PATCH] QRect replaced with QRectF --- src/GLViewer/GLViewer_Geom.h | 9 +++++++++ src/GLViewer/GLViewer_Object.cxx | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/GLViewer/GLViewer_Geom.h b/src/GLViewer/GLViewer_Geom.h index 13397fce4..bceac3094 100644 --- a/src/GLViewer/GLViewer_Geom.h +++ b/src/GLViewer/GLViewer_Geom.h @@ -28,6 +28,7 @@ #include "GLViewer.h" #include +#include #include #include @@ -74,6 +75,9 @@ public: GLViewer_Rect( QRect theRect ) { myLeft = ( float )theRect.left(); myRight = ( float )theRect.right(); myTop = ( float )theRect.top(); myBottom = ( float )theRect.bottom(); } + GLViewer_Rect( QRectF theRect ) { + myLeft = theRect.left(); myRight = theRect.right(); + myTop = theRect.top(); myBottom = theRect.bottom(); } float left() const { return myLeft; } float right() const { return myRight; } @@ -96,6 +100,11 @@ public: ( int )( myRight - myLeft ), ( int )( myTop - myBottom ) ); } + //! \warning This method translate only rect format + QRectF toQRectF() { return QRectF( myLeft, myBottom, + myRight - myLeft, + myTop - myBottom ); } + //! On/off empty status void setIsEmpty( bool on ) { myIsEmpty = on; } //! Checks empty status diff --git a/src/GLViewer/GLViewer_Object.cxx b/src/GLViewer/GLViewer_Object.cxx index cfd6a51a5..f0cfefe4f 100644 --- a/src/GLViewer/GLViewer_Object.cxx +++ b/src/GLViewer/GLViewer_Object.cxx @@ -95,7 +95,7 @@ int GLViewer_Object::getPriority() const */ GLboolean GLViewer_Object::isInside( GLViewer_Rect theRect ) { - return theRect.toQRect().contains( myRect->toQRect() ); + return theRect.toQRectF().contains( myRect->toQRectF() ); } /*! -- 2.39.2