From: Leonardo Florez-Valencia Date: Wed, 13 Jan 2016 02:55:52 +0000 (-0500) Subject: ... X-Git-Tag: v0.1~272 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=f8c546490b7168b5c75d877bf66d27f83aa9412c;p=cpPlugins.git ... --- diff --git a/appli/cpPipelineEditor/QNodesEditor.cxx b/appli/cpPipelineEditor/QNodesEditor.cxx index 051adde..99db8a6 100644 --- a/appli/cpPipelineEditor/QNodesEditor.cxx +++ b/appli/cpPipelineEditor/QNodesEditor.cxx @@ -355,7 +355,10 @@ eventFilter( QObject* o, QEvent* e ) { if( this->m_Conn ) { - this->m_Conn->setPos2( evt->scenePos( ) ); + if( this->m_Conn->port1( ) == NULL ) + this->m_Conn->setPos1( evt->scenePos( ) ); + else if( this->m_Conn->port2( ) == NULL ) + this->m_Conn->setPos2( evt->scenePos( ) ); this->m_Conn->updatePath( ); return( true ); @@ -378,12 +381,16 @@ eventFilter( QObject* o, QEvent* e ) dynamic_cast< QNEOutputPort* >( this->itemAt( evt->scenePos( ) ) ); if( port != NULL ) { - this->m_Conn = new QNEConnection( 0, this->m_Scene ); - this->m_Conn->setPort1( port ); - this->m_Conn->setPos1( port->scenePos( ) ); - this->m_Conn->setPos2( evt->scenePos( ) ); - this->m_Conn->updatePath( ); - return( true ); + if( port->block( ) != NULL ) + { + this->m_Conn = new QNEConnection( 0, this->m_Scene ); + this->m_Conn->setPort1( port ); + this->m_Conn->setPos1( port->scenePos( ) ); + this->m_Conn->setPos2( evt->scenePos( ) ); + this->m_Conn->updatePath( ); + return( true ); + + } // fi } // fi } @@ -396,7 +403,7 @@ eventFilter( QObject* o, QEvent* e ) dynamic_cast< QNEOutputPort* >( this->itemAt( evt->scenePos( ) ) ); if( in_port != NULL ) { - if( in_port->connection( ) == NULL ) + if( in_port->connection( ) == NULL && in_port->block( ) != NULL ) { this->m_Conn = new QNEConnection( 0, this->m_Scene ); this->m_Conn->setPort2( in_port ); @@ -407,7 +414,7 @@ eventFilter( QObject* o, QEvent* e ) } // fi } - else if( out_port != NULL ) + else if( out_port != NULL && out_port->block( ) != NULL ) { this->m_Conn = new QNEConnection( 0, this->m_Scene ); this->m_Conn->setPort1( out_port ); @@ -508,8 +515,6 @@ eventFilter( QObject* o, QEvent* e ) dynamic_cast< QNEOutputPort* >( this->itemAt( evt->scenePos( ) ) ) == NULL - /*&& - port2->connection( ) == NULL*/ ) { port1 = new QNEOutputPort( NULL, this->m_Scene );