diff options
author | Paul Olav Tvete <paul.tvete@theqtcompany.com> | 2015-06-09 13:59:07 +0200 |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@theqtcompany.com> | 2015-06-09 13:59:07 +0200 |
commit | 0963be63ce741ef6c7585358c3f3b1cb806b66e8 (patch) | |
tree | 6f4964c196b8a52cb15e9efc0388b6a549574460 /src/gui/opengl/qopengl.cpp | |
parent | 9e6a1351823b3ee3d7e380248f6ef42ff383b014 (diff) | |
parent | eacfbbf64ef90dad8c5cb6b2c812ad64c1100779 (diff) |
Merge remote-tracking branch 'qt/dev' into dev-highdpi
Conflicts:
src/gui/kernel/qsimpledrag.cpp
src/gui/kernel/qwindowsysteminterface.cpp
src/gui/kernel/qwindowsysteminterface_p.h
src/plugins/platforms/xcb/qxcbwindow.cpp
Change-Id: Icd887552ade61d6a2b2527383970f7145aa00faf
Diffstat (limited to 'src/gui/opengl/qopengl.cpp')
-rw-r--r-- | src/gui/opengl/qopengl.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/gui/opengl/qopengl.cpp b/src/gui/opengl/qopengl.cpp index c8d33df4ba..1c008ccb42 100644 --- a/src/gui/opengl/qopengl.cpp +++ b/src/gui/opengl/qopengl.cpp @@ -47,6 +47,8 @@ #include <QtCore/QFile> #include <QtCore/QDir> +#include <set> + QT_BEGIN_NAMESPACE #if defined(QT_OPENGL_3) @@ -128,7 +130,7 @@ QDebug operator<<(QDebug d, const QOpenGLConfig::Gpu &g) } enum Operator { NotEqual, LessThan, LessEqualThan, Equals, GreaterThan, GreaterEqualThan }; -static const char *operators[] = {"!=", "<", "<=", "=", ">", ">="}; +static const char operators[][3] = {"!=", "<", "<=", "=", ">", ">="}; static inline QString valueKey() { return QStringLiteral("value"); } static inline QString opKey() { return QStringLiteral("op"); } @@ -474,4 +476,13 @@ QOpenGLConfig::Gpu QOpenGLConfig::Gpu::fromContext() return gpu; } +Q_GUI_EXPORT std::set<QByteArray> *qgpu_features(const QString &filename) +{ + const QSet<QString> features = QOpenGLConfig::gpuFeatures(QOpenGLConfig::Gpu::fromContext(), filename); + std::set<QByteArray> *result = new std::set<QByteArray>; + foreach (const QString &feature, features) + result->insert(feature.toUtf8()); + return result; +} + QT_END_NAMESPACE |