From 83e107579297f4cc136824453005465a5eb84f69 Mon Sep 17 00:00:00 2001 From: Alexander Stillich Date: Mon, 5 Nov 2018 14:11:38 +0100 Subject: [PATCH] Fixed warning in ImageHandler::extractQImage() when QZXING_QML is not defined --- src/ImageHandler.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/ImageHandler.cpp b/src/ImageHandler.cpp index 809d58f..1a26e01 100644 --- a/src/ImageHandler.cpp +++ b/src/ImageHandler.cpp @@ -29,7 +29,7 @@ QImage ImageHandler::extractQImage(QObject *imageObj, int offsetX, int offsetY, QQuickItem *item = qobject_cast(imageObj); if (!item || !item->window()->isVisible()) { - qDebug() << "Item is NULL"; + qWarning() << "ImageHandler: item is NULL"; return QImage(); } @@ -52,11 +52,11 @@ QImage ImageHandler::extractQImage(QObject *imageObj, int offsetX, int offsetY, QThread::yieldCurrentThread(); } img = result->image(); -#else +#else // QT_VERSION >= 0x050000 QGraphicsObject *item = qobject_cast(imageObj); if (!item) { - qDebug() << "Item is NULL"; + qWarning() << "ImageHandler: item is NULL"; return QImage(); } @@ -65,8 +65,10 @@ QImage ImageHandler::extractQImage(QObject *imageObj, int offsetX, int offsetY, QPainter painter(&img); QStyleOptionGraphicsItem styleOption; item->paint(&painter, &styleOption); -#endif -#endif //defined(QZXING_QML) +#endif // QT_VERSION >= 0x050000 +#else // defined(QZXING_QML) + Q_UNUSED(imageObj); +#endif // defined(QZXING_QML) if (offsetX < 0) offsetX = 0;