Logo Search packages:      
Sourcecode: ktechlab version File versions  Download package

Text * CNItem::addDisplayText ( const QString &  id,
const QRect &  pos,
const QString &  display,
bool  internal = true,
int  flags = Qt::AlignHCenter | Qt::AlignVCenter 
) [protected, inherited]

CNItem handles drawing of text associated with the CNItem.

Parameters:
id is a unique identifier that can be used to change the text displayed.
pos is the position that the text occupies relative to the top left corner of the CNItem.
display is the actual text to be displayed.
internal is used to determine the z-level of the text - whether it should be below or above the item
flags Text alignment flags - Qt::AlignmentFlags and Qt::TextFlags OR'd together.

Definition at line 539 of file cnitem.cpp.

Referenced by Component::initDIPSymbol(), PICComponent::initPackage(), and MultiInputGate::updateSymbolText().

{
      Text *text = 0l;
      TextMap::iterator it = m_textMap.find(id);
      if ( it != m_textMap.end() )
      {
//          kdWarning() << "CNItem::addDisplayText: removing old text"<<endl;
            delete it.data();
            m_textMap.remove(it);
      }
      
      text = new Text( "", this, pos, canvas(), flags );
      text->setZ( z()+(internal?0.1:-0.1) );
      
      m_textMap[id] = text;
      
      // Calculate the correct size
      setDisplayText( id, display );
      text->show();
      return text;
}


Generated by  Doxygen 1.6.0   Back to index