aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrigorii Zimin <gzimin@luxoft.com>2019-11-20 14:10:59 +0300
committerEgor Nemtsev <enemtsev@luxoft.com>2019-11-22 13:19:20 +0000
commit159d03f39fddbee6d3c00ecaabfb3751f3bed5cd (patch)
tree75ecf74ad334b1b72fa1c1f4d2da4b37bc7eca78
parentf16413f287442c48e652d43dbde726fd33357f4e (diff)
[sysinfo] add property that checks OpenGL for Qt3DStudio
Change-Id: Ic4d53adca6d9401318fe0718108c9ee2fda4005d Reviewed-by: Egor Nemtsev <enemtsev@luxoft.com>
-rw-r--r--plugins/systeminfo/systeminfo.cpp14
-rw-r--r--plugins/systeminfo/systeminfo.h3
-rw-r--r--plugins/systeminfo/systeminfo.pro2
3 files changed, 18 insertions, 1 deletions
diff --git a/plugins/systeminfo/systeminfo.cpp b/plugins/systeminfo/systeminfo.cpp
index 8a782572..b9bf28c7 100644
--- a/plugins/systeminfo/systeminfo.cpp
+++ b/plugins/systeminfo/systeminfo.cpp
@@ -36,6 +36,7 @@
#include <QSysInfo>
#include <QLibraryInfo>
#include <QtQml/qqmlinfo.h>
+#include <QtGui/QOpenGLContext>
#include "systeminfo.h"
@@ -144,6 +145,19 @@ void SystemInfo::getQtDiagInfo()
#endif
}
+bool SystemInfo::allow3dStudioPresentations()
+{
+ QOpenGLContext *globalShareContext = QOpenGLContext::globalShareContext();
+ if (globalShareContext && globalShareContext->isValid()) {
+ return (globalShareContext->isOpenGLES()
+ && globalShareContext->format().version() >= qMakePair(3,0))
+ || (!globalShareContext->isOpenGLES()
+ && globalShareContext->format().version() >= qMakePair(4,3));
+ }
+
+ return false;
+}
+
void SystemInfo::timerEvent(QTimerEvent *event)
{
Q_UNUSED(event);
diff --git a/plugins/systeminfo/systeminfo.h b/plugins/systeminfo/systeminfo.h
index 97eb0e61..018c11e0 100644
--- a/plugins/systeminfo/systeminfo.h
+++ b/plugins/systeminfo/systeminfo.h
@@ -54,6 +54,7 @@ class SystemInfo : public QObject, public QQmlParserStatus
Q_PROPERTY(QString kernelVersion READ kernelVersion CONSTANT)
Q_PROPERTY(QString qtVersion READ qtVersion CONSTANT)
Q_PROPERTY(QString qtDiag READ qtDiag NOTIFY qtDiagChanged)
+ Q_PROPERTY(bool allow3dStudioPresentations READ allow3dStudioPresentations CONSTANT)
public:
explicit SystemInfo(QObject *parent = nullptr);
@@ -90,6 +91,8 @@ private slots:
private:
void getAddress();
void getQtDiagInfo();
+ bool allow3dStudioPresentations();
+
QStringList m_addressList;
int m_timerId{0};
bool m_connected{false};
diff --git a/plugins/systeminfo/systeminfo.pro b/plugins/systeminfo/systeminfo.pro
index 9009f9c8..00b01f97 100644
--- a/plugins/systeminfo/systeminfo.pro
+++ b/plugins/systeminfo/systeminfo.pro
@@ -1,6 +1,6 @@
TEMPLATE = lib
TARGET = systeminfoplugin
-QT += qml quick network
+QT += gui qml quick network
CONFIG += qt plugin c++11
uri = com.pelagicore.systeminfo