diff -r 9ae68208e2ff -r 8be6ac05960b headingobj.cpp --- a/headingobj.cpp Mon Feb 19 12:01:52 2007 +0000 +++ b/headingobj.cpp Wed Jan 16 15:45:18 2008 +0000 @@ -80,7 +80,7 @@ // then no selection would be visible, thus we prevent it in ::setText() if (!textline.isEmpty() ) { - for (int i=0; iboundingRect().height(); if (wboundingRect().width() ) @@ -90,13 +90,17 @@ bbox.setSize (QSizeF(w,h)); } -QGraphicsSimpleTextItem* HeadingObj::newLine(QString s) +//QGraphicsSimpleTextItem* HeadingObj::newLine(QString s) +QGraphicsTextItem* HeadingObj::newLine(QString s) { - QGraphicsSimpleTextItem *t=new QGraphicsSimpleTextItem (s,0,scene); + //QGraphicsSimpleTextItem *t=new QGraphicsSimpleTextItem (s,0,scene); + QGraphicsTextItem *t=new QGraphicsTextItem (s,0,scene); t->setFont (font); t->setZValue(Z_TEXT); - //t->setDefaultTextColor(color); - t->setBrush(color); + // TextItem + t->setDefaultTextColor(color); + // SimpleTextItem + //t->setBrush(color); return t; } @@ -108,6 +112,21 @@ while (!textline.isEmpty()) delete textline.takeFirst(); + if (s.startsWith("")) + { + QGraphicsTextItem *t=new QGraphicsTextItem (); + t->setFont (font); + t->setZValue(Z_TEXT); + t->setHtml (s); + t->setDefaultTextColor(color); + scene->addItem (t); + textline.append (t); + setVisibility (visible); + move (absPos.x(),absPos.y()); + calcBBoxSize(); + return; + } + // prevent empty textline, so at least a small selection stays // visible for this heading if (s.length()==0) s=" "; @@ -218,8 +237,10 @@ { color=c; for (int i=0; isetDefaultTextColor(c); - textline.at(i)->setBrush(c); + // TextItem + textline.at(i)->setDefaultTextColor(c); + // SimpleTextItem + //textline.at(i)->setBrush(c); } }