diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-04-30 06:28:37 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-04-30 06:28:37 (GMT) |
commit | 980e3f143505639ec8f1a8cc4d0ca2bbe59e69c7 (patch) | |
tree | 59232e6c61e7e01101b0f349b14c52c7fbd52713 /tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp | |
parent | deb92c796c727c6ad0eaf28929cda6d000c1b3c1 (diff) | |
download | Qt-980e3f143505639ec8f1a8cc4d0ca2bbe59e69c7.zip Qt-980e3f143505639ec8f1a8cc4d0ca2bbe59e69c7.tar.gz Qt-980e3f143505639ec8f1a8cc4d0ca2bbe59e69c7.tar.bz2 |
Add Qt.fontFamilies() method
QTBUG-10239
Diffstat (limited to 'tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp')
-rw-r--r-- | tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp b/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp index 17b7925..5095be8 100644 --- a/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp +++ b/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp @@ -42,6 +42,7 @@ #include <qtest.h> #include <QDebug> #include <QDeclarativeEngine> +#include <QFontDatabase> #include <QFileInfo> #include <QDeclarativeComponent> #include <QDesktopServices> @@ -76,6 +77,7 @@ private slots: void isQtObject(); void btoa(); void atob(); + void fontFamilies(); private: QDeclarativeEngine engine; @@ -483,6 +485,22 @@ void tst_qdeclarativeqt::atob() delete object; } +void tst_qdeclarativeqt::fontFamilies() +{ + QDeclarativeComponent component(&engine, TEST_FILE("fontFamilies.qml")); + + QString warning1 = component.url().toString() + ":4: Error: Qt.fontFamilies(): Invalid arguments"; + QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); + + QObject *object = component.create(); + QVERIFY(object != 0); + + QFontDatabase database; + QCOMPARE(object->property("test2"), QVariant::fromValue(database.families())); + + delete object; +} + QTEST_MAIN(tst_qdeclarativeqt) #include "tst_qdeclarativeqt.moc" |