diff options
author | Sarah Smith <sarah.j.smith@nokia.com> | 2011-07-06 16:46:41 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-07-06 08:52:31 +0200 |
commit | 4e26412ead4db24c662edb94206c4fcb79893ec7 (patch) | |
tree | 9e1801b43d559d76df74f3c4ee910b687e92c648 /examples/qt3d/geometry | |
parent | ee6774456e8e329e073dfe26c9ec84fd504d12c3 (diff) |
Various symbian fixes
Conflicts:
demos/quick3d/model_viewer/model_viewer.pro
demos/quick3d/robo_bounce/robo_bounce.pro
demos/quick3d/tea_service/tea_service.pro
examples/qt3d/basket/basket.pro
examples/qt3d/builder/builder.pro
examples/quick3d/basket/basket.pro
examples/quick3d/cube/cube.pro
examples/quick3d/forest/forest.pro
examples/quick3d/lander/lander.pro
examples/quick3d/matrix_animation/matrix_animation.pro
examples/quick3d/monkeygod/monkeygod.pro
examples/quick3d/moon/moon.pro
examples/quick3d/photoroom/photoroom.pro
examples/quick3d/shaders/shaders.pro
examples/quick3d/sphere/sphere.pro
examples/quick3d/tutorials/teapot_bounce_qml/teapot_bounce_qml.pro
examples/quick3d/tutorials/teapot_qml/teapot_qml.pro
src/quick3d/quick3d.pri
Change-Id: Ia14cfdcabd85b2264266d977f97a1216244a783c
Reviewed-on: http://codereview.qt.nokia.com/1202
Reviewed-by: Sarah Jane Smith
Diffstat (limited to 'examples/qt3d/geometry')
-rw-r--r-- | examples/qt3d/geometry/geometry.cpp | 19 | ||||
-rw-r--r-- | examples/qt3d/geometry/geometry.pro | 4 | ||||
-rw-r--r-- | examples/qt3d/geometry/main.cpp | 7 |
3 files changed, 25 insertions, 5 deletions
diff --git a/examples/qt3d/geometry/geometry.cpp b/examples/qt3d/geometry/geometry.cpp index c8f262c14..870d68d57 100644 --- a/examples/qt3d/geometry/geometry.cpp +++ b/examples/qt3d/geometry/geometry.cpp @@ -132,7 +132,16 @@ Geometry::Geometry(QObject *parent, QGLMaterialCollection *materials) { { u4, v7 }, { u5, v8 }, { u5, v6 } }, // B-G-E { { u4, v9 }, { u5, v8 }, { u4, v7 } } // L-G-B }; - QImage uv(1024, 1024, QImage::Format_ARGB32); + +#ifdef Q_OS_SYMBIAN + const int imgSize = 256; + const int txtSize = 6; +#else + const int imgSize = 1024; + const int txtSize = 36; +#endif + + QImage uv(imgSize, imgSize, QImage::Format_ARGB32); uv.fill(qRgba(196, 196, 196, 196)); QPainter painter; painter.begin(&uv); @@ -141,7 +150,7 @@ Geometry::Geometry(QObject *parent, QGLMaterialCollection *materials) pen.setWidth(2.0); painter.setPen(pen); QFont font = painter.font(); - font.setPointSize(36); + font.setPointSize(txtSize); painter.setFont(font); QFontMetrics metrics = painter.fontMetrics(); @@ -159,9 +168,9 @@ Geometry::Geometry(QObject *parent, QGLMaterialCollection *materials) QVector2D t2(tex[ix][2][0], tex[ix][2][1]); // scale up and flip to draw the texture - QVector2D tv0 = t0 * 1024.0; - QVector2D tv1 = t1 * 1024.0; - QVector2D tv2 = t2 * 1024.0; + QVector2D tv0 = t0 * static_cast<float>(imgSize); + QVector2D tv1 = t1 * static_cast<float>(imgSize); + QVector2D tv2 = t2 * static_cast<float>(imgSize); painter.setPen(QColor("darkblue")); painter.drawLine(tv0.toPointF(), tv1.toPointF()); diff --git a/examples/qt3d/geometry/geometry.pro b/examples/qt3d/geometry/geometry.pro index 66cbc9484..018948928 100644 --- a/examples/qt3d/geometry/geometry.pro +++ b/examples/qt3d/geometry/geometry.pro @@ -18,3 +18,7 @@ OTHER_FILES += \ geometry.rc RC_FILE = geometry.rc + +symbian { + ICON = ../qt3d.svg +} diff --git a/examples/qt3d/geometry/main.cpp b/examples/qt3d/geometry/main.cpp index 9ec88be7b..d097369d7 100644 --- a/examples/qt3d/geometry/main.cpp +++ b/examples/qt3d/geometry/main.cpp @@ -45,11 +45,18 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); GeometryView view; +#ifdef Q_OS_SYMBIAN + view.setAttribute(Qt::WA_LockLandscapeOrientation, true); + view.showMaximized(); +#else + if (view.stereoType() != QGLView::RedCyanAnaglyph) + view.camera()->setEyeSeparation(0.3f); if (QApplication::arguments().contains(QLatin1String("-maximize"))) view.showMaximized(); else if (QApplication::arguments().contains(QLatin1String("-fullscreen"))) view.showFullScreen(); else view.show(); +#endif return app.exec(); } |