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 QVIDEOWIDGET_H
5#define QVIDEOWIDGET_H
6
7#include <QtWidgets/qwidget.h>
8
9#include <QtMultimediaWidgets/qtmultimediawidgetsglobal.h>
10
11QT_BEGIN_NAMESPACE
12
13class QVideoSink;
14
15class QVideoWidgetPrivate;
16class Q_MULTIMEDIAWIDGETS_EXPORT QVideoWidget : public QWidget
17{
18 Q_OBJECT
19 Q_PROPERTY(bool fullScreen READ isFullScreen WRITE setFullScreen NOTIFY fullScreenChanged)
20 Q_PROPERTY(Qt::AspectRatioMode aspectRatioMode READ aspectRatioMode WRITE setAspectRatioMode NOTIFY aspectRatioModeChanged)
21
22public:
23 explicit QVideoWidget(QWidget *parent = nullptr);
24 ~QVideoWidget();
25
26 Q_INVOKABLE QVideoSink *videoSink() const;
27
28#ifdef Q_QDOC
29 bool isFullScreen() const;
30#endif
31
32 Qt::AspectRatioMode aspectRatioMode() const;
33
34 QSize sizeHint() const override;
35
36public Q_SLOTS:
37 void setFullScreen(bool fullScreen);
38 void setAspectRatioMode(Qt::AspectRatioMode mode);
39
40Q_SIGNALS:
41 void fullScreenChanged(bool fullScreen);
42 void aspectRatioModeChanged(Qt::AspectRatioMode mode);
43
44protected:
45 bool event(QEvent *event) override;
46 void showEvent(QShowEvent *event) override;
47 void hideEvent(QHideEvent *event) override;
48 void resizeEvent(QResizeEvent *event) override;
49 void moveEvent(QMoveEvent *event) override;
50 QVideoWidgetPrivate *d_ptr;
51
52private:
53 Q_DECLARE_PRIVATE(QVideoWidget)
54};
55
56QT_END_NAMESPACE
57
58
59#endif
60

source code of qtmultimedia/src/multimediawidgets/qvideowidget.h