]> Creatis software - cpPlugins.git/commitdiff
...
authorLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Wed, 13 Jan 2016 02:55:52 +0000 (21:55 -0500)
committerLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Wed, 13 Jan 2016 02:55:52 +0000 (21:55 -0500)
appli/cpPipelineEditor/QNodesEditor.cxx

index 051adde37951d18bb0b5294b46574e29f233f554..99db8a6becab35b054a29b09592da756009c1df6 100644 (file)
@@ -355,7 +355,10 @@ eventFilter( QObject* o, QEvent* e )
     {\r
       if( this->m_Conn )\r
       {\r
-        this->m_Conn->setPos2( evt->scenePos( ) );\r
+        if( this->m_Conn->port1( ) == NULL )\r
+          this->m_Conn->setPos1( evt->scenePos( ) );\r
+        else if( this->m_Conn->port2( ) == NULL )\r
+          this->m_Conn->setPos2( evt->scenePos( ) );\r
         this->m_Conn->updatePath( );\r
         return( true );\r
 \r
@@ -378,12 +381,16 @@ eventFilter( QObject* o, QEvent* e )
           dynamic_cast< QNEOutputPort* >( this->itemAt( evt->scenePos( ) ) );\r
         if( port != NULL )\r
         {\r
-          this->m_Conn = new QNEConnection( 0, this->m_Scene );\r
-          this->m_Conn->setPort1( port );\r
-          this->m_Conn->setPos1( port->scenePos( ) );\r
-          this->m_Conn->setPos2( evt->scenePos( ) );\r
-          this->m_Conn->updatePath( );\r
-          return( true );\r
+          if( port->block( ) != NULL )\r
+          {\r
+            this->m_Conn = new QNEConnection( 0, this->m_Scene );\r
+            this->m_Conn->setPort1( port );\r
+            this->m_Conn->setPos1( port->scenePos( ) );\r
+            this->m_Conn->setPos2( evt->scenePos( ) );\r
+            this->m_Conn->updatePath( );\r
+            return( true );\r
+\r
+          } // fi\r
 \r
         } // fi\r
       }\r
@@ -396,7 +403,7 @@ eventFilter( QObject* o, QEvent* e )
           dynamic_cast< QNEOutputPort* >( this->itemAt( evt->scenePos( ) ) );\r
         if( in_port != NULL )\r
         {\r
-          if( in_port->connection( ) == NULL )\r
+          if( in_port->connection( ) == NULL && in_port->block( ) != NULL )\r
           {\r
             this->m_Conn = new QNEConnection( 0, this->m_Scene );\r
             this->m_Conn->setPort2( in_port );\r
@@ -407,7 +414,7 @@ eventFilter( QObject* o, QEvent* e )
 \r
           } // fi\r
         }\r
-        else if( out_port != NULL )\r
+        else if( out_port != NULL && out_port->block( ) != NULL )\r
         {\r
           this->m_Conn = new QNEConnection( 0, this->m_Scene );\r
           this->m_Conn->setPort1( out_port );\r
@@ -508,8 +515,6 @@ eventFilter( QObject* o, QEvent* e )
             dynamic_cast< QNEOutputPort* >(\r
               this->itemAt( evt->scenePos( ) )\r
               ) == NULL\r
-            /*&&\r
-            port2->connection( ) == NULL*/\r
             )\r
           {\r
             port1 = new QNEOutputPort( NULL, this->m_Scene );\r