GLViewer_ViewPort( parent ),
myMargin( MARGIN ), myWidth( WIDTH ), myHeight( HEIGHT ),
myXScale( 1.0 ), myYScale( 1.0 ), myXOldScale( 1.0 ), myYOldScale( 1.0 ),
- myXPan( 0.0 ), myYPan( 0.0 )
+ myXPan( 0.0 ), myYPan( 0.0 ),
+ myIsMouseReleaseBlock( false )
{
if( theViewFrame == NULL )
myViewFrame = ( GLViewer_ViewFrame* )parent;
*/
void GLViewer_ViewPort2d::mouseReleaseEvent( QMouseEvent* e )
{
+ if ( myIsMouseReleaseBlock )
+ {
+ // skip mouse release after double click
+ myIsMouseReleaseBlock = false;
+ return;
+ }
+
/* show popup menu */
if ( e->button() == Qt::RightButton )
{
}
}
+void GLViewer_ViewPort2d::mouseDoubleClickEvent( QMouseEvent * e )
+{
+ //redefined to block mouse release after mouse double click
+ myIsMouseReleaseBlock = true;
+ // invoke base implementation
+ GLViewer_ViewPort::mouseDoubleClickEvent( e );
+}
+
void GLViewer_ViewPort2d::turnCompass( GLboolean on )
{
if( on )
virtual void mouseMoveEvent( QMouseEvent *);
virtual void mousePressEvent( QMouseEvent *);
virtual void mouseReleaseEvent( QMouseEvent *);
+ virtual void mouseDoubleClickEvent( QMouseEvent *);
virtual void paintEvent( QPaintEvent* );
virtual void resizeEvent( QResizeEvent* );
//GLViewer_ObjectTip* myObjectTip;
QtxToolTip* myObjectTip;
+ //! flag to block mouse release event just after mouse double-click
+ bool myIsMouseReleaseBlock;
};
#ifdef WNT