mirror of https://github.com/status-im/qzxing.git
Fixed warning in ImageHandler::extractQImage() when QZXING_QML is not defined
This commit is contained in:
parent
0d67ad245f
commit
83e1075792
|
@ -29,7 +29,7 @@ QImage ImageHandler::extractQImage(QObject *imageObj, int offsetX, int offsetY,
|
||||||
QQuickItem *item = qobject_cast<QQuickItem *>(imageObj);
|
QQuickItem *item = qobject_cast<QQuickItem *>(imageObj);
|
||||||
|
|
||||||
if (!item || !item->window()->isVisible()) {
|
if (!item || !item->window()->isVisible()) {
|
||||||
qDebug() << "Item is NULL";
|
qWarning() << "ImageHandler: item is NULL";
|
||||||
return QImage();
|
return QImage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,11 +52,11 @@ QImage ImageHandler::extractQImage(QObject *imageObj, int offsetX, int offsetY,
|
||||||
QThread::yieldCurrentThread();
|
QThread::yieldCurrentThread();
|
||||||
}
|
}
|
||||||
img = result->image();
|
img = result->image();
|
||||||
#else
|
#else // QT_VERSION >= 0x050000
|
||||||
QGraphicsObject *item = qobject_cast<QGraphicsObject*>(imageObj);
|
QGraphicsObject *item = qobject_cast<QGraphicsObject*>(imageObj);
|
||||||
|
|
||||||
if (!item) {
|
if (!item) {
|
||||||
qDebug() << "Item is NULL";
|
qWarning() << "ImageHandler: item is NULL";
|
||||||
return QImage();
|
return QImage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,8 +65,10 @@ QImage ImageHandler::extractQImage(QObject *imageObj, int offsetX, int offsetY,
|
||||||
QPainter painter(&img);
|
QPainter painter(&img);
|
||||||
QStyleOptionGraphicsItem styleOption;
|
QStyleOptionGraphicsItem styleOption;
|
||||||
item->paint(&painter, &styleOption);
|
item->paint(&painter, &styleOption);
|
||||||
#endif
|
#endif // QT_VERSION >= 0x050000
|
||||||
#endif //defined(QZXING_QML)
|
#else // defined(QZXING_QML)
|
||||||
|
Q_UNUSED(imageObj);
|
||||||
|
#endif // defined(QZXING_QML)
|
||||||
|
|
||||||
if (offsetX < 0)
|
if (offsetX < 0)
|
||||||
offsetX = 0;
|
offsetX = 0;
|
||||||
|
|
Loading…
Reference in New Issue