From ce0ff6de3d6f8715f6b7d18cdcb2f4b6a3a0c548 Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Thu, 9 Jul 2009 16:40:15 +1000 Subject: Fix QFxTextEdit cursor delegate for multi-line and font changes They weren't handled before, and now they are. --- src/declarative/fx/qfxtextedit.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/declarative/fx/qfxtextedit.cpp b/src/declarative/fx/qfxtextedit.cpp index 87a27d9..ef56cc8 100644 --- a/src/declarative/fx/qfxtextedit.cpp +++ b/src/declarative/fx/qfxtextedit.cpp @@ -538,6 +538,7 @@ void QFxTextEdit::loadCursorDelegate() d->control->setCursorWidth(0); dirtyCache(cursorRect()); d->cursor->setItemParent(this); + d->cursor->setHeight(QFontMetrics(d->font.font()).height()); moveCursorDelegate(); }else{ qWarning() << "Error loading cursor delegate for TextEdit:" + objectName(); @@ -1020,6 +1021,10 @@ void QFxTextEdit::fontChanged() Q_D(QFxTextEdit); clearCache(); d->document->setDefaultFont(d->font.font()); + if(d->cursor){ + d->cursor->setHeight(QFontMetrics(d->font.font()).height()); + moveCursorDelegate(); + } updateSize(); emit update(); } -- cgit v0.12