diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-05-11 03:09:49 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-05-11 03:18:19 (GMT) |
commit | aa40b01fcda22e654790aaf93a6b14f947cdea72 (patch) | |
tree | 234ca2fb319dea1f12c679ed7030a4b82f540caa /src | |
parent | cd70183a86f3586eb34c15f11af03746f28f4acc (diff) | |
download | Qt-aa40b01fcda22e654790aaf93a6b14f947cdea72.zip Qt-aa40b01fcda22e654790aaf93a6b14f947cdea72.tar.gz Qt-aa40b01fcda22e654790aaf93a6b14f947cdea72.tar.bz2 |
Round ideal width up to prevent incorrect word wrapping on Mac OS X
QTBUG-10539
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativetextedit.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp index d095dbe..6d86e58 100644 --- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp @@ -46,6 +46,8 @@ #include <private/qdeclarativeglobal_p.h> #include <qdeclarativeinfo.h> +#include <QtCore/qmath.h> + #include <QTextLayout> #include <QTextLine> #include <QTextDocument> @@ -1107,7 +1109,7 @@ void QDeclarativeTextEdit::updateSize() setBaselineOffset(fm.ascent() + yoff + d->textMargin); //### need to comfirm cost of always setting these - int newWidth = (int)d->document->idealWidth(); + int newWidth = qCeil(d->document->idealWidth()); d->document->setTextWidth(newWidth); // ### QTextDoc> Alignment will not work unless textWidth is set. Does Text need this line as well? int cursorWidth = 1; if(d->cursor) |