File indexing completed on 2026-09-23 09:22:45
0001
0002
0003
0004 #ifndef QSURFACE_H
0005 #define QSURFACE_H
0006
0007 #include <QtGui/qtguiglobal.h>
0008 #include <QtCore/qnamespace.h>
0009 #include <QtGui/qsurfaceformat.h>
0010 #include <QtCore/qmetatype.h>
0011 #include <QtCore/qsize.h>
0012
0013 QT_BEGIN_NAMESPACE
0014
0015
0016 class QPlatformSurface;
0017
0018 class QSurfacePrivate;
0019
0020 class Q_GUI_EXPORT QSurface
0021 {
0022 Q_GADGET
0023 public:
0024 enum SurfaceClass {
0025 Window,
0026 Offscreen
0027 };
0028 Q_ENUM(SurfaceClass)
0029
0030 enum SurfaceType {
0031 RasterSurface,
0032 OpenGLSurface,
0033 #if QT_REMOVAL_QT7_DEPRECATED_SINCE(6, 11)
0034 RasterGLSurface Q_DECL_ENUMERATOR_DEPRECATED_X("Use RasterSurface instead"),
0035 #endif
0036 OpenVGSurface = 3,
0037 VulkanSurface,
0038 MetalSurface,
0039 Direct3DSurface
0040 };
0041 Q_ENUM(SurfaceType)
0042
0043 virtual ~QSurface();
0044
0045 SurfaceClass surfaceClass() const;
0046
0047 virtual QSurfaceFormat format() const = 0;
0048 virtual QPlatformSurface *surfaceHandle() const = 0;
0049
0050 virtual SurfaceType surfaceType() const = 0;
0051 bool supportsOpenGL() const;
0052
0053 virtual QSize size() const = 0;
0054
0055 protected:
0056 explicit QSurface(SurfaceClass type);
0057
0058 SurfaceClass m_type;
0059
0060 QSurfacePrivate *m_reserved;
0061 };
0062
0063 QT_END_NAMESPACE
0064
0065 QT_DECL_METATYPE_EXTERN_TAGGED(QSurface*, QSurface_ptr, Q_GUI_EXPORT)
0066
0067 #endif