664 |
665 |
665 void HbAbstractEditPrivate::_q_selectionChanged() |
666 void HbAbstractEditPrivate::_q_selectionChanged() |
666 { |
667 { |
667 Q_Q(HbAbstractEdit); |
668 Q_Q(HbAbstractEdit); |
668 |
669 |
669 if (cursor.hasSelection()) { |
670 if (cursor.hasSelection()) { |
670 selectionControl = HbSelectionControl::attachEditor(q); |
671 selectionControl = HbSelectionControl::attachEditor(q); |
671 selectionControl->showHandles(); |
672 selectionControl->showHandles(); |
672 } else if (selectionControl){ |
673 } else if (selectionControl){ |
673 selectionControl->hideHandles(); |
674 selectionControl->hideHandles(); |
674 } |
675 } |
675 |
676 |
676 QTextCursor oldSelection(selectionCursor); |
677 QTextCursor oldSelection(selectionCursor); |
677 selectionCursor = cursor; |
678 selectionCursor = cursor; |
678 repaintOldAndNewSelection(oldSelection); |
679 repaintOldAndNewSelection(oldSelection); |
679 } |
680 } |
680 |
681 |
1047 { |
1048 { |
1048 Q_Q(HbAbstractEdit); |
1049 Q_Q(HbAbstractEdit); |
1049 |
1050 |
1050 doc = newDoc; |
1051 doc = newDoc; |
1051 cursor = QTextCursor(doc); |
1052 cursor = QTextCursor(doc); |
|
1053 if(smileysEnabled) { |
|
1054 smileyEngineInstance()->setDocument(doc); |
|
1055 } |
1052 |
1056 |
1053 QObject::connect(doc, SIGNAL(contentsChanged()), q, SLOT(_q_contentsChanged())); |
1057 QObject::connect(doc, SIGNAL(contentsChanged()), q, SLOT(_q_contentsChanged())); |
1054 QObject::connect(doc, SIGNAL(contentsChange(int, int, int)), q, SLOT(_q_contentsChange(int, int, int))); |
1058 QObject::connect(doc, SIGNAL(contentsChange(int, int, int)), q, SLOT(_q_contentsChange(int, int, int))); |
1055 QObject::connect(doc, SIGNAL(documentLayoutChanged()), q, SLOT(documentLayoutChanged())); |
1059 QObject::connect(doc, SIGNAL(documentLayoutChanged()), q, SLOT(documentLayoutChanged())); |
1056 QObject::connect(doc, SIGNAL(blockCountChanged(int)), q, SLOT(blockCountChanged(int))); |
1060 QObject::connect(doc, SIGNAL(blockCountChanged(int)), q, SLOT(blockCountChanged(int))); |