diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2010-06-07 05:59:11 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2010-06-07 06:01:21 (GMT) |
commit | a4f4fff60d20e509cb57bd0dab30533e1e299aee (patch) | |
tree | 4f4416e01cfbf5ec7e16b0bf33f85e42078edb55 /tests | |
parent | f410fb06c584fa0e893ab6066ea8b03a5323fe07 (diff) | |
download | Qt-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.cpp | 4 |
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()); |