X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FGraphicsView%2FGraphicsView_ViewPort.cxx;h=2d0cbc40c56871d6854f3ff3a1d947d0d391cade;hb=refs%2Ftags%2FV9_11_0;hp=4b3dafd5fc58e358995eb5757971ef61e8cc68c7;hpb=533affbecb3e001b103b2e7c41af58e33e4cce9c;p=modules%2Fgui.git diff --git a/src/GraphicsView/GraphicsView_ViewPort.cxx b/src/GraphicsView/GraphicsView_ViewPort.cxx index 4b3dafd5f..2d0cbc40c 100644 --- a/src/GraphicsView/GraphicsView_ViewPort.cxx +++ b/src/GraphicsView/GraphicsView_ViewPort.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2013-2016 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2013-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 @@ -285,7 +285,7 @@ void GraphicsView_ViewPort::addItem( QGraphicsItem* theItem ) //================================================================ bool GraphicsView_ViewPort::isItemAdded( QGraphicsItem* theItem ) { - if( GraphicsView_Object* anObject = dynamic_cast( theItem ) ) + if( dynamic_cast( theItem ) ) { for( GraphicsView_ObjectList::iterator anIter = myObjects.begin(); anIter != myObjects.end(); anIter++ ) if( theItem == *anIter ) @@ -480,11 +480,7 @@ bool GraphicsView_ViewPort::dumpViewToFormat(const QString& fileName, const QStr return false; QPrinter printer(QPrinter::ScreenResolution); -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) - printer.setOutputFormat(QPrinter::PostScriptFormat); -#else printer.setOutputFormat(QPrinter::PdfFormat); -#endif printer.setOutputFileName(fileName); QPainter painter; if (!painter.begin(&printer)) @@ -1108,7 +1104,6 @@ void GraphicsView_ViewPort::highlight( double theX, double theY ) bool anIsHighlighted = false; bool anIsOnObject = false; - GraphicsView_Object* aPreviousHighlightedObject = myHighlightedObject; GraphicsView_Object* aHighlightedObject = 0; QCursor aCursor; @@ -1259,7 +1254,6 @@ int GraphicsView_ViewPort::select( const QRectF& theRect, bool theIsAppend ) { aStatus = GVSS_NoChanged; - bool updateAll = false; if( !theIsAppend ) { if( !mySelectedObjects.isEmpty() ) @@ -1609,8 +1603,8 @@ void GraphicsView_ViewPort::dragObjects( QGraphicsSceneMouseEvent* e ) else anObjectsToMove.append( anObject ); } - else if( ( hasInteractionFlag( DraggingByMiddleButton ) && ( e->buttons() & Qt::MidButton ) || - isDraggingSelectedByLeftButton() && ( e->buttons() & Qt::LeftButton ) ) && + else if( ( ( hasInteractionFlag( DraggingByMiddleButton ) && ( e->buttons() & Qt::MidButton ) ) || + ( isDraggingSelectedByLeftButton() && ( e->buttons() & Qt::LeftButton ) ) ) && nbSelected() ) { for( initSelected(); moreSelected(); nextSelected() ) @@ -1806,8 +1800,8 @@ void GraphicsView_ViewPort::onMouseEvent( QGraphicsSceneMouseEvent* e ) if( ( getHighlightedObject() && getHighlightedObject()->isMovable() && !( anAccel || e->button() != Qt::LeftButton ) ) || - ( ( hasInteractionFlag( DraggingByMiddleButton ) && e->button() == Qt::MidButton || - isDraggingSelectedByLeftButton() && e->button() == Qt::LeftButton ) && + ( ( ( hasInteractionFlag( DraggingByMiddleButton ) && e->button() == Qt::MidButton ) || + ( isDraggingSelectedByLeftButton() && e->button() == Qt::LeftButton ) ) && nbSelected() && !anAccel ) ) { myIsDragging = true;