aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrigorii Zimin <gzimin@luxoft.com>2020-03-20 14:47:40 +0300
committerGrigorii Zimin <gzimin@luxoft.com>2020-03-30 08:03:46 +0000
commit920d9f9f290a3915518da05bc5d4b9ee1de904ad (patch)
tree00dcdffb5c9cda34bd568f158780d684ee560e53
parent4827a3b617b20658f61a6886d548902ffaaeae8c (diff)
[sysinfo] introduce another check opengl property
Task-number: AUTOSUITE-1405 Change-Id: I605cf05ad03b82c0b1e2b0e8bc7551b6093ff634 Reviewed-by: Egor Nemtsev <enemtsev@luxoft.com>
-rw-r--r--plugins/systeminfo/systeminfo.cpp11
-rw-r--r--plugins/systeminfo/systeminfo.h2
2 files changed, 13 insertions, 0 deletions
diff --git a/plugins/systeminfo/systeminfo.cpp b/plugins/systeminfo/systeminfo.cpp
index 919409d7..d153259c 100644
--- a/plugins/systeminfo/systeminfo.cpp
+++ b/plugins/systeminfo/systeminfo.cpp
@@ -150,6 +150,7 @@ bool SystemInfo::allow3dStudioPresentations()
{
#ifndef QT_NO_OPENGL
QOpenGLContext *globalShareContext = QOpenGLContext::globalShareContext();
+
if (globalShareContext && globalShareContext->isValid()) {
return (globalShareContext->isOpenGLES()
&& globalShareContext->format().version() >= qMakePair(3,0))
@@ -161,6 +162,16 @@ bool SystemInfo::allow3dStudioPresentations()
return false;
}
+bool SystemInfo::allowOpenGLContent()
+{
+#ifndef QT_NO_OPENGL
+ QOpenGLContext *globalShareContext = QOpenGLContext::globalShareContext();
+ return globalShareContext && globalShareContext->isValid();
+#endif
+
+ return false;
+}
+
void SystemInfo::timerEvent(QTimerEvent *event)
{
Q_UNUSED(event);
diff --git a/plugins/systeminfo/systeminfo.h b/plugins/systeminfo/systeminfo.h
index 363e58c7..8d2506b2 100644
--- a/plugins/systeminfo/systeminfo.h
+++ b/plugins/systeminfo/systeminfo.h
@@ -55,6 +55,7 @@ class SystemInfo : public QObject, public QQmlParserStatus
Q_PROPERTY(QString qtVersion READ qtVersion CONSTANT)
Q_PROPERTY(QString qtDiag READ qtDiag NOTIFY qtDiagChanged)
Q_PROPERTY(bool allow3dStudioPresentations READ allow3dStudioPresentations CONSTANT)
+ Q_PROPERTY(bool allowOpenGLContent READ allowOpenGLContent CONSTANT)
public:
explicit SystemInfo(QObject *parent = nullptr);
@@ -96,6 +97,7 @@ private:
void getAddress();
void getQtDiagInfo();
bool allow3dStudioPresentations();
+ bool allowOpenGLContent();
QStringList m_addressList;
int m_timerId{0};