Allow painting of arbitrary number of connection slots.
This commit is contained in:
parent
eb70ac6199
commit
c404e0e590
2 changed files with 8 additions and 3 deletions
|
@ -102,6 +102,10 @@ QGraphicsItem( parent )
|
|||
{
|
||||
m_w = 100;
|
||||
m_h = 100;
|
||||
m_hh = 20.0;
|
||||
|
||||
if( slotCount > 3 )
|
||||
m_h = m_h + 20.0 * ( slotCount - 3 );
|
||||
|
||||
createSlots( slotCount );
|
||||
}
|
||||
|
@ -128,7 +132,7 @@ void ExpressionNode::paint( QPainter *painter, const QStyleOptionGraphicsItem *o
|
|||
|
||||
QRectF rect = boundingRect();
|
||||
QRectF header = rect;
|
||||
header.setHeight( header.height() * 0.2 );
|
||||
header.setHeight( m_hh );
|
||||
|
||||
// Draw filled rectangle, header
|
||||
c.setRed( 44 );
|
||||
|
|
|
@ -56,8 +56,9 @@ private:
|
|||
void createSlots( int count = 3 );
|
||||
void paintSlots( QPainter *painter );
|
||||
|
||||
qreal m_w;
|
||||
qreal m_h;
|
||||
qreal m_w; // node width
|
||||
qreal m_h; // node height
|
||||
qreal m_hh; // header height
|
||||
|
||||
QList< NodeSlot* > m_slots;
|
||||
QList< ExpressionLink* > m_links;
|
||||
|
|
Loading…
Reference in a new issue