X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpPipelineEditor%2FConnection.cxx;h=0d5eea259f9f205824960dbbceafd1e812cc4731;hb=d9e804f90306f67051b8f0c756f0c9148e492d90;hp=59f66c01af8f4e43a0b806113931e2f368960a83;hpb=46f2cf7aa39bda8301b22fcfddd43daf0dc13770;p=cpPlugins.git diff --git a/lib/cpPipelineEditor/Connection.cxx b/lib/cpPipelineEditor/Connection.cxx index 59f66c0..0d5eea2 100644 --- a/lib/cpPipelineEditor/Connection.cxx +++ b/lib/cpPipelineEditor/Connection.cxx @@ -15,6 +15,7 @@ Connection( QGraphicsItem* parent, QGraphicsScene* scene ) this->setZValue( -1 ); this->m_Port1 = NULL; this->m_Port2 = NULL; + this->setFlag( QGraphicsItem::ItemIsSelectable ); } // ------------------------------------------------------------------------- @@ -115,4 +116,25 @@ port2( ) const return( this->m_Port2 ); } +#include + +// ------------------------------------------------------------------------- +void cpPipelineEditor::Connection:: +paint( + QPainter* painter, + const QStyleOptionGraphicsItem* option, + QWidget* widget + ) +{ + Q_UNUSED( option ); + Q_UNUSED( widget ); + + if( this->isSelected( ) ) + painter->setPen( QPen( Qt::red, 5 ) ); + else + painter->setPen( QPen( Qt::black, 2 ) ); + this->setBrush( Qt::NoBrush ); + painter->drawPath( this->path( ) ); +} + // eof - $RCSfile$