diff options
author | Kim Gronholm <kim.1.gronholm@nokia.com> | 2011-05-20 14:07:12 +0300 |
---|---|---|
committer | Kim Gronholm <kim.1.gronholm@nokia.com> | 2011-05-20 14:07:12 +0300 |
commit | bab20d498dc1ac696e2077a1acb7a338a6ca0c02 (patch) | |
tree | 0bff37b199e4ee11c91505ef7f4b48801365b1aa | |
parent | 954b02af4f2e5d3c8a1fc39966fe16eafb26be90 (diff) |
Changed the examples to use opengl graphicssystem on symbian instead of qglwidget as the viewport for qdeclarativeview
-rw-r--r-- | examples/helloworld/helloworld.pro | 4 | ||||
-rw-r--r-- | examples/helloworld/main.cpp | 14 | ||||
-rw-r--r-- | examples/shadereffects/main.cpp | 11 | ||||
-rw-r--r-- | examples/shadereffects/shadereffects.pro | 4 |
4 files changed, 24 insertions, 9 deletions
diff --git a/examples/helloworld/helloworld.pro b/examples/helloworld/helloworld.pro index 9903b3e..3ba3764 100644 --- a/examples/helloworld/helloworld.pro +++ b/examples/helloworld/helloworld.pro @@ -24,6 +24,10 @@ symbian:TARGET.UID3 = 0xE5022B60 # The .cpp file which was generated for your project. Feel free to hack it. SOURCES += main.cpp +symbian { + DEFINES += OPENGL_GRAPHICSSYSTEM +} + unix:!macx:!symbian { SOURCES += qmlapplicationviewer/qmlapplicationviewer.cpp HEADERS += qmlapplicationviewer/qmlapplicationviewer.h diff --git a/examples/helloworld/main.cpp b/examples/helloworld/main.cpp index efb396c..f9b4842 100644 --- a/examples/helloworld/main.cpp +++ b/examples/helloworld/main.cpp @@ -45,24 +45,26 @@ int main(int argc, char *argv[]) { +#ifdef OPENGL_GRAPHICSSYSTEM + QApplication::setGraphicsSystem("opengl"); +#endif + QApplication app(argc, argv); + QmlApplicationViewer viewer; +#ifndef OPENGL_GRAPHICSSYSTEM QGLFormat format = QGLFormat::defaultFormat(); format.setSampleBuffers(false); format.setSwapInterval(1); - QGLWidget* glWidget = new QGLWidget(format); glWidget->setAutoFillBackground(false); + viewer.setViewport(glWidget); +#endif - QmlApplicationViewer viewer; viewer.setViewportUpdateMode(QGraphicsView::FullViewportUpdate); viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto); viewer.setAttribute(Qt::WA_OpaquePaintEvent); viewer.setAttribute(Qt::WA_NoSystemBackground); - viewer.setViewport(glWidget); - - qDebug()<<"Starting helloworld, used QGLformat = " << glWidget->format(); - viewer.setMainQmlFile(QLatin1String("qml/helloworld/main.qml")); viewer.showExpanded(); diff --git a/examples/shadereffects/main.cpp b/examples/shadereffects/main.cpp index c05572a..ca3d4a4 100644 --- a/examples/shadereffects/main.cpp +++ b/examples/shadereffects/main.cpp @@ -45,21 +45,26 @@ int main(int argc, char *argv[]) { +#ifdef OPENGL_GRAPHICSSYSTEM + QApplication::setGraphicsSystem("opengl"); +#endif + QApplication app(argc, argv); + QmlApplicationViewer viewer; +#ifndef OPENGL_GRAPHICSSYSTEM QGLFormat format = QGLFormat::defaultFormat(); format.setSampleBuffers(false); format.setSwapInterval(1); - QGLWidget* glWidget = new QGLWidget(format); glWidget->setAutoFillBackground(false); + viewer.setViewport(glWidget); +#endif - QmlApplicationViewer viewer; viewer.setViewportUpdateMode(QGraphicsView::FullViewportUpdate); viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockPortrait); viewer.setAttribute(Qt::WA_OpaquePaintEvent); viewer.setAttribute(Qt::WA_NoSystemBackground); - viewer.setViewport(glWidget); viewer.setMainQmlFile(QLatin1String("qml/shadereffects/main.qml")); viewer.showExpanded(); diff --git a/examples/shadereffects/shadereffects.pro b/examples/shadereffects/shadereffects.pro index 2ca3557..5b743c8 100644 --- a/examples/shadereffects/shadereffects.pro +++ b/examples/shadereffects/shadereffects.pro @@ -24,6 +24,10 @@ symbian:TARGET.UID3 = 0xE1E0F350 # The .cpp file which was generated for your project. Feel free to hack it. SOURCES += main.cpp +symbian { + DEFINES += OPENGL_GRAPHICSSYSTEM +} + unix:!macx:!symbian { SOURCES += qmlapplicationviewer/qmlapplicationviewer.cpp HEADERS += qmlapplicationviewer/qmlapplicationviewer.h |