# HG changeset patch # User insilmaril # Date 1185788827 0 # Node ID b44cc0d3ed4a69fd3226c3b01d0208817413175e # Parent 70b500879182442a25a5e58aba8da549241227c9 1.9.4 New base class for XML based file parsing (vym & Freemind) diff -r 70b500879182 -r b44cc0d3ed4a file.h --- a/file.h Mon Jul 30 09:47:05 2007 +0000 +++ b/file.h Mon Jul 30 09:47:07 2007 +0000 @@ -5,6 +5,7 @@ enum LoadMode {NewMap,ImportAdd,ImportReplace}; enum SaveMode {PartOfMap,CompleteMap,UndoCommand}; +enum FileType {VymMap, FreemindMap}; enum ErrorCode {success,aborted,nozip}; diff -r 70b500879182 -r b44cc0d3ed4a headingobj.cpp --- a/headingobj.cpp Mon Jul 30 09:47:05 2007 +0000 +++ b/headingobj.cpp Mon Jul 30 09:47:07 2007 +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); } }