summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-08-19 00:26:18 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-08-19 00:26:18 (GMT)
commit2abbc5fc400dfa8ad26397cc39f49f9b3a4304c9 (patch)
treefdbf3b8fbaf9d1e5a57bf1984a386f17d0fcd538 /tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
parent673fa509fe0ac8262e53a12907e99d2a007fb5f2 (diff)
downloadQt-2abbc5fc400dfa8ad26397cc39f49f9b3a4304c9.zip
Qt-2abbc5fc400dfa8ad26397cc39f49f9b3a4304c9.tar.gz
Qt-2abbc5fc400dfa8ad26397cc39f49f9b3a4304c9.tar.bz2
Make QML tests compile on OpenSolaris
Task-number: QTBUG-13003
Diffstat (limited to 'tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp')
-rw-r--r--tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
index ca9009d..a5c2dda 100644
--- a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
+++ b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
@@ -193,7 +193,7 @@ void tst_qdeclarativetextinput::width()
QDeclarativeTextInput *textinputObject = qobject_cast<QDeclarativeTextInput*>(textinputComponent.create());
QVERIFY(textinputObject != 0);
- int delta = abs(int(textinputObject->width()) - metricWidth);
+ int delta = abs(int(int(textinputObject->width()) - metricWidth));
QVERIFY(delta <= 3.0); // As best as we can hope for cross-platform.
delete textinputObject;
@@ -450,7 +450,7 @@ void tst_qdeclarativetextinput::positionAt()
QFontMetrics fm(textinputObject->font());
int pos = textinputObject->positionAt(textinputObject->width()/2);
- int diff = abs(fm.width(textinputObject->text()) - (fm.width(textinputObject->text().left(pos))+textinputObject->width()/2));
+ int diff = abs(int(fm.width(textinputObject->text()) - (fm.width(textinputObject->text().left(pos))+textinputObject->width()/2)));
// some tollerance for different fonts.
#ifdef Q_OS_LINUX
@@ -462,7 +462,7 @@ void tst_qdeclarativetextinput::positionAt()
// Check without autoscroll...
textinputObject->setAutoScroll(false);
pos = textinputObject->positionAt(textinputObject->width()/2);
- diff = abs(fm.width(textinputObject->text().left(pos))-textinputObject->width()/2);
+ diff = abs(int(fm.width(textinputObject->text().left(pos))-textinputObject->width()/2));
// some tollerance for different fonts.
#ifdef Q_OS_LINUX
@@ -1022,7 +1022,7 @@ void tst_qdeclarativetextinput::openInputPanelOnFocus()
QApplication::processEvents();
QCOMPARE(ic.openInputPanelReceived, true);
ic.openInputPanelReceived = false;
- QCOMPARE(view.inputContext(), &ic);
+ QCOMPARE(view.inputContext(), (QInputContext*)&ic);
QVERIFY(view.testAttribute(Qt::WA_InputMethodEnabled));
// input method should be disabled if focus