mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-05-07 14:44:01 +00:00
feat(ImageProvider): add a timer to calculate image loading
This commit is contained in:
parent
824ba007c6
commit
b74698da70
1 changed files with 7 additions and 1 deletions
|
|
@ -20,13 +20,14 @@
|
|||
* Author: Ronan Abhamon
|
||||
*/
|
||||
|
||||
#include <QElapsedTimer>
|
||||
#include <QFile>
|
||||
#include <QFileInfo>
|
||||
#include <QImage>
|
||||
#include <QPainter>
|
||||
#include <QSvgRenderer>
|
||||
#include <QXmlStreamReader>
|
||||
#include <QtDebug>
|
||||
#include <QXmlStreamReader>
|
||||
|
||||
#include "../App.hpp"
|
||||
|
||||
|
|
@ -207,6 +208,9 @@ ImageProvider::ImageProvider () : QQuickImageProvider(
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
QImage ImageProvider::requestImage (const QString &id, QSize *, const QSize &) {
|
||||
QElapsedTimer timer;
|
||||
timer.start();
|
||||
|
||||
const QString path = QStringLiteral(":/assets/images/%1").arg(id);
|
||||
|
||||
// 1. Read and update XML content.
|
||||
|
|
@ -245,5 +249,7 @@ QImage ImageProvider::requestImage (const QString &id, QSize *, const QSize &) {
|
|||
QPainter painter(&image);
|
||||
renderer.render(&painter);
|
||||
|
||||
qInfo() << QStringLiteral("Image `%1` loaded in %2 milliseconds.").arg(path).arg(timer.elapsed());
|
||||
|
||||
return image;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue