Namespaces

Variants
Actions

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

(Difference between revisions)

Utility to quickly check Qt and Qt Mobility versions

From Wiki
Jump to: navigation, search
Maveric (Talk | contribs)
(Created page with 'Category:QtCategory:Qt Mobility ==Introduction== This small utility application can be used to find out the current versions of Qt and Qt Mobility and also OpenGl. ==Pr…')
 
Maveric (Talk | contribs)
m (Introduction)
Line 2: Line 2:
 
==Introduction==
 
==Introduction==
  
This small utility application can be used to find out the current versions of Qt and Qt Mobility and also OpenGl.
+
This small utility application can be used to find out the current versions of Qt and Qt Mobility and also OpenGL.
  
 
==Prerequisities==
 
==Prerequisities==

Revision as of 09:22, 14 December 2010

Contents

Introduction

This small utility application can be used to find out the current versions of Qt and Qt Mobility and also OpenGL.

Prerequisities

You would need the Qt SDK installed to compile the utility example code.

Example code

#include <QtGui>
#include <QtOpenGL>
#include <qmobilityglobal.h>
 
const char* openglVersion()
{
const char *OpenGLVersion;
switch (QGLFormat::openGLVersionFlags()) {
case QGLFormat::OpenGL_Version_1_1:
OpenGLVersion = "OpenGL 1.1";
break;
case QGLFormat::OpenGL_Version_1_2:
OpenGLVersion = "OpenGL 1.2";
break;
case QGLFormat::OpenGL_Version_1_3:
OpenGLVersion = "OpenGL 1.3";
break;
case QGLFormat::OpenGL_Version_1_4:
OpenGLVersion = "OpenGL 1.4";
break;
case QGLFormat::OpenGL_Version_1_5:
OpenGLVersion = "OpenGL 1.5";
break;
case QGLFormat::OpenGL_Version_2_0:
OpenGLVersion = "OpenGL 2.0";
break;
case QGLFormat::OpenGL_Version_2_1:
OpenGLVersion = "OpenGL 2.1";
break;
case QGLFormat::OpenGL_Version_3_0:
OpenGLVersion = "OpenGL 3.0";
break;
case QGLFormat::OpenGL_ES_CommonLite_Version_1_0:
OpenGLVersion = "OpenGL ES Common Lite 1.0";
break;
case QGLFormat::OpenGL_ES_Common_Version_1_0:
OpenGLVersion = "OpenGL ES Common Lite 1.0";
break;
case QGLFormat::OpenGL_ES_CommonLite_Version_1_1:
OpenGLVersion = "OpenGL ES Common Lite 1.1";
break;
case QGLFormat::OpenGL_ES_Common_Version_1_1:
OpenGLVersion = "OpenGL ES Common Lite 1.1";
break;
case QGLFormat::OpenGL_ES_Version_2_0:
OpenGLVersion = "OpenGL ES 2.0";
break;
case QGLFormat::OpenGL_Version_None:
default:
OpenGLVersion = "No Open GL";
break;
}
return OpenGLVersion;
}
 
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
 
QFont font("Nokia Sans", 32);
QLabel label;
label.setFont(font);
label.setText(QString("%1Qt: %2<br>Runtime Qt: %3<br>Qt Mobility: %4<br>OpenGL: %5")
.arg(qstrcmp(QT_VERSION_STR, qVersion()) ? "<h1 style=\"color: red\">Mismatch detected!</h1>" : "")
.arg(QT_VERSION_STR)
.arg(qVersion())
.arg(QTM_VERSION_STR)
.arg(openglVersion()));
label.setAlignment(Qt::AlignCenter);
label.show();
 
return a.exec();
}


You should compile this example for yourself using the SDK for your target device.

Tested on

+Emulator +Nokia N900

51 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×