Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qoffscreensurface.h
Go to the documentation of this file.
1// Copyright (C) 2020 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// Qt-Security score:significant reason:default
4
5#ifndef QOFFSCREENSURFACE_H
6#define QOFFSCREENSURFACE_H
7
8#include <QtGui/qtguiglobal.h>
9#include <QtCore/QObject>
10#include <QtCore/qnativeinterface.h>
11#include <QtGui/qsurface.h>
12Q_MOC_INCLUDE(<QtGui/qscreen.h>)
13
14QT_BEGIN_NAMESPACE
15
16class QOffscreenSurfacePrivate;
17
18class QScreen;
19class QPlatformOffscreenSurface;
20
21class Q_GUI_EXPORT QOffscreenSurface : public QObject, public QSurface
22{
23 Q_OBJECT
24 Q_DECLARE_PRIVATE(QOffscreenSurface)
25
26public:
27 explicit QOffscreenSurface(QScreen *screen = nullptr, QObject *parent = nullptr);
28 ~QOffscreenSurface();
29
30 SurfaceType surfaceType() const override;
31
32 void create();
33 void destroy();
34
35 bool isValid() const;
36
37 void setFormat(const QSurfaceFormat &format);
38 QSurfaceFormat format() const override;
39 QSurfaceFormat requestedFormat() const;
40
41 QSize size() const override;
42
43 QScreen *screen() const;
44 void setScreen(QScreen *screen);
45
46 QPlatformOffscreenSurface *handle() const;
47
48 QT_DECLARE_NATIVE_INTERFACE_ACCESSOR(QOffscreenSurface)
49
50Q_SIGNALS:
51 void screenChanged(QScreen *screen);
52
53private Q_SLOTS:
54 void screenDestroyed(QObject *screen);
55
56private:
57
58 QPlatformSurface *surfaceHandle() const override;
59
60 Q_DISABLE_COPY(QOffscreenSurface)
61};
62
63QT_END_NAMESPACE
64
65#include <QtGui/qoffscreensurface_platform.h>
66
67#endif // QOFFSCREENSURFACE_H
\inmodule QtGui
Combined button and popup list for selecting options.