Qt 6.x
The Qt SDK
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 FINAL)
21 Q_PROPERTY(bool mirrorVertically READ mirrorVertically WRITE setMirrorVertically NOTIFY mirrorVerticallyChanged FINAL)
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
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:
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:64
virtual QSGNode * updatePaintNode(QSGNode *, UpdatePaintNodeData *)
Called on the render thread when it is time to sync the state of the item with the scene graph.
virtual void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry)
virtual QSGTextureProvider * textureProvider() const
Returns the texture provider for an item.
virtual void releaseResources()
This function is called when an item should release graphics resources which are not already managed ...
void update()
Schedules a call to updatePaintNode() for this item.
virtual bool isTextureProvider() const
Returns true if this item is a texture provider.
\inmodule QtCore\reentrant
Definition qrect.h:483
\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]
GLboolean enable
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_SLOTS
#define Q_SIGNALS
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent