Can read graphics card type.

This commit is contained in:
NissimHadar 2018-12-30 20:24:00 -08:00
parent 6debd996c5
commit 76ce63da64
4 changed files with 19 additions and 2 deletions

View file

@ -8931,6 +8931,10 @@ void Application::copyToClipboard(const QString& text) {
QApplication::clipboard()->setText(text);
}
QString Application::getGraphicsCardType() {
return GPUIdent::getInstance()->getName();
}
#if defined(Q_OS_ANDROID)
void Application::beforeEnterBackground() {
auto nodeList = DependencyManager::get<NodeList>();

View file

@ -459,6 +459,8 @@ public slots:
void changeViewAsNeeded(float boomLength);
QString Application::getGraphicsCardType();
private slots:
void onDesktopRootItemCreated(QQuickItem* qmlContext);
void onDesktopRootContextCreated(QQmlContext* qmlContext);
@ -787,6 +789,5 @@ private:
bool _showTrackedObjects { false };
bool _prevShowTrackedObjects { false };
};
#endif // hifi_Application_h

View file

@ -6,8 +6,9 @@
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
#include "PlatformInfoScriptingInterface.h"
#include "Application.h"
# include <thread>
#include <thread>
#ifdef Q_OS_WIN
#include <Windows.h>
@ -69,4 +70,8 @@ int PlatformInfoScriptingInterface::getTotalSystemMemoryMB() {
#else
return -1;
#endif
}
QString PlatformInfoScriptingInterface::getGraphicsCardType() {
return qApp->getGraphicsCardType();
}

View file

@ -46,6 +46,13 @@ public slots:
* @returns {int} size of memory in megabytes
*/
int getTotalSystemMemoryMB();
/**jsdoc
* Returns the graphics card type
* @function Test.getGraphicsCardType
* @returns {string} graphics card type
*/
QString getGraphicsCardType();
};
#endif // hifi_PlatformInfoScriptingInterface_h