Fixed warning in ImageHandler::extractQImage() when QZXING_QML is not defined

This commit is contained in:
Alexander Stillich 2018-11-05 14:11:38 +01:00
parent 0d67ad245f
commit 83e1075792
1 changed files with 7 additions and 5 deletions

View File

@ -29,7 +29,7 @@ QImage ImageHandler::extractQImage(QObject *imageObj, int offsetX, int offsetY,
QQuickItem *item = qobject_cast<QQuickItem *>(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<QGraphicsObject*>(imageObj);
if (!item) {
qDebug() << "Item is NULL";
qWarning() << "ImageHandler: item is NULL";
return QImage();
}
@ -65,7 +65,9 @@ QImage ImageHandler::extractQImage(QObject *imageObj, int offsetX, int offsetY,
QPainter painter(&img);
QStyleOptionGraphicsItem styleOption;
item->paint(&painter, &styleOption);
#endif
#endif // QT_VERSION >= 0x050000
#else // defined(QZXING_QML)
Q_UNUSED(imageObj);
#endif // defined(QZXING_QML)
if (offsetX < 0)