]> Creatis software - cpPlugins.git/blob - libs/cpPipelineEditor/Block.cxx
...
[cpPlugins.git] / libs / cpPipelineEditor / Block.cxx
1 #include <cpPipelineEditor/Block.h>
2 #include <QPainter>
3
4 // -------------------------------------------------------------------------
5 cpPipelineEditor::Block::
6 Block( QGraphicsItem* parent, QGraphicsScene* scene )
7   : Superclass( parent, scene )
8 {
9   this->m_SelectedColor = Qt::darkYellow;
10   this->m_NotSelectedColor = Qt::darkGreen;
11 }
12
13 // -------------------------------------------------------------------------
14 cpPipelineEditor::Block::
15 ~Block( )
16 {
17 }
18
19 // -------------------------------------------------------------------------
20 void cpPipelineEditor::Block::
21 paint(
22   QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget
23   )
24 {
25   Q_UNUSED( option );
26   Q_UNUSED( widget );
27
28   if( this->isSelected( ) )
29   {
30     painter->setPen( QPen( this->m_SelectedColor ) );
31     painter->setBrush( this->m_SelectedColor );
32   }
33   else
34   {
35     painter->setPen( QPen( this->m_NotSelectedColor ) );
36     painter->setBrush( this->m_NotSelectedColor );
37
38   } // fi
39   painter->drawPath( this->path( ) );
40
41 }
42
43 // eof - $RCSfile$