1 #include <cpPipelineEditor/Block.h>
4 // -------------------------------------------------------------------------
5 cpPipelineEditor::Block::
6 Block( QGraphicsItem* parent, QGraphicsScene* scene )
7 : Superclass( parent, scene )
9 this->m_SelectedColor = Qt::darkYellow;
10 this->m_NotSelectedColor = Qt::darkGreen;
13 p.addRoundedRect( -50, -50, 50, 50, 5, 5 );
16 this->setPen( QPen( this->m_NotSelectedColor ) );
17 this->setBrush( this->m_NotSelectedColor );
18 this->setFlag( QGraphicsItem::ItemIsMovable );
19 this->setFlag( QGraphicsItem::ItemIsSelectable );
22 // -------------------------------------------------------------------------
23 cpPipelineEditor::Block::
28 // -------------------------------------------------------------------------
29 void cpPipelineEditor::Block::
31 QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget
37 if( this->isSelected( ) )
39 painter->setPen( QPen( this->m_SelectedColor ) );
40 painter->setBrush( this->m_SelectedColor );
44 painter->setPen( QPen( this->m_NotSelectedColor ) );
45 painter->setBrush( this->m_NotSelectedColor );
48 painter->drawPath( this->path( ) );