diff options
-rw-r--r-- | examples/widgets/statemachine/rogue/window.cpp | 9 | ||||
-rw-r--r-- | tests/auto/qstatemachine/qstatemachine/tst_qstatemachine.cpp | 8 |
2 files changed, 8 insertions, 9 deletions
diff --git a/examples/widgets/statemachine/rogue/window.cpp b/examples/widgets/statemachine/rogue/window.cpp index a5363e2..3e7cbf0 100644 --- a/examples/widgets/statemachine/rogue/window.cpp +++ b/examples/widgets/statemachine/rogue/window.cpp @@ -60,15 +60,14 @@ Window::Window() pY = 5; //![0] - QFontDatabase database; QFont font; - if (database.families().contains("Monospace")) { + const QStringList families = QFontDatabase::families(); + if (families.contains("Monospace")) { font = QFont("Monospace"); } else { - const QStringList fontFamilies = database.families(); - for (const QString &family : fontFamilies ) { - if (database.isFixedPitch(family)) { + for (const QString &family : families) { + if (QFontDatabase::isFixedPitch(family)) { font = QFont(family); break; } diff --git a/tests/auto/qstatemachine/qstatemachine/tst_qstatemachine.cpp b/tests/auto/qstatemachine/qstatemachine/tst_qstatemachine.cpp index 486d44f..3fb34bd 100644 --- a/tests/auto/qstatemachine/qstatemachine/tst_qstatemachine.cpp +++ b/tests/auto/qstatemachine/qstatemachine/tst_qstatemachine.cpp @@ -65,7 +65,7 @@ static int globalTick; { \ QTRY_COMPARE(runningSpy.count(), 1); \ QList<QVariant> runningArgs = runningSpy.takeFirst(); \ - QVERIFY(runningArgs.at(0).type() == QVariant::Bool); \ + QVERIFY(runningArgs.at(0).typeId() == QMetaType::Bool); \ QVERIFY(runningArgs.at(0).toBool() == RUNNING); \ QCOMPARE(machine.isRunning(), runningArgs.at(0).toBool()); \ } @@ -74,10 +74,10 @@ static int globalTick; { \ QTRY_COMPARE(runningSpy.count(), 2); \ QList<QVariant> runningArgs = runningSpy.takeFirst(); \ - QVERIFY(runningArgs.at(0).type() == QVariant::Bool); \ + QVERIFY(runningArgs.at(0).typeId() == QMetaType::Bool); \ QVERIFY(runningArgs.at(0).toBool() == true); \ runningArgs = runningSpy.takeFirst(); \ - QVERIFY(runningArgs.at(0).type() == QVariant::Bool); \ + QVERIFY(runningArgs.at(0).typeId() == QMetaType::Bool); \ QVERIFY(runningArgs.at(0).toBool() == false); \ QCOMPARE(machine.isRunning(), runningArgs.at(0).toBool()); \ } @@ -91,7 +91,7 @@ static int globalTick; QTRY_COMPARE(VAR##_activeSpy.count(), COUNT); \ bool active = true; \ for (const QList<QVariant> &activeArgs : static_cast<QList<QList<QVariant> > >(VAR##_activeSpy)) { \ - QVERIFY(activeArgs.at(0).type() == QVariant::Bool); \ + QVERIFY(activeArgs.at(0).typeId() == QMetaType::Bool); \ QVERIFY(activeArgs.at(0).toBool() == active); \ active = !active; \ } \ |