diff -r 627c4a0fd0e7 -r c3690ec91ef8 src/hbwidgets/editors/hbabstractedit_p.cpp --- a/src/hbwidgets/editors/hbabstractedit_p.cpp Fri Jun 11 13:58:22 2010 +0300 +++ b/src/hbwidgets/editors/hbabstractedit_p.cpp Wed Jun 23 18:33:25 2010 +0300 @@ -45,7 +45,7 @@ #include "hbcolorscheme.h" #include "hbsmileyengine_p.h" #include "hbtextmeasurementutility_p.h" -#include "hbfeaturemanager_p.h" +#include "hbfeaturemanager_r.h" #include "hbinputeditorinterface.h" #include "hbinputvkbhost.h" @@ -198,7 +198,8 @@ wasGesture(false), smileysEnabled(false), smileyEngine(0), - formatDialog(0) + formatDialog(0), + updatePrimitivesInProgress(false) { } @@ -211,6 +212,8 @@ Q_Q(HbAbstractEdit); canvas = new HbEditItem(q); + canvas->setSizePolicy(QSizePolicy::Ignored,QSizePolicy::Ignored); + setContent(Qt::RichText, QString()); @@ -238,6 +241,7 @@ q->setFlag(QGraphicsItem::ItemIsFocusable); q->setFlag(QGraphicsItem::ItemAcceptsInputMethod); q->setFlag(QGraphicsItem::ItemSendsScenePositionChanges); + q->setFlag(QGraphicsItem::ItemHasNoContents, false); q->setFocusPolicy(Qt::StrongFocus); q->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); @@ -368,6 +372,10 @@ void HbAbstractEditPrivate::setCursorPosition(int pos, QTextCursor::MoveMode mode) { + if (cursor.isNull()) { + cursor = QTextCursor(doc); + } + cursor.setPosition(pos, mode); cursorChanged(HbValidator::CursorChangeFromMouse); @@ -972,7 +980,7 @@ QTextLayout *layout = cursor.block().layout(); int cursorPos = hitTest(tapPos, Qt::ExactHit); - if (cursorPos == -1) { + if (layout && cursorPos == -1) { cursorPos = cursor.position() + layout->preeditAreaText().length(); }