summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/auto/declarative/qmlvisual/shared/DejaVuSansMono.ttfbin0 -> 237788 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/shared/TestText.qml2
-rw-r--r--tests/auto/declarative/qmlvisual/shared/TestTextEdit.qml2
-rw-r--r--tests/auto/declarative/qmlvisual/shared/TestTextInput.qml2
-rw-r--r--tests/auto/declarative/qmlvisual/shared/Vera.ttfbin65932 -> 0 bytes
-rw-r--r--tools/qml/qdeclarativetester.cpp19
6 files changed, 12 insertions, 13 deletions
diff --git a/tests/auto/declarative/qmlvisual/shared/DejaVuSansMono.ttf b/tests/auto/declarative/qmlvisual/shared/DejaVuSansMono.ttf
new file mode 100644
index 0000000..029fcac
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/shared/DejaVuSansMono.ttf
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/shared/TestText.qml b/tests/auto/declarative/qmlvisual/shared/TestText.qml
index be40112..ab624c3 100644
--- a/tests/auto/declarative/qmlvisual/shared/TestText.qml
+++ b/tests/auto/declarative/qmlvisual/shared/TestText.qml
@@ -2,7 +2,7 @@ import QtQuick 1.0
import "../shared" 1.0
Text{
- FontLoader { id: fixedFont; source: "Vera.ttf" }
+ FontLoader { id: fixedFont; source: "DejaVuSansMono.ttf" }
font.family: fixedFont.name
font.pixelSize: 12
}
diff --git a/tests/auto/declarative/qmlvisual/shared/TestTextEdit.qml b/tests/auto/declarative/qmlvisual/shared/TestTextEdit.qml
index e19e418..e7c5bc1 100644
--- a/tests/auto/declarative/qmlvisual/shared/TestTextEdit.qml
+++ b/tests/auto/declarative/qmlvisual/shared/TestTextEdit.qml
@@ -3,7 +3,7 @@ import "../shared" 1.0
TextEdit {
id: edit
- FontLoader { id: fixedFont; source: "Vera.ttf" }
+ FontLoader { id: fixedFont; source: "DejaVuSansMono.ttf" }
font.family: fixedFont.name
font.pixelSize: 12
cursorDelegate: Rectangle {
diff --git a/tests/auto/declarative/qmlvisual/shared/TestTextInput.qml b/tests/auto/declarative/qmlvisual/shared/TestTextInput.qml
index e01c2c2..64938e0 100644
--- a/tests/auto/declarative/qmlvisual/shared/TestTextInput.qml
+++ b/tests/auto/declarative/qmlvisual/shared/TestTextInput.qml
@@ -3,7 +3,7 @@ import "../shared" 1.0
TextInput {
id: inp
- FontLoader { id: fixedFont; source: "Vera.ttf" }
+ FontLoader { id: fixedFont; source: "DejaVuSansMono.ttf" }
font.family: fixedFont.name
font.pixelSize: 12
cursorDelegate: Rectangle {
diff --git a/tests/auto/declarative/qmlvisual/shared/Vera.ttf b/tests/auto/declarative/qmlvisual/shared/Vera.ttf
deleted file mode 100644
index 58cd6b5..0000000
--- a/tests/auto/declarative/qmlvisual/shared/Vera.ttf
+++ /dev/null
Binary files differ
diff --git a/tools/qml/qdeclarativetester.cpp b/tools/qml/qdeclarativetester.cpp
index 499822a..e2a90cc 100644
--- a/tools/qml/qdeclarativetester.cpp
+++ b/tools/qml/qdeclarativetester.cpp
@@ -62,6 +62,12 @@ QDeclarativeTester::QDeclarativeTester(const QString &script, QDeclarativeViewer
parent->viewport()->installEventFilter(this);
parent->installEventFilter(this);
QUnifiedTimer::instance()->setConsistentTiming(true);
+
+ //Font antialiasing makes tests system-specific, so disable it
+ QFont noAA = QApplication::font();
+ noAA.setStyleStrategy(QFont::NoAntialias);
+ QApplication::setFont(noAA);
+
if (options & QDeclarativeViewer::Play)
this->run();
start();
@@ -268,14 +274,7 @@ void QDeclarativeTester::updateCurrentTime(int msec)
if (options & QDeclarativeViewer::TestImages) {
img.fill(qRgb(255,255,255));
-#ifdef Q_WS_MAC
- bool oldSmooth = qt_applefontsmoothing_enabled;
- qt_applefontsmoothing_enabled = false;
-#endif
QPainter p(&img);
-#ifdef Q_WS_MAC
- qt_applefontsmoothing_enabled = oldSmooth;
-#endif
m_view->render(&p);
}
@@ -337,14 +336,14 @@ void QDeclarativeTester::updateCurrentTime(int msec)
if (QDeclarativeVisualTestFrame *frame = qobject_cast<QDeclarativeVisualTestFrame *>(event)) {
if (frame->msec() < msec) {
if (options & QDeclarativeViewer::TestImages && !(options & QDeclarativeViewer::Record)) {
- qWarning() << "QDeclarativeTester: Extra frame. Seen:"
+ qWarning() << "QDeclarativeTester(" << m_script << "): Extra frame. Seen:"
<< msec << "Expected:" << frame->msec();
imagefailure();
}
} else if (frame->msec() == msec) {
if (!frame->hash().isEmpty() && frame->hash().toUtf8() != fe.hash.toHex()) {
if (options & QDeclarativeViewer::TestImages && !(options & QDeclarativeViewer::Record)) {
- qWarning() << "QDeclarativeTester: Mismatched frame hash at" << msec
+ qWarning() << "QDeclarativeTester(" << m_script << "): Mismatched frame hash at" << msec
<< ". Seen:" << fe.hash.toHex()
<< "Expected:" << frame->hash().toUtf8();
imagefailure();
@@ -363,7 +362,7 @@ void QDeclarativeTester::updateCurrentTime(int msec)
}
if (goodImage != img) {
QString reject(frame->image().toLocalFile() + ".reject.png");
- qWarning() << "QDeclarativeTester: Image mismatch. Reject saved to:"
+ qWarning() << "QDeclarativeTester(" << m_script << "): Image mismatch. Reject saved to:"
<< reject;
img.save(reject);
bool doDiff = (goodImage.size() == img.size());