mirror of https://github.com/status-im/qzxing.git
reverted changes of the merged commit 812238d1f5
/
This commit is contained in:
parent
d10cabd000
commit
4c0843478d
|
@ -4,7 +4,6 @@
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include <QStyleOptionGraphicsItem>
|
#include <QStyleOptionGraphicsItem>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <private/qquickimage_p.h>
|
|
||||||
|
|
||||||
ImageHandler::ImageHandler(QObject *parent) :
|
ImageHandler::ImageHandler(QObject *parent) :
|
||||||
QObject(parent)
|
QObject(parent)
|
||||||
|
@ -17,22 +16,7 @@ QImage ImageHandler::extractQImage(QObject *imageObj,
|
||||||
{
|
{
|
||||||
QGraphicsObject *item = qobject_cast<QGraphicsObject*>(imageObj);
|
QGraphicsObject *item = qobject_cast<QGraphicsObject*>(imageObj);
|
||||||
|
|
||||||
if (!item && (imageObj->metaObject()->className() == "QQuickImage")) {
|
if (!item ) {
|
||||||
QQuickImage *quickimage = static_cast<QQuickImage*>(imageObj);
|
|
||||||
|
|
||||||
if (!quickImage) {
|
|
||||||
qDebug() << "quickimage is NULL";
|
|
||||||
return QImage();
|
|
||||||
}
|
|
||||||
|
|
||||||
QImage img(quickimage->image());
|
|
||||||
if(offsetX == 0 && offsetY == 0 && width == 0 && height == 0)
|
|
||||||
return img;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return img.copy(offsetX, offsetY, width, height);
|
|
||||||
}
|
|
||||||
} else if (!item) {
|
|
||||||
qDebug() << "Item is NULL";
|
qDebug() << "Item is NULL";
|
||||||
return QImage();
|
return QImage();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue