4#ifndef QQUICKCANVASITEM_P_H
5#define QQUICKCANVASITEM_P_H
18#include <private/qtquickglobal_p.h>
22#include <QtQuick/qquickitem.h>
23#include <private/qqmlrefcount_p.h>
24#include <QtCore/QThread>
25#include <QtCore/qmutex.h>
26#include <QtGui/QImage>
148 void sceneGraphInitialized();
149 void checkAnimationCallbacks();
150 void invalidateSceneGraph();
151 void schedulePolish();
167 bool isPaintConnected();
182 static QHash<QQmlEngine *,QQuickContext2DRenderThread*> renderThreads;
183 static QMutex renderThreadsMutex;
The QJSValue class acts as a container for Qt/JavaScript data types.
The QQmlEngine class provides an environment for instantiating QML components.
void setTileSize(const QSize &)
void renderStrategyChanged()
void renderTargetChanged()
void setCanvasWindow(const QRectF &rect)
Q_INVOKABLE QString toDataURL(const QString &type=QLatin1String("image/png")) const
\qmlmethod string QtQuick::Canvas::toDataURL(string mimeType)
bool isTextureProvider() const override
Returns true if this item is a texture provider.
void paint(const QRect ®ion)
bool isImageLoaded(const QUrl &url) const
\qmlmethod QtQuick::Canvas::isImageLoaded(url image) Returns true if the image is successfully loaded...
void setCanvasSize(const QSizeF &)
void setRenderStrategy(RenderStrategy strategy)
RenderStrategy renderStrategy
QQmlRefPointer< QQuickCanvasPixmap > loadedPixmap(const QUrl &url, QSizeF sourceSize=QSizeF())
Q_INVOKABLE void requestAnimationFrame(QQmlV4FunctionPtr args)
\qmlmethod int QtQuick::Canvas::requestAnimationFrame(callback)
void updatePolish() override
This function should perform any layout as required for this item.
QQuickCanvasContext * rawContext() const
QSGTextureProvider * textureProvider() const override
Returns the texture provider for an item.
void setContextType(const QString &contextType)
bool isAvailable() const
\qmlproperty bool QtQuick::Canvas::available
Q_INVOKABLE bool save(const QString &filename, const QSizeF &imageSize=QSizeF()) const
\qmlmethod bool QtQuick::Canvas::save(string filename, size imageSize = undefined)
void unloadImage(const QUrl &url)
\qmlmethod QtQuick::Canvas::unloadImage(url image)
bool isImageError(const QUrl &url) const
\qmlmethod QtQuick::Canvas::isImageError(url image)
void contextTypeChanged()
void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override
QQuickCanvasItem(QQuickItem *parent=nullptr)
\qmltype Canvas \instantiates QQuickCanvasItem \inqmlmodule QtQuick
QImage toImage(const QRectF &rect=QRectF()) const
QSGNode * updatePaintNode(QSGNode *, UpdatePaintNodeData *) override
Called on the render thread when it is time to sync the state of the item with the scene graph.
void canvasWindowChanged()
void itemChange(QQuickItem::ItemChange, const QQuickItem::ItemChangeData &) override
Called when change occurs for this item.
void releaseResources() override
This function is called when an item should release graphics resources which are not already managed ...
Q_INVOKABLE void cancelRequestAnimationFrame(QQmlV4FunctionPtr args)
\qmlmethod QtQuick::Canvas::cancelRequestAnimationFrame(int handle)
Q_INVOKABLE void getContext(QQmlV4FunctionPtr args)
\qmlmethod object QtQuick::Canvas::getContext(string contextId, ... args)
bool isImageLoading(const QUrl &url) const
\qmlmethod QtQuick::Canvas::isImageLoading(url image) Returns true if the image is currently loading.
RenderTarget renderTarget
void componentComplete() override
Invoked after the root component that caused this instantiation has completed construction.
Q_INVOKABLE void markDirty(const QRectF &dirtyRect=QRectF())
\qmlmethod QtQuick::Canvas::markDirty(rect area)
void setRenderTarget(RenderTarget target)
void loadImage(const QUrl &url, QSizeF sourceSize=QSizeF())
\qmlsignal QtQuick::Canvas::imageLoaded()
Q_INVOKABLE void requestPaint()
\qmlmethod QtQuick::Canvas::requestPaint()
QQuickCanvasPixmap(const QImage &image)
QQuickPixmap * pixmap() const
QQuickContext2DRenderThread(QQmlEngine *eng)
static QQuickContext2DRenderThread * instance(QQmlEngine *engine)
~QQuickContext2DRenderThread()
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
QQuickWindow * window() const
Returns the window in which this item is rendered.
QQuickItem * parent
\qmlproperty Item QtQuick::Item::parent This property holds the visual parent of the item.
ItemChange
Used in conjunction with QQuickItem::itemChange() to notify the item about certain types of changes.
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
\group qtquick-scenegraph-nodes \title Qt Quick Scene Graph Node classes
The QSGTextureProvider class encapsulates texture based entities in QML.
\macro QT_RESTRICTED_CAST_FROM_ASCII
Combined button and popup list for selecting options.
QMap< QString, QVariant > QVariantMap
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei imageSize
#define QML_NAMED_ELEMENT(NAME)
#define QML_ADDED_IN_VERSION(MAJOR, MINOR)
QLatin1StringView QLatin1String
#define QT_REQUIRE_CONFIG(feature)
QUrl url("example.com")
[constructor-url-reference]