Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qquickframebufferobject.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QQUICKFRAMEBUFFEROBJECT_H
5#define QQUICKFRAMEBUFFEROBJECT_H
6
7#include <QtQuick/QQuickItem>
8
10
14
15class Q_QUICK_EXPORT QQuickFramebufferObject : public QQuickItem
16{
18 Q_DECLARE_PRIVATE(QQuickFramebufferObject)
19
20 Q_PROPERTY(bool textureFollowsItemSize READ textureFollowsItemSize WRITE setTextureFollowsItemSize NOTIFY textureFollowsItemSizeChanged)
21 Q_PROPERTY(bool mirrorVertically READ mirrorVertically WRITE setMirrorVertically NOTIFY mirrorVerticallyChanged)
22
23public:
24
25 class Q_QUICK_EXPORT Renderer {
26 protected:
27 Renderer();
28 virtual ~Renderer();
29 virtual void render() = 0;
30 virtual QOpenGLFramebufferObject *createFramebufferObject(const QSize &size);
31 virtual void synchronize(QQuickFramebufferObject *);
32 QOpenGLFramebufferObject *framebufferObject() const;
33 void update();
34 void invalidateFramebufferObject();
35 private:
38 void *data;
39 };
40
41 QQuickFramebufferObject(QQuickItem *parent = nullptr);
42
43 bool textureFollowsItemSize() const;
44 void setTextureFollowsItemSize(bool follows);
45
46 bool mirrorVertically() const;
47 void setMirrorVertically(bool enable);
48
49 virtual Renderer *createRenderer() const = 0;
50
51 bool isTextureProvider() const override;
52 QSGTextureProvider *textureProvider() const override;
53 void releaseResources() override;
54
55protected:
56 void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override;
57
58protected:
59 QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) override;
60
64
65private Q_SLOTS:
66 void invalidateSceneGraph();
67};
68
70
71#endif // QQUICKFRAMEBUFFEROBJECT_H
The QOpenGLFramebufferObject class encapsulates an OpenGL framebuffer object.
virtual void render()=0
This function is called when the FBO should be rendered into.
virtual Renderer * createRenderer() const =0
Reimplement this function to create a renderer used to render into the FBO.
void mirrorVerticallyChanged(bool)
void textureFollowsItemSizeChanged(bool)
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition qquickitem.h:63
\inmodule QtCore\reentrant
Definition qrect.h:484
\group qtquick-scenegraph-nodes \title Qt Quick Scene Graph Node classes
Definition qsgnode.h:37
The QSGTextureProvider class encapsulates texture based entities in QML.
\inmodule QtCore
Definition qsize.h:25
Combined button and popup list for selecting options.
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLboolean enable
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_SLOTS
#define Q_SIGNALS