Skip to content

Commit

Permalink
[quick] Add a hook to allow overriding the image node in QQuickImage.…
Browse files Browse the repository at this point in the history
… Contributes to JB#37064
  • Loading branch information
denexter committed Sep 14, 2018
1 parent b63ee00 commit 07455db
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/quick/items/qquickimage.cpp
Expand Up @@ -589,6 +589,11 @@ void QQuickImage::releaseResources()
}
}

QSGImageNode *QQuickImagePrivate::createImageNode()
{
return sceneGraphContext()->createImageNode();
}

QSGNode *QQuickImage::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *)
{
Q_D(QQuickImage);
Expand All @@ -610,7 +615,7 @@ QSGNode *QQuickImage::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *)
QSGImageNode *node = static_cast<QSGImageNode *>(oldNode);
if (!node) {
d->pixmapChanged = true;
node = d->sceneGraphContext()->createImageNode();
node = d->createImageNode();
}

QRectF targetRect;
Expand Down
4 changes: 3 additions & 1 deletion src/quick/items/qquickimage_p_p.h
Expand Up @@ -52,7 +52,7 @@ QT_BEGIN_NAMESPACE

class QQuickImageTextureProvider;

class QQuickImagePrivate : public QQuickImageBasePrivate
class Q_QUICK_PRIVATE_EXPORT QQuickImagePrivate : public QQuickImageBasePrivate
{
Q_DECLARE_PUBLIC(QQuickImage)

Expand All @@ -71,6 +71,8 @@ class QQuickImagePrivate : public QQuickImageBasePrivate
QQuickImage::VAlignment vAlign;

QQuickImageTextureProvider *provider;

virtual QSGImageNode *createImageNode();
};

QT_END_NAMESPACE
Expand Down

0 comments on commit 07455db

Please sign in to comment.