- QNEPort* port = new QNEPort( this );\r
- port->setName( name );\r
- port->setIsOutput( isOutput );\r
- port->setNEBlock( this );\r
- port->setPortFlags( flags );\r
- port->setPtr( ptr );\r
-\r
- QFontMetrics fm( this->scene( )->font( ) );\r
- int w = fm.width( name );\r
- int h = fm.height( );\r
- if( w > this->m_Width - this->m_HorzMargin )\r
- this->m_Width = w + this->m_HorzMargin;\r
- this->m_Height += h;\r
-\r
- QPainterPath p;\r
- p.addRoundedRect(\r
- -this->m_Width / 2,\r
- -this->m_Height / 2,\r
- this->m_Width,\r
- this->m_Height, 5, 5\r
- );\r
- this->setPath( p );\r
-\r
- int y = -this->m_Height / 2 + this->m_VertMargin + port->radius( );\r
- foreach( QGraphicsItem* port_, children( ) )\r
- {\r
- if( port_->type( ) != QNEPort::Type )\r
- continue;\r
-\r
- QNEPort* port = ( QNEPort* ) port_;\r
- if( port->isOutput( ) )\r
- port->setPos( this->m_Width/2 + port->radius( ), y );\r
- else\r
- port->setPos( -this->m_Width/2 - port->radius( ), y );\r
- y += h;\r
-\r
- } // rof\r
- return( port );\r
+ if( this->m_NamePort == NULL )\r
+ this->m_NamePort = new QNENamePort( this );\r
+ this->m_NamePort->setName( txt );\r
+ this->m_Filter->SetName( txt.toStdString( ) );\r
+ this->_configPort( this->m_NamePort );\r