-// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2023 CEA, EDF, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
else
avp->setCursor( Qt::ForbiddenCursor );
- if ( e->type() == QEvent::MouseButtonRelease && e->button() == sketchButton() )
+ if ( e->type() == QEvent::MouseButtonRelease && (int)e->button() == sketchButton() ) // todo Qt::MouseButton is unsigned int: comparison of int with uint
{
myResult = Accept;
QApplication::postEvent( avp, new QMouseEvent( e->type(), e->pos(),
if ( e->type() == QEvent::MouseButtonRelease && ( e->button() & sketchButton() ) )
{
- myResult = Reject;
+ myResult = (closed && (points->count() > 2)) ? Accept : Reject;
QApplication::postEvent( avp, new QMouseEvent( e->type(), e->pos(),
e->globalPos(), e->button(),
e->buttons(), e->modifiers() ) );
return true;
bool res = true;
- for ( uint i = 0; i < aPoints->count() - 1 && res; i++ )
+ for ( int i = 0; i < aPoints->count() - 1 && res; i++ )
{
const QPoint& aStart = aPoints->point( i );
const QPoint& anEnd = aPoints->point( i + 1 );