summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qmlgraphicstext
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2009-11-05 08:27:18 (GMT)
committerAlan Alpert <alan.alpert@nokia.com>2009-11-05 08:27:18 (GMT)
commit9bb160d8cee882bec25d7654a4d0554a755265c5 (patch)
treebe32390da9112002db36803ed4a8fc74a00c781a /tests/auto/declarative/qmlgraphicstext
parentf8423b94bbf439831577644cd07d2aa4e997396a (diff)
downloadQt-9bb160d8cee882bec25d7654a4d0554a755265c5.zip
Qt-9bb160d8cee882bec25d7654a4d0554a755265c5.tar.gz
Qt-9bb160d8cee882bec25d7654a4d0554a755265c5.tar.bz2
Get tests passing on Mac
There was inconsistent rounding of text widths. Task-number: QT-4200 QT-4201
Diffstat (limited to 'tests/auto/declarative/qmlgraphicstext')
-rw-r--r--tests/auto/declarative/qmlgraphicstext/tst_qmlgraphicstext.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/auto/declarative/qmlgraphicstext/tst_qmlgraphicstext.cpp b/tests/auto/declarative/qmlgraphicstext/tst_qmlgraphicstext.cpp
index ba5c835..2a3cdde 100644
--- a/tests/auto/declarative/qmlgraphicstext/tst_qmlgraphicstext.cpp
+++ b/tests/auto/declarative/qmlgraphicstext/tst_qmlgraphicstext.cpp
@@ -45,6 +45,7 @@
#include <private/qmlgraphicstext_p.h>
#include <private/qmlvaluetype_p.h>
#include <QFontMetrics>
+#include <math.h>
class tst_qmlgraphicstext : public QObject
@@ -201,8 +202,9 @@ void tst_qmlgraphicstext::width()
QVERIFY(!Qt::mightBeRichText(standard.at(i))); // self-test
QFont f;
- QFontMetrics fm(f);
- int metricWidth = fm.size(Qt::TextExpandTabs && Qt::TextShowMnemonic, standard.at(i)).width();
+ QFontMetricsF fm(f);
+ qreal metricWidth = fm.size(Qt::TextExpandTabs && Qt::TextShowMnemonic, standard.at(i)).width();
+ metricWidth = floor(metricWidth);
QString componentStr = "import Qt 4.6\nText { text: \"" + standard.at(i) + "\" }";
QmlComponent textComponent(&engine, componentStr.toLatin1(), QUrl("file://"));