summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/widgets/qfontcombobox/tst_qfontcombobox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/widgets/widgets/qfontcombobox/tst_qfontcombobox.cpp')
-rw-r--r--tests/auto/widgets/widgets/qfontcombobox/tst_qfontcombobox.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/tests/auto/widgets/widgets/qfontcombobox/tst_qfontcombobox.cpp b/tests/auto/widgets/widgets/qfontcombobox/tst_qfontcombobox.cpp
index bd3ea5686a..75f595e959 100644
--- a/tests/auto/widgets/widgets/qfontcombobox/tst_qfontcombobox.cpp
+++ b/tests/auto/widgets/widgets/qfontcombobox/tst_qfontcombobox.cpp
@@ -261,15 +261,18 @@ void tst_QFontComboBox::writingSystem()
// protected void currentFontChanged(QFont const& f)
void tst_QFontComboBox::currentFontChanged()
{
- SubQFontComboBox box;
- QSignalSpy spy0(&box, SIGNAL(currentFontChanged(QFont)));
+ // The absence of this file does not affect the test results
+ QFontDatabase::addApplicationFont("ArianaVioleta-dz2K.ttf");
+
+ SubQFontComboBox *box = new SubQFontComboBox;
+ QSignalSpy spy0(box, SIGNAL(currentFontChanged(QFont)));
- if (box.model()->rowCount() > 2) {
- QTest::keyPress(&box, Qt::Key_Down);
+ if (box->model()->rowCount() > 2) {
+ QTest::keyPress(box, Qt::Key_Down);
QCOMPARE(spy0.count(), 1);
QFont f( "Sans Serif" );
- box.setCurrentFont(f);
+ box->setCurrentFont(f);
QCOMPARE(spy0.count(), 2);
} else
qWarning("Not enough fonts installed on test system. Consider adding some");