Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Libraries
KUserFeedback
Commits
17db7d75
Commit
17db7d75
authored
Feb 02, 2022
by
Aleix Pol Gonzalez
🐧
Browse files
opengl source: Do not crash if we could not make our context current
BUG: 449505
parent
edda2a6c
Pipeline
#133056
passed with stage
in 3 minutes and 23 seconds
Changes
1
Pipelines
4
Hide whitespace changes
Inline
Side-by-side
src/provider/core/openglinfosource.cpp
View file @
17db7d75
...
...
@@ -13,6 +13,7 @@
#include
<QOpenGLFunctions>
#include
<QSurfaceFormat>
#include
<QWindow>
#include
"logging_p.h"
#endif
using
namespace
KUserFeedback
;
...
...
@@ -37,7 +38,11 @@ QVariant OpenGLInfoSource::data()
QWindow
window
;
window
.
setSurfaceType
(
QSurface
::
OpenGLSurface
);
window
.
create
();
context
.
makeCurrent
(
&
window
);
if
(
!
context
.
makeCurrent
(
&
window
))
{
qCWarning
(
Log
)
<<
"Could not make OpenGL context current"
;
m
.
insert
(
QStringLiteral
(
"type"
),
QStringLiteral
(
"none"
));
return
m
;
}
QOpenGLFunctions
functions
(
&
context
);
m
.
insert
(
QStringLiteral
(
"vendor"
),
OpenGLInfoSourcePrivate
::
normalizeVendor
(
reinterpret_cast
<
const
char
*>
(
functions
.
glGetString
(
GL_VENDOR
))));
m
.
insert
(
QStringLiteral
(
"renderer"
),
OpenGLInfoSourcePrivate
::
normalizeRenderer
(
reinterpret_cast
<
const
char
*>
(
functions
.
glGetString
(
GL_RENDERER
))));
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment