equal
deleted
inserted
replaced
28 #include "hbsmileyengine_p.h" |
28 #include "hbsmileyengine_p.h" |
29 |
29 |
30 #include <QTextCursor> |
30 #include <QTextCursor> |
31 |
31 |
32 #ifdef HB_TEXT_MEASUREMENT_UTILITY |
32 #ifdef HB_TEXT_MEASUREMENT_UTILITY |
33 #include "hbtextmeasurementutility_p.h" |
33 #include "hbtextmeasurementutility_r.h" |
34 #include "hbfeaturemanager_r.h" |
34 #include "hbtextmeasurementutility_r_p.h" |
35 #endif //HB_TEXT_MEASUREMENT_UTILITY |
35 #endif //HB_TEXT_MEASUREMENT_UTILITY |
36 |
36 |
37 /*! |
37 /*! |
38 \class HbTextEdit |
38 \class HbTextEdit |
39 \brief Multiline rich-text editor supporting HTML-style tags and WYSIWYG editing. |
39 \brief Multiline rich-text editor supporting HTML-style tags and WYSIWYG editing. |
151 */ |
151 */ |
152 void HbTextEdit::setPlainText (const QString &text) |
152 void HbTextEdit::setPlainText (const QString &text) |
153 { |
153 { |
154 QString txt( text ); |
154 QString txt( text ); |
155 #ifdef HB_TEXT_MEASUREMENT_UTILITY |
155 #ifdef HB_TEXT_MEASUREMENT_UTILITY |
156 if ( HbFeatureManager::instance()->featureStatus( HbFeatureManager::TextMeasurement ) ) { |
156 if (HbTextMeasurementUtility::instance()->locTestMode()) { |
157 if (text.endsWith(QChar(LOC_TEST_END))) { |
157 if (text.endsWith(QChar(LOC_TEST_END))) { |
158 int index = text.indexOf(QChar(LOC_TEST_START)); |
158 int index = text.indexOf(QChar(LOC_TEST_START)); |
159 setProperty( HbTextMeasurementUtilityNameSpace::textIdPropertyName, text.mid(index + 1, text.indexOf(QChar(LOC_TEST_END)) - index - 1) ); |
159 setProperty( HbTextMeasurementUtilityNameSpace::textIdPropertyName, text.mid(index + 1, text.indexOf(QChar(LOC_TEST_END)) - index - 1) ); |
160 setProperty( HbTextMeasurementUtilityNameSpace::textMaxLines, -1 ); |
160 setProperty( HbTextMeasurementUtilityNameSpace::textMaxLines, -1 ); |
161 txt = text.left(index); |
161 txt = text.left(index); |
171 \reimp |
171 \reimp |
172 */ |
172 */ |
173 void HbTextEdit::resizeEvent(QGraphicsSceneResizeEvent *event) |
173 void HbTextEdit::resizeEvent(QGraphicsSceneResizeEvent *event) |
174 { |
174 { |
175 HbAbstractEdit::resizeEvent(event); |
175 HbAbstractEdit::resizeEvent(event); |
176 |
|
177 document()->setTextWidth(primitive(HbStyle::P_Edit_text)->boundingRect().width()); |
|
178 } |
176 } |
179 |
177 |
180 |
178 |
181 /*! |
179 /*! |
182 \reimp |
180 \reimp |