20 StereoBuffers = 0x0001,
21 DebugContext = 0x0002,
22 DeprecatedFunctions = 0x0004,
23 ResetNotification = 0x0008,
24 ProtectedContent = 0x0010
27 Q_DECLARE_FLAGS(FormatOptions, FormatOption)
38 DefaultRenderableType = 0x0,
43 Q_ENUM(RenderableType)
45 enum OpenGLContextProfile {
50 Q_ENUM(OpenGLContextProfile)
52#if QT_DEPRECATED_SINCE(6
,0
)
61 Q_IMPLICIT QSurfaceFormat(FormatOptions options);
62 QSurfaceFormat(
const QSurfaceFormat &other);
63 QSurfaceFormat &operator=(
const QSurfaceFormat &other);
66 void setDepthBufferSize(
int size);
67 int depthBufferSize()
const;
69 void setStencilBufferSize(
int size);
70 int stencilBufferSize()
const;
72 void setRedBufferSize(
int size);
73 int redBufferSize()
const;
74 void setGreenBufferSize(
int size);
75 int greenBufferSize()
const;
76 void setBlueBufferSize(
int size);
77 int blueBufferSize()
const;
78 void setAlphaBufferSize(
int size);
79 int alphaBufferSize()
const;
81 void setSamples(
int numSamples);
84 void setSwapBehavior(SwapBehavior behavior);
85 SwapBehavior swapBehavior()
const;
87 bool hasAlpha()
const;
89 void setProfile(OpenGLContextProfile profile);
90 OpenGLContextProfile profile()
const;
92 void setRenderableType(RenderableType type);
93 RenderableType renderableType()
const;
95 void setMajorVersion(
int majorVersion);
96 int majorVersion()
const;
98 void setMinorVersion(
int minorVersion);
99 int minorVersion()
const;
101 std::pair<
int,
int> version()
const;
102 void setVersion(
int major,
int minor);
105 void setStereo(
bool enable);
107 void setOptions(QSurfaceFormat::FormatOptions options);
108 void setOption(FormatOption option,
bool on =
true);
109 bool testOption(FormatOption option)
const;
110 QSurfaceFormat::FormatOptions options()
const;
112 int swapInterval()
const;
113 void setSwapInterval(
int interval);
115 const QColorSpace &colorSpace()
const;
116 void setColorSpace(
const QColorSpace &colorSpace);
117#if QT_DEPRECATED_SINCE(6
,0
)
118 Q_DECL_DEPRECATED_X(
"Use setColorSpace(QColorSpace) instead.")
119 void setColorSpace(ColorSpace colorSpace);
122 static void setDefaultFormat(
const QSurfaceFormat &format);
123 static QSurfaceFormat defaultFormat();
126 QSurfaceFormatPrivate *d;
129 bool equals(
const QSurfaceFormat &other)
const noexcept;
131 friend inline bool operator==(
const QSurfaceFormat &lhs,
const QSurfaceFormat &rhs)
noexcept
132 {
return lhs.equals(rhs); }
133 friend inline bool operator!=(
const QSurfaceFormat &lhs,
const QSurfaceFormat &rhs)
noexcept
134 {
return !lhs.equals(rhs); }
135#ifndef QT_NO_DEBUG_STREAM
136 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