diff -r 923ff622b8b9 -r 4633027730f5 src/hbcore/primitives/hbtextitem.cpp --- a/src/hbcore/primitives/hbtextitem.cpp Tue Jul 06 14:36:53 2010 +0300 +++ b/src/hbcore/primitives/hbtextitem.cpp Wed Aug 18 10:05:37 2010 +0300 @@ -37,7 +37,7 @@ #include #ifdef HB_TEXT_MEASUREMENT_UTILITY -#include "hbtextmeasurementutility_p.h" +#include "hbtextmeasurementutility_r_p.h" #include "hbfeaturemanager_r.h" #endif @@ -70,14 +70,15 @@ mMaxWidthForAdjust(-1), mDefaultHeight(-1), mUpdateColor(true), - mEventPosted(false) + mEventPosted(false), + inConstructor(1) { } void HbTextItemPrivate::init(QGraphicsItem *) { Q_Q(HbTextItem); - + inConstructor = 1; q->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); q->setFlag(QGraphicsItem::ItemClipsToShape, false); q->setFlag(QGraphicsItem::ItemIsSelectable, false); @@ -88,6 +89,7 @@ mTextLayout.setTextOption(textOption); mTextLayout.setCacheEnabled(true); mTextLayout.setFont(q->font()); + inConstructor = 0; } void HbTextItemPrivate::clear() @@ -152,6 +154,7 @@ } calculateVerticalOffset(); + mBoundingRect = layoutBoundingRect(); calculateFadeRects(); // build of text layout is completed @@ -442,7 +445,7 @@ { return (mFadeLengthX!=0 || mFadeLengthY!=0) && !contentRect.contains( - layoutBoundingRect().adjusted(KFadeTolerance, + mBoundingRect.adjusted(KFadeTolerance, KFadeTolerance, -KFadeTolerance, -KFadeTolerance)); @@ -513,7 +516,7 @@ On platforms: Linux, Windows and S60 emulator there is no such problem. Below flag detects platform which have this problem to activate work-around. */ -#if defined(Q_WS_S60) && defined(Q_BIG_ENDIAN) +#if defined(Q_OS_SYMBIAN) && defined(Q_BIG_ENDIAN) # warning Work-around is active in fade effect of HbTextItem (see comment) # define HB_FADE_EFFECT_WORKAROUND_ON_PHONE #endif @@ -834,7 +837,7 @@ QRectF HbTextItemPrivate::layoutBoundingRect () const { - QRectF result; + QRectF result; // (mTextLayout.boundingRect()); for (int i=0, n=mTextLayout.lineCount(); iinit(parent); + d->inConstructor = 1; setText(text); + d->inConstructor = 0; } /* @@ -1074,6 +1078,7 @@ d->mAlignment = alignment; d->updateTextOption(); d->calculateVerticalOffset(); + d->mBoundingRect = d->layoutBoundingRect(); update(); } @@ -1584,4 +1589,16 @@ d->setFadeLengths(lengths.x(), lengths.y()); } +/*! + \reimp + */ +void HbTextItem::updateGeometry() +{ + Q_D( HbTextItem ); + if (d->inConstructor) { + return; + } + HbWidgetBase::updateGeometry(); +} + // end of file