summaryrefslogtreecommitdiffstats
path: root/src/declarative/fx/qfxtextedit.cpp
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2009-07-09 06:40:15 (GMT)
committerAlan Alpert <alan.alpert@nokia.com>2009-07-09 06:40:15 (GMT)
commitce0ff6de3d6f8715f6b7d18cdcb2f4b6a3a0c548 (patch)
tree84ce25c23e43834b52f38fb1b7458e39cde9035e /src/declarative/fx/qfxtextedit.cpp
parent7343bbb230161d563b0226011e4519f695fdc593 (diff)
downloadQt-ce0ff6de3d6f8715f6b7d18cdcb2f4b6a3a0c548.zip
Qt-ce0ff6de3d6f8715f6b7d18cdcb2f4b6a3a0c548.tar.gz
Qt-ce0ff6de3d6f8715f6b7d18cdcb2f4b6a3a0c548.tar.bz2
Fix QFxTextEdit cursor delegate for multi-line and font changes
They weren't handled before, and now they are.
Diffstat (limited to 'src/declarative/fx/qfxtextedit.cpp')
-rw-r--r--src/declarative/fx/qfxtextedit.cpp5
1 files changed, 5 insertions, 0 deletions
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();
}