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
)
60 enum ColorComponentType {
61 FixedColorComponentType,
62 FloatColorComponentType
64 Q_ENUM(ColorComponentType)
67 Q_IMPLICIT QSurfaceFormat(FormatOptions options);
68 QSurfaceFormat(
const QSurfaceFormat &other);
69 QSurfaceFormat &operator=(
const QSurfaceFormat &other);
72 void setDepthBufferSize(
int size);
73 int depthBufferSize()
const;
75 void setStencilBufferSize(
int size);
76 int stencilBufferSize()
const;
78 void setRedBufferSize(
int size);
79 int redBufferSize()
const;
80 void setGreenBufferSize(
int size);
81 int greenBufferSize()
const;
82 void setBlueBufferSize(
int size);
83 int blueBufferSize()
const;
84 void setAlphaBufferSize(
int size);
85 int alphaBufferSize()
const;
87 void setColorComponentType(ColorComponentType type);
88 ColorComponentType colorComponentType()
const;
90 void setSamples(
int numSamples);
93 void setSwapBehavior(SwapBehavior behavior);
94 SwapBehavior swapBehavior()
const;
96 bool hasAlpha()
const;
98 void setProfile(OpenGLContextProfile profile);
99 OpenGLContextProfile profile()
const;
101 void setRenderableType(RenderableType type);
102 RenderableType renderableType()
const;
104 void setMajorVersion(
int majorVersion);
105 int majorVersion()
const;
107 void setMinorVersion(
int minorVersion);
108 int minorVersion()
const;
110 std::pair<
int,
int> version()
const;
111 void setVersion(
int major,
int minor);
114 void setStereo(
bool enable);
116 void setOptions(QSurfaceFormat::FormatOptions options);
117 void setOption(FormatOption option,
bool on =
true);
118 bool testOption(FormatOption option)
const;
119 QSurfaceFormat::FormatOptions options()
const;
121 int swapInterval()
const;
122 void setSwapInterval(
int interval);
124 const QColorSpace &colorSpace()
const;
125 void setColorSpace(
const QColorSpace &colorSpace);
126#if QT_DEPRECATED_SINCE(6
,0
)
127 Q_DECL_DEPRECATED_X(
"Use setColorSpace(QColorSpace) instead.")
128 void setColorSpace(ColorSpace colorSpace);
131 static void setDefaultFormat(
const QSurfaceFormat &format);
132 static QSurfaceFormat defaultFormat();
135 QSurfaceFormatPrivate *d;
138 bool equals(
const QSurfaceFormat &other)
const noexcept;
140 friend inline bool operator==(
const QSurfaceFormat &lhs,
const QSurfaceFormat &rhs)
noexcept
141 {
return lhs.equals(rhs); }
142 friend inline bool operator!=(
const QSurfaceFormat &lhs,
const QSurfaceFormat &rhs)
noexcept
143 {
return !lhs.equals(rhs); }
144#ifndef QT_NO_DEBUG_STREAM
145 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