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
qgraphicsvideoitem.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 QGRAPHICSVIDEOITEM_H
5#define QGRAPHICSVIDEOITEM_H
6
7#include <QtWidgets/qgraphicsitem.h>
8
9#include <QtMultimediaWidgets/qvideowidget.h>
10
11#if QT_CONFIG(graphicsview)
12
14
17class Q_MULTIMEDIAWIDGETS_EXPORT QGraphicsVideoItem : public QGraphicsObject
18{
20 Q_PROPERTY(Qt::AspectRatioMode aspectRatioMode READ aspectRatioMode WRITE setAspectRatioMode)
21 Q_PROPERTY(QPointF offset READ offset WRITE setOffset)
22 Q_PROPERTY(QSizeF size READ size WRITE setSize)
23 Q_PROPERTY(QSizeF nativeSize READ nativeSize NOTIFY nativeSizeChanged)
24 Q_PROPERTY(QVideoSink* videoSink READ videoSink CONSTANT)
25public:
26 explicit QGraphicsVideoItem(QGraphicsItem *parent = nullptr);
28
29 Q_INVOKABLE QVideoSink *videoSink() const;
30
31 Qt::AspectRatioMode aspectRatioMode() const;
32 void setAspectRatioMode(Qt::AspectRatioMode mode);
33
34 QPointF offset() const;
35 void setOffset(const QPointF &offset);
36
37 QSizeF size() const;
38 void setSize(const QSizeF &size);
39
40 QSizeF nativeSize() const;
41
42 QRectF boundingRect() const override;
43
44 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr) override;
45
46 enum { Type = 14 };
47 int type() const override
48 {
49 // Enable the use of qgraphicsitem_cast with this item.
50 return Type;
51 }
52
54 void nativeSizeChanged(const QSizeF &size);
55
56protected:
57 void timerEvent(QTimerEvent *event) override;
58 QVariant itemChange(GraphicsItemChange change, const QVariant &value) override;
59
61
62private:
63 Q_DECLARE_PRIVATE(QGraphicsVideoItem)
64 Q_PRIVATE_SLOT(d_func(), void _q_present(const QVideoFrame &))
65};
66
68
69#endif // QT_CONFIG(graphicsview)
70
71#endif // QGRAPHICSVIDEOITEM_H
The QGraphicsItem class is the base class for all graphical items in a QGraphicsScene.
The QGraphicsObject class provides a base class for all graphics items that require signals,...
The QGraphicsVideoItem class provides a graphics item which display video produced by a QMediaPlayer ...
The QPainter class performs low-level painting on widgets and other paint devices.
Definition qpainter.h:46
\inmodule QtCore\reentrant
Definition qpoint.h:217
\inmodule QtCore\reentrant
Definition qrect.h:484
\inmodule QtCore
Definition qsize.h:208
The QStyleOptionGraphicsItem class is used to describe the parameters needed to draw a QGraphicsItem.
\inmodule QtCore
Definition qcoreevent.h:366
\inmodule QtCore
Definition qvariant.h:65
The QVideoFrameFormat class specifies the stream format of a video presentation surface.
The QVideoFrame class represents a frame of video data.
Definition qvideoframe.h:27
The QVideoSink class represents a generic sink for video data.
Definition qvideosink.h:22
The QWidget class is the base class of all user interface objects.
Definition qwidget.h:99
QOpenGLWidget * widget
[1]
QPainter paint
Combined button and popup list for selecting options.
AspectRatioMode
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLenum mode
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum type
GLenum GLuint GLintptr offset
struct _cl_event * event
GLuint GLenum option
static const QRectF boundingRect(const QPointF *points, int pointCount)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_INVOKABLE
#define Q_PRIVATE_SLOT(d, signature)
#define Q_SIGNALS
QPainter painter(this)
[7]
Definition moc.h:23