void QGLInfo::initialize() { QWidget *win = qobject_cast<QGLWidget *>(parent()); // We need some kind of GL context to do the querying. QGLWidget *glWidget = new QGLWidget(win); glWidget->makeCurrent(); m_qtGLVersionInfo = reportQtGLVersionInfo(); m_qtGLFeatures = reportQtGLFeatures(); m_glVersionInfo = reportGLVersionInfo(); m_glExtensionInfo = reportGLExtensionInfo(); m_eglVersionInfo = reportEGLVersionInfo(); m_eglExtensionInfo = reportEGLExtensionInfo(); m_eglConfigInfo = reportEGLConfigInfo(); glWidget->doneCurrent(); delete glWidget; QString welcome; { QSettings freshStart; if (!freshStart.contains(QLatin1String("new_install"))) { welcome = QLatin1String("<h1>Welcome to Qt3D!</h1>" "<p>Try running the FPS test from the " "View menu above to confirm that Qt3D " "is installed correctly.</p><hr>"); } freshStart.setValue(QLatin1String("new_install"), true); } QString html = tr("<h1>Qt GL Info Report</h1>" "<p>Generated at: %1</p>" "<h2>Qt GL Version Info</h2>" "<p>%2</p>" "<h2>Qt GL Features</h2>" "<p>%3</p>" "<h2>GL Version Info</h2>" "<p>%4</p>" "<h2>GL Extension Info</h2>" "<p>%5</p>") .arg(QDateTime::currentDateTime().toString()) .arg(nice(m_qtGLVersionInfo)) .arg(nice(m_qtGLFeatures)) .arg(nice(m_glVersionInfo)) .arg(nice(m_glExtensionInfo)); if (!welcome.isEmpty()) html.prepend(welcome); #if !defined(QT_NO_EGL) html += tr("<h2>EGL Version Info</h2>" "<p>%1</p>" "<h2>EGL Extension Info</h2>" "<p>%2</p>" "<h2>EGL Configurations</h2>" "<p>%3</p>") .arg(nice(m_eglVersionInfo)) .arg(nice(m_eglExtensionInfo)) .arg(nice(m_eglConfigInfo)); #endif emit reportHtml(html); }
void QGLInfo::initialize() { QWidget *win = qobject_cast<QGLWidget *>(parent()); // We need some kind of GL context to do the querying. QGLWidget *glWidget = new QGLWidget(win); glWidget->makeCurrent(); m_qtGLVersionInfo = reportQtGLVersionInfo(); m_qtGLFeatures = reportQtGLFeatures(); m_glVersionInfo = reportGLVersionInfo(); m_glExtensionInfo = reportGLExtensionInfo(); m_eglVersionInfo = reportEGLVersionInfo(); m_eglExtensionInfo = reportEGLExtensionInfo(); m_eglConfigInfo = reportEGLConfigInfo(); glWidget->doneCurrent(); delete glWidget; QString html = tr("<h1>Qt GL Info Report</h1>" "<p>Generated at: %1</p>" "<h2>Qt GL Version Info</h2>" "<p>%2</p>" "<h2>Qt GL Features</h2>" "<p>%3</p>" "<h2>GL Version Info</h2>" "<p>%4</p>" "<h2>GL Extension Info</h2>" "<p>%5</p>") .arg(QDateTime::currentDateTime().toString()) .arg(nice(m_qtGLVersionInfo)) .arg(nice(m_qtGLFeatures)) .arg(nice(m_glVersionInfo)) .arg(nice(m_glExtensionInfo)); #if !defined(QT_NO_EGL) html += tr("<h2>EGL Version Info</h2>" "<p>%1</p>" "<h2>EGL Extension Info</h2>" "<p>%2</p>" "<h2>EGL Configurations</h2>" "<p>%3</p>") .arg(nice(m_eglVersionInfo)) .arg(nice(m_eglExtensionInfo)) .arg(nice(m_eglConfigInfo)); #endif emit reportHtml(html); }