21 StereoBuffers = 0x0001,
22 DebugContext = 0x0002,
23 DeprecatedFunctions = 0x0004,
24 ResetNotification = 0x0008,
25 ProtectedContent = 0x0010
28 Q_DECLARE_FLAGS(FormatOptions, FormatOption)
39 DefaultRenderableType = 0x0,
44 Q_ENUM(RenderableType)
46 enum OpenGLContextProfile {
51 Q_ENUM(OpenGLContextProfile)
53#if QT_DEPRECATED_SINCE(6
,0
)
62 Q_IMPLICIT QSurfaceFormat(FormatOptions options);
63 QSurfaceFormat(
const QSurfaceFormat &other);
64 QSurfaceFormat &operator=(
const QSurfaceFormat &other);
67 void setDepthBufferSize(
int size);
68 int depthBufferSize()
const;
70 void setStencilBufferSize(
int size);
71 int stencilBufferSize()
const;
73 void setRedBufferSize(
int size);
74 int redBufferSize()
const;
75 void setGreenBufferSize(
int size);
76 int greenBufferSize()
const;
77 void setBlueBufferSize(
int size);
78 int blueBufferSize()
const;
79 void setAlphaBufferSize(
int size);
80 int alphaBufferSize()
const;
82 void setSamples(
int numSamples);
85 void setSwapBehavior(SwapBehavior behavior);
86 SwapBehavior swapBehavior()
const;
88 bool hasAlpha()
const;
90 void setProfile(OpenGLContextProfile profile);
91 OpenGLContextProfile profile()
const;
93 void setRenderableType(RenderableType type);
94 RenderableType renderableType()
const;
96 void setMajorVersion(
int majorVersion);
97 int majorVersion()
const;
99 void setMinorVersion(
int minorVersion);
100 int minorVersion()
const;
102 std::pair<
int,
int> version()
const;
103 void setVersion(
int major,
int minor);
106 void setStereo(
bool enable);
108 void setOptions(QSurfaceFormat::FormatOptions options);
109 void setOption(FormatOption option,
bool on =
true);
110 bool testOption(FormatOption option)
const;
111 QSurfaceFormat::FormatOptions options()
const;
113 int swapInterval()
const;
114 void setSwapInterval(
int interval);
116 const QColorSpace &colorSpace()
const;
117 void setColorSpace(
const QColorSpace &colorSpace);
118#if QT_DEPRECATED_SINCE(6
,0
)
119 Q_DECL_DEPRECATED_X(
"Use setColorSpace(QColorSpace) instead.")
120 void setColorSpace(ColorSpace colorSpace);
123 static void setDefaultFormat(
const QSurfaceFormat &format);
124 static QSurfaceFormat defaultFormat();
127 QSurfaceFormatPrivate *d;
130 bool equals(
const QSurfaceFormat &other)
const noexcept;
132 friend inline bool operator==(
const QSurfaceFormat &lhs,
const QSurfaceFormat &rhs)
noexcept
133 {
return lhs.equals(rhs); }
134 friend inline bool operator!=(
const QSurfaceFormat &lhs,
const QSurfaceFormat &rhs)
noexcept
135 {
return !lhs.equals(rhs); }
136#ifndef QT_NO_DEBUG_STREAM
137 friend Q_GUI_EXPORT QDebug operator<<(QDebug,
const QSurfaceFormat &);
Q_GLOBAL_STATIC(DefaultRoleNames, qDefaultRoleNames, { { Qt::DisplayRole, "display" }, { Qt::DecorationRole, "decoration" }, { Qt::EditRole, "edit" }, { Qt::ToolTipRole, "toolTip" }, { Qt::StatusTipRole, "statusTip" }, { Qt::WhatsThisRole, "whatsThis" }, }) const QHash< int