diff options
author | Sona Kurazyan <sona.kurazyan@qt.io> | 2019-08-02 15:38:00 +0200 |
---|---|---|
committer | Sona Kurazyan <sona.kurazyan@qt.io> | 2019-08-20 11:20:47 +0200 |
commit | 4268258b8d3ea302809c5aa5713ae9570f1739fb (patch) | |
tree | c2b69e3ea41e1578aa8f7e66cf77e53cb941a24a /tests/benchmarks | |
parent | 560b5bcd277907538b71c147d12fdf3d41b1848c (diff) |
Remove the last usages of deprecated APIs
- Replaced the usages of deprecated APIs by corresponding
alternatives.
- Fixed building the tests with disabled deprecated APIs.
Task-number: QTBUG-76491
Change-Id: Ie8c5deb22c2074d39a64346c20e5384a7b2ad99b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'tests/benchmarks')
-rw-r--r-- | tests/benchmarks/qml/js/qjsengine/tst_qjsengine.cpp | 4 | ||||
-rw-r--r-- | tests/benchmarks/qml/painting/paintbenchmark.cpp | 10 |
2 files changed, 7 insertions, 7 deletions
diff --git a/tests/benchmarks/qml/js/qjsengine/tst_qjsengine.cpp b/tests/benchmarks/qml/js/qjsengine/tst_qjsengine.cpp index d13751385c..cb23d6edbd 100644 --- a/tests/benchmarks/qml/js/qjsengine/tst_qjsengine.cpp +++ b/tests/benchmarks/qml/js/qjsengine/tst_qjsengine.cpp @@ -452,7 +452,7 @@ void tst_QJSEngine::installTranslatorFunctions() { newEngine(); QBENCHMARK { - m_engine->installTranslatorFunctions(); + m_engine->installExtensions(QJSEngine::TranslationExtension); } } @@ -471,7 +471,7 @@ void tst_QJSEngine::translation() QFETCH(QString, text); QFETCH(QString, fileName); newEngine(); - m_engine->installTranslatorFunctions(); + m_engine->installExtensions(QJSEngine::TranslationExtension); QBENCHMARK { (void)m_engine->evaluate(text, fileName); diff --git a/tests/benchmarks/qml/painting/paintbenchmark.cpp b/tests/benchmarks/qml/painting/paintbenchmark.cpp index d195675ab8..1500f39c9a 100644 --- a/tests/benchmarks/qml/painting/paintbenchmark.cpp +++ b/tests/benchmarks/qml/painting/paintbenchmark.cpp @@ -34,7 +34,7 @@ #include <QGLWidget> #include <QTextLayout> #include <QVBoxLayout> -#include <QTime> +#include <QElapsedTimer> #include <QDebug> #include <QRandomGenerator> #include <QStaticText> @@ -328,20 +328,20 @@ public: } void paintEvent(QPaintEvent *) { - static int last = 0; + static qint64 last = 0; static bool firstRun = true; if (firstRun) { timer.start(); firstRun = false; } else { - int elapsed = timer.elapsed(); + qint64 elapsed = timer.elapsed(); qDebug() << "frame elapsed:" << elapsed - last; last = elapsed; } QPainter p(this); p.fillRect(rect(), Qt::white); p.setPen(Qt::black); - QTime drawTimer; + QElapsedTimer drawTimer; drawTimer.start(); testFunc(p); qDebug() << "draw time" << drawTimer.elapsed(); @@ -351,7 +351,7 @@ public: qApp->quit(); } - QTime timer; + QElapsedTimer timer; int frames; }; |