diff options
3 files changed, 5 insertions, 6 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) diff --git a/tests/auto/declarative/qdeclarativefontloader/tst_qdeclarativefontloader.cpp b/tests/auto/declarative/qdeclarativefontloader/tst_qdeclarativefontloader.cpp index d68b3e3..36908d9 100644 --- a/tests/auto/declarative/qdeclarativefontloader/tst_qdeclarativefontloader.cpp +++ b/tests/auto/declarative/qdeclarativefontloader/tst_qdeclarativefontloader.cpp @@ -122,9 +122,6 @@ void tst_qdeclarativefontloader::failLocalFont() { QString componentStr = "import Qt 4.7\nFontLoader { source: \"" + QUrl::fromLocalFile(SRCDIR "/data/dummy.ttf").toString() + "\" }"; QTest::ignoreMessage(QtWarningMsg, QString("file::2:1: QML FontLoader: Cannot load font: \"" + QUrl::fromLocalFile(SRCDIR "/data/dummy.ttf").toString() + "\"").toUtf8().constData()); -#ifdef Q_WS_QWS - QTest::ignoreMessage(QtDebugMsg, QString("FT_New_Face failed with index 0 : 2 ").toLatin1()); -#endif QDeclarativeComponent component(&engine); component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); QDeclarativeFontLoader *fontObject = qobject_cast<QDeclarativeFontLoader*>(component.create()); diff --git a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp index 8cc0e3f..b92024f 100644 --- a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp +++ b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp @@ -202,7 +202,7 @@ void tst_qdeclarativetextedit::width() QFont f; QFontMetricsF fm(f); qreal metricWidth = fm.size(Qt::TextExpandTabs && Qt::TextShowMnemonic, standard.at(i)).width(); - metricWidth = floor(metricWidth); + metricWidth = ceil(metricWidth); QString componentStr = "import Qt 4.7\nTextEdit { text: \"" + standard.at(i) + "\" }"; QDeclarativeComponent texteditComponent(&engine); @@ -219,7 +219,7 @@ void tst_qdeclarativetextedit::width() document.setHtml(richText.at(i)); document.setDocumentMargin(0); - int documentWidth = document.idealWidth(); + int documentWidth = ceil(document.idealWidth()); QString componentStr = "import Qt 4.7\nTextEdit { text: \"" + richText.at(i) + "\" }"; QDeclarativeComponent texteditComponent(&engine); |