summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2010-06-07 05:59:11 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2010-06-07 06:01:21 (GMT)
commita4f4fff60d20e509cb57bd0dab30533e1e299aee (patch)
tree4f4416e01cfbf5ec7e16b0bf33f85e42078edb55 /tests
parentf410fb06c584fa0e893ab6066ea8b03a5323fe07 (diff)
downloadQt-a4f4fff60d20e509cb57bd0dab30533e1e299aee.zip
Qt-a4f4fff60d20e509cb57bd0dab30533e1e299aee.tar.gz
Qt-a4f4fff60d20e509cb57bd0dab30533e1e299aee.tar.bz2
Keep reported point/pixel size in sync.
This allows you to, for example, bind to a Text's font.pixelSize, even if one was never explicitly set. Task-number: QTBUG-11111
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/tst_qdeclarativevaluetypes.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/tst_qdeclarativevaluetypes.cpp b/tests/auto/declarative/qdeclarativevaluetypes/tst_qdeclarativevaluetypes.cpp
index 53fd68c..5e46fab 100644
--- a/tests/auto/declarative/qdeclarativevaluetypes/tst_qdeclarativevaluetypes.cpp
+++ b/tests/auto/declarative/qdeclarativevaluetypes/tst_qdeclarativevaluetypes.cpp
@@ -46,6 +46,8 @@
#include <private/qdeclarativevaluetype_p.h>
#include "testtypes.h"
+extern int qt_defaultDpi();
+
class tst_qdeclarativevaluetypes : public QObject
{
Q_OBJECT
@@ -464,7 +466,7 @@ void tst_qdeclarativevaluetypes::font()
QCOMPARE(object->property("f_overline").toBool(), object->font().overline());
QCOMPARE(object->property("f_strikeout").toBool(), object->font().strikeOut());
QCOMPARE(object->property("f_pointSize").toDouble(), object->font().pointSizeF());
- QCOMPARE(object->property("f_pixelSize").toInt(), object->font().pixelSize());
+ QCOMPARE(object->property("f_pixelSize").toInt(), int((object->font().pointSizeF() * qt_defaultDpi()) / qreal(72.)));
QCOMPARE(object->property("f_capitalization").toInt(), (int)object->font().capitalization());
QCOMPARE(object->property("f_letterSpacing").toDouble(), object->font().letterSpacing());
QCOMPARE(object->property("f_wordSpacing").toDouble(), object->font().wordSpacing());