--- src/ipecanvas/ipecreatetext.cpp 2008-12-27 18:00:12.000000000 +0000 +++ src/ipecanvas/ipecreatetext_new.cpp 2009-01-01 20:52:22.000000000 +0000 @@ -113,6 +113,13 @@ setWindowTitle(caption); connect(buttonOk, SIGNAL(clicked()), this, SLOT(UpdateData())); iLabel->setText(label); + + if (editorFont) { + iEditor->setFont(*editorFont); + } + iEditor->setPlainText(iData); + + /* QTextDocument *doc = new QTextDocument(iEditor); QTextCharFormat format; // format.setBackground(Qt::yellow); @@ -122,6 +129,7 @@ cursor.insertFragment(QTextDocumentFragment::fromPlainText(iData)); iEditor->setDocument(doc); iEditor->setTextCursor(cursor); + */ iEditor->setFocus(); } @@ -140,15 +148,17 @@ void IpeDialogCreateText::SetEditorFont(const QString &font) { - /* + if (!editorFont) { + editorFont = new QFont(); + } if (!font.isEmpty()) { - editorFont.fromString(font); - } else - editorFont = QApplication::font(); - */ + editorFont->fromString(font); + } else { + *editorFont = QApplication::font(); + } } -// QFont IpeDialogCreateText::editorFont; +QFont *IpeDialogCreateText::editorFont = 0; // -------------------------------------------------------------------- --- src/ipecanvas/ipecreatetext.h 2008-12-27 18:00:12.000000000 +0000 +++ src/ipecanvas/ipecreatetext_new.h 2008-12-27 14:31:31.000000000 +0000 @@ -66,6 +66,7 @@ IpeAttribute *iCurrentStyle; IpeAttributeSeq iSizes; IpeAttribute *iCurrentSize; + static QFont *editorFont; }; // --------------------------------------------------------------------