Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qopenglversionprofile.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
QOPENGLVERSIONPROFILE_H
6
#
define
QOPENGLVERSIONPROFILE_H
7
8
#
include
<
QtOpenGL
/
qtopenglglobal
.
h
>
9
10
#
include
<
QtGui
/
QSurfaceFormat
>
11
12
#
include
<
QtCore
/
qhashfunctions
.
h
>
13
14
QT_BEGIN_NAMESPACE
15
16
class
QOpenGLVersionProfilePrivate;
17
class
QDebug;
18
19
class
Q_OPENGL_EXPORT
QOpenGLVersionProfile
20
{
21
public
:
22
QOpenGLVersionProfile();
23
explicit
QOpenGLVersionProfile(
const
QSurfaceFormat &format);
24
QOpenGLVersionProfile(
const
QOpenGLVersionProfile &other);
25
~QOpenGLVersionProfile();
26
27
QOpenGLVersionProfile &operator=(
const
QOpenGLVersionProfile &rhs);
28
29
std::pair<
int
,
int
> version()
const
;
30
void
setVersion(
int
majorVersion,
int
minorVersion);
31
32
QSurfaceFormat::OpenGLContextProfile profile()
const
;
33
void
setProfile(QSurfaceFormat::OpenGLContextProfile profile);
34
35
bool
hasProfiles()
const
;
36
bool
isLegacyVersion()
const
;
37
bool
isValid()
const
;
38
39
private
:
40
QOpenGLVersionProfilePrivate* d;
41
42
friend
bool
operator==(
const
QOpenGLVersionProfile &lhs,
const
QOpenGLVersionProfile &rhs)
noexcept
43
{
44
if
(lhs.profile() != rhs.profile())
45
return
false
;
46
return
lhs.version() == rhs.version();
47
}
48
49
friend
bool
operator!=(
const
QOpenGLVersionProfile &lhs,
const
QOpenGLVersionProfile &rhs)
noexcept
50
{
51
return
!operator==(lhs, rhs);
52
}
53
};
54
55
inline
size_t
qHash
(
const
QOpenGLVersionProfile &v, size_t seed = 0)
noexcept
56
{
57
return
qHash(
static_cast
<
int
>(v.profile() * 1000)
58
+ v.version().first * 100 + v.version().second * 10, seed);
59
}
60
61
62
#
ifndef
QT_NO_DEBUG_STREAM
63
Q_OPENGL_EXPORT
QDebug
operator<<(QDebug debug,
const
QOpenGLVersionProfile &vp);
64
#
endif
// !QT_NO_DEBUG_STREAM
65
66
QT_END_NAMESPACE
67
68
#
endif
// QOPENGLVERSIONPROFILE_H
QOpenGLVersionProfilePrivate
Definition
qopenglversionprofile.cpp:12
QOpenGLVersionProfilePrivate::majorVersion
int majorVersion
Definition
qopenglversionprofile.cpp:20
QOpenGLVersionProfilePrivate::QOpenGLVersionProfilePrivate
QOpenGLVersionProfilePrivate()
Definition
qopenglversionprofile.cpp:14
QOpenGLVersionProfilePrivate::minorVersion
int minorVersion
Definition
qopenglversionprofile.cpp:21
QOpenGLVersionProfilePrivate::profile
QSurfaceFormat::OpenGLContextProfile profile
Definition
qopenglversionprofile.cpp:22
QOpenGLVersionProfile
\inmodule QtOpenGL
Definition
qopenglversionprofile.h:20
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
operator<<
Q_CORE_EXPORT QDebug operator<<(QDebug debug, QDir::Filters filters)
Definition
qdir.cpp:2620
qHash
constexpr size_t qHash(const QSize &s, size_t seed=0) noexcept
Definition
qsize.h:192
qtbase
src
opengl
qopenglversionprofile.h
Generated on
for Qt by
1.18.0