]> Creatis software - cpPlugins.git/blobdiff - lib/cpPipelineEditor/Connection.cxx
...
[cpPlugins.git] / lib / cpPipelineEditor / Connection.cxx
index 59f66c01af8f4e43a0b806113931e2f368960a83..0d5eea259f9f205824960dbbceafd1e812cc4731 100644 (file)
@@ -15,6 +15,7 @@ Connection( QGraphicsItem* parent, QGraphicsScene* scene )
   this->setZValue( -1 );\r
   this->m_Port1 = NULL;\r
   this->m_Port2 = NULL;\r
+  this->setFlag( QGraphicsItem::ItemIsSelectable );\r
 }\r
 \r
 // -------------------------------------------------------------------------\r
@@ -115,4 +116,25 @@ port2( ) const
   return( this->m_Port2 );\r
 }\r
 \r
+#include <QPainter>\r
+\r
+// -------------------------------------------------------------------------\r
+void cpPipelineEditor::Connection::\r
+paint(\r
+  QPainter* painter,\r
+  const QStyleOptionGraphicsItem* option,\r
+  QWidget* widget\r
+  )\r
+{\r
+  Q_UNUSED( option );\r
+  Q_UNUSED( widget );\r
+\r
+  if( this->isSelected( ) )\r
+    painter->setPen( QPen( Qt::red, 5 ) );\r
+  else\r
+    painter->setPen( QPen( Qt::black, 2 ) );\r
+  this->setBrush( Qt::NoBrush );\r
+  painter->drawPath( this->path( ) );\r
+}\r
+\r
 // eof - $RCSfile$\r