summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qfxtextedit/tst_qfxtextedit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/declarative/qfxtextedit/tst_qfxtextedit.cpp')
-rw-r--r--tests/auto/declarative/qfxtextedit/tst_qfxtextedit.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/auto/declarative/qfxtextedit/tst_qfxtextedit.cpp b/tests/auto/declarative/qfxtextedit/tst_qfxtextedit.cpp
index 7bc6121..19d5998 100644
--- a/tests/auto/declarative/qfxtextedit/tst_qfxtextedit.cpp
+++ b/tests/auto/declarative/qfxtextedit/tst_qfxtextedit.cpp
@@ -40,6 +40,7 @@
****************************************************************************/
#include <qtest.h>
#include "../../../shared/util.h"
+#include <math.h>
#include <QFile>
#include <QTextDocument>
#include <QtDeclarative/qmlengine.h>
@@ -183,8 +184,9 @@ void tst_qfxtextedit::width()
for (int i = 0; i < standard.size(); i++)
{
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\nTextEdit { text: \"" + standard.at(i) + "\" }";
QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl());