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 | |
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
58 files changed, 489 insertions, 88 deletions
diff --git a/demos/qt3d/cubehouse/cubehouse.pro b/demos/qt3d/cubehouse/cubehouse.pro index a46698156..c091b465d 100644 --- a/demos/qt3d/cubehouse/cubehouse.pro +++ b/demos/qt3d/cubehouse/cubehouse.pro @@ -18,3 +18,7 @@ OTHER_FILES += \ cubehouse.rc RC_FILE = cubehouse.rc + +symbian { + ICON = ../qt3d.svg +} diff --git a/demos/qt3d/cubehouse/main.cpp b/demos/qt3d/cubehouse/main.cpp index 29326a535..1c0c79533 100644 --- a/demos/qt3d/cubehouse/main.cpp +++ b/demos/qt3d/cubehouse/main.cpp @@ -53,12 +53,18 @@ int main(int argc, char *argv[]) if (QApplication::arguments().contains(QLatin1String("-stereo"))) view.setStereo(true); else if (view.stereoType() != QGLView::RedCyanAnaglyph) - view.setStereo(true); + view.setStereo(true); + +#ifdef Q_OS_SYMBIAN + view.setAttribute(Qt::WA_LockLandscapeOrientation, true); + view.showMaximized(); +#else if (QApplication::arguments().contains(QLatin1String("-maximize"))) view.showMaximized(); else if (QApplication::arguments().contains(QLatin1String("-fullscreen"))) view.showFullScreen(); else view.show(); +#endif return app.exec(); } diff --git a/demos/qt3d/pageflip/pageflip.cpp b/demos/qt3d/pageflip/pageflip.cpp index 5e5768843..9cfc73711 100644 --- a/demos/qt3d/pageflip/pageflip.cpp +++ b/demos/qt3d/pageflip/pageflip.cpp @@ -368,12 +368,20 @@ int main(int argc, char *argv[]) view.setBlend(true); if (QApplication::arguments().contains(QLatin1String("-vertical"))) view.setVertical(true); + + +#ifdef Q_OS_SYMBIAN + view.setAttribute(Qt::WA_LockLandscapeOrientation, true); + view.showMaximized(); +#else if (QApplication::arguments().contains(QLatin1String("-maximize"))) view.showMaximized(); else if (QApplication::arguments().contains(QLatin1String("-fullscreen"))) view.showFullScreen(); else view.show(); +#endif + return app.exec(); } diff --git a/demos/qt3d/pageflip/pageflip.pro b/demos/qt3d/pageflip/pageflip.pro index 8f71925fd..09aab36cd 100644 --- a/demos/qt3d/pageflip/pageflip.pro +++ b/demos/qt3d/pageflip/pageflip.pro @@ -14,3 +14,7 @@ OTHER_FILES += \ pageflip.rc RC_FILE = pageflip.rc + +symbian { + ICON = ../qt3d.svg +} diff --git a/demos/qt3d/photobrowser3d/main.cpp b/demos/qt3d/photobrowser3d/main.cpp index 748866bab..9bdd3f1f5 100644 --- a/demos/qt3d/photobrowser3d/main.cpp +++ b/demos/qt3d/photobrowser3d/main.cpp @@ -59,12 +59,19 @@ int main(int argc, char *argv[]) { PhotoBrowser3DView view; - if (QApplication::arguments().contains("-maximize")) - view.showMaximized(); - else if (QApplication::arguments().contains("-fullscreen")) - view.showFullScreen(); - else - view.show(); +#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 result = app.exec(); } diff --git a/demos/qt3d/photobrowser3d/photobrowser3d.pro b/demos/qt3d/photobrowser3d/photobrowser3d.pro index 26a5c0b47..1a73dd46c 100644 --- a/demos/qt3d/photobrowser3d/photobrowser3d.pro +++ b/demos/qt3d/photobrowser3d/photobrowser3d.pro @@ -70,3 +70,7 @@ OTHER_FILES += \ photobrowser.rc RC_FILE = photobrowser.rc + +symbian { + ICON = ../qt3d.svg +} diff --git a/demos/qt3d/shapes/shapes.cpp b/demos/qt3d/shapes/shapes.cpp index 2ff4b04f4..adfcd9dfe 100644 --- a/demos/qt3d/shapes/shapes.cpp +++ b/demos/qt3d/shapes/shapes.cpp @@ -412,12 +412,18 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); ShapesWidget w; + +#ifdef Q_OS_SYMBIAN + w.setAttribute(Qt::WA_LockLandscapeOrientation, true); + w.showMaximized(); +#else if (QApplication::arguments().contains(QLatin1String("-maximize"))) w.showMaximized(); else if (QApplication::arguments().contains(QLatin1String("-fullscreen"))) w.showFullScreen(); else w.show(); +#endif return app.exec(); } diff --git a/demos/qt3d/shapes/shapes.pro b/demos/qt3d/shapes/shapes.pro index 804f22ba7..af34c1623 100644 --- a/demos/qt3d/shapes/shapes.pro +++ b/demos/qt3d/shapes/shapes.pro @@ -11,3 +11,7 @@ OTHER_FILES += \ shapes.rc RC_FILE = shapes.rc + +symbian { + ICON = ../qt3d.svg +} diff --git a/demos/qt3d/teaservice/teaservice.cpp b/demos/qt3d/teaservice/teaservice.cpp index 8923fb3ae..c19813d7f 100644 --- a/demos/qt3d/teaservice/teaservice.cpp +++ b/demos/qt3d/teaservice/teaservice.cpp @@ -372,6 +372,11 @@ int main(int argc, char *argv[]) menu->addAction(exitAction); QObject::connect(exitAction, SIGNAL(triggered()), &app, SLOT(quit())); +#ifdef Q_OS_SYMBIAN + mainw.setAttribute(Qt::WA_LockLandscapeOrientation, true); + mainw.showMaximized(); +#endif + mainw.show(); return app.exec(); } diff --git a/demos/qt3d/teaservice/teaservice.pro b/demos/qt3d/teaservice/teaservice.pro index f54f3b516..c80bac640 100644 --- a/demos/qt3d/teaservice/teaservice.pro +++ b/demos/qt3d/teaservice/teaservice.pro @@ -15,3 +15,7 @@ OTHER_FILES += \ teaservice.rc RC_FILE = teaservice.rc + +symbian { + ICON = ../qt3d.svg +} diff --git a/demos/quick3d/model_viewer/main.cpp b/demos/quick3d/model_viewer/main.cpp index ab6547065..82a0c1535 100644 --- a/demos/quick3d/model_viewer/main.cpp +++ b/demos/quick3d/model_viewer/main.cpp @@ -40,24 +40,29 @@ ****************************************************************************/ #include <QtGui/QApplication> -#include <QtDeclarative/qdeclarativeview.h> +#include "qdeclarativeview3d.h" #include "../qmlres.h" int main(int argc, char *argv[]) { QApplication app(argc, argv); - - QDeclarativeView view; + QDeclarativeView3D view; QString qml = q_get_qmldir(QLatin1String("qml/model_viewer.qml")); view.setSource(QUrl::fromLocalFile(qml)); +#ifdef Q_OS_SYMBIAN + view.setAttribute(Qt::WA_LockLandscapeOrientation, true); + view.setResizeMode(QDeclarativeView::SizeRootObjectToView); + view.showMaximized(); +#else if (QApplication::arguments().contains(QLatin1String("-maximize"))) view.showMaximized(); else if (QApplication::arguments().contains(QLatin1String("-fullscreen"))) view.showFullScreen(); else view.show(); +#endif return app.exec(); } diff --git a/demos/quick3d/robo_bounce/main.cpp b/demos/quick3d/robo_bounce/main.cpp index 530382542..25038bff1 100644 --- a/demos/quick3d/robo_bounce/main.cpp +++ b/demos/quick3d/robo_bounce/main.cpp @@ -40,21 +40,27 @@ ****************************************************************************/ #include <QtGui/QApplication> -#include <QtDeclarative/qdeclarativeview.h> +#include "qdeclarativeview3d.h" int main(int argc, char *argv[]) { QApplication app(argc, argv); - QDeclarativeView view; + QDeclarativeView3D view; view.setSource(QUrl(QLatin1String("qrc:///qml/robobounce.qml"))); +#ifdef Q_OS_SYMBIAN + view.setAttribute(Qt::WA_LockLandscapeOrientation, true); + view.setResizeMode(QDeclarativeView::SizeRootObjectToView); + view.showMaximized(); +#else if (QApplication::arguments().contains(QLatin1String("-maximize"))) view.showMaximized(); else if (QApplication::arguments().contains(QLatin1String("-fullscreen"))) view.showFullScreen(); else view.show(); +#endif return app.exec(); } diff --git a/demos/quick3d/tea_service/main.cpp b/demos/quick3d/tea_service/main.cpp index 252cc2fbc..4c992c305 100644 --- a/demos/quick3d/tea_service/main.cpp +++ b/demos/quick3d/tea_service/main.cpp @@ -40,7 +40,7 @@ ****************************************************************************/ #include <QtGui/QApplication> -#include <QtDeclarative/qdeclarativeview.h> +#include "qdeclarativeview3d.h" #include "../qmlres.h" @@ -48,16 +48,22 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); - QDeclarativeView view; + QDeclarativeView3D view; QString qml = q_get_qmldir(QLatin1String("qml/teaservice.qml")); view.setSource(QUrl::fromLocalFile(qml)); +#ifdef Q_OS_SYMBIAN + view.setAttribute(Qt::WA_LockLandscapeOrientation, true); + view.setResizeMode(QDeclarativeView::SizeRootObjectToView); + view.showMaximized(); +#else if (QApplication::arguments().contains(QLatin1String("-maximize"))) view.showMaximized(); else if (QApplication::arguments().contains(QLatin1String("-fullscreen"))) view.showFullScreen(); else view.show(); +#endif return app.exec(); } diff --git a/examples/qt3d/basket/main.cpp b/examples/qt3d/basket/main.cpp index c8d28193d..7e01fb114 100644 --- a/examples/qt3d/basket/main.cpp +++ b/examples/qt3d/basket/main.cpp @@ -45,6 +45,11 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); BasketView 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"))) @@ -53,5 +58,6 @@ int main(int argc, char *argv[]) view.showFullScreen(); else view.show(); +#endif return app.exec(); } diff --git a/examples/qt3d/builder/main.cpp b/examples/qt3d/builder/main.cpp index ade7d1008..0bc270ab4 100644 --- a/examples/qt3d/builder/main.cpp +++ b/examples/qt3d/builder/main.cpp @@ -46,6 +46,10 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); BuilderView 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"))) @@ -54,5 +58,6 @@ int main(int argc, char *argv[]) view.showFullScreen(); else view.show(); +#endif return app.exec(); } diff --git a/examples/qt3d/cube/cube.pro b/examples/qt3d/cube/cube.pro index 7b2d2877e..4f21388ab 100644 --- a/examples/qt3d/cube/cube.pro +++ b/examples/qt3d/cube/cube.pro @@ -13,3 +13,7 @@ OTHER_FILES += \ cube.rc RC_FILE = cube.rc + +symbian { + ICON = ../qt3d.svg +} diff --git a/examples/qt3d/cube/main.cpp b/examples/qt3d/cube/main.cpp index 1def235d5..d3f32778a 100644 --- a/examples/qt3d/cube/main.cpp +++ b/examples/qt3d/cube/main.cpp @@ -45,6 +45,10 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); CubeView 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"))) @@ -53,5 +57,6 @@ int main(int argc, char *argv[]) view.showFullScreen(); else view.show(); +#endif return app.exec(); } diff --git a/examples/qt3d/cylinder/cylinder.pro b/examples/qt3d/cylinder/cylinder.pro index a7e90f48a..3fd34e9d7 100644 --- a/examples/qt3d/cylinder/cylinder.pro +++ b/examples/qt3d/cylinder/cylinder.pro @@ -13,3 +13,7 @@ OTHER_FILES += \ cylinder.rc RC_FILE = cylinder.rc + +symbian { + ICON = ../qt3d.svg +} diff --git a/examples/qt3d/cylinder/main.cpp b/examples/qt3d/cylinder/main.cpp index 5ea06b74e..283fd6292 100644 --- a/examples/qt3d/cylinder/main.cpp +++ b/examples/qt3d/cylinder/main.cpp @@ -45,6 +45,10 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); CylinderView 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"))) @@ -53,5 +57,6 @@ int main(int argc, char *argv[]) view.showFullScreen(); else view.show(); +#endif return app.exec(); } 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(); } diff --git a/examples/qt3d/graphicsview/graphicsview.pro b/examples/qt3d/graphicsview/graphicsview.pro index 758957e69..d01ebf6db 100644 --- a/examples/qt3d/graphicsview/graphicsview.pro +++ b/examples/qt3d/graphicsview/graphicsview.pro @@ -32,3 +32,11 @@ OTHER_FILES += \ graphicsview.rc RC_FILE = graphicsview.rc + +symbian { + ICON = ../qt3d.svg +} + +symbian { + ICON = ../qt3d.svg +} diff --git a/examples/qt3d/graphicsview/main.cpp b/examples/qt3d/graphicsview/main.cpp index 39a3d7a08..831af4d75 100644 --- a/examples/qt3d/graphicsview/main.cpp +++ b/examples/qt3d/graphicsview/main.cpp @@ -54,5 +54,9 @@ int main(int argc, char *argv[]) view.setViewport(new QGLWidget(format)); view.show(); +#ifdef Q_OS_SYMBIAN + view.setAttribute(Qt::WA_LockLandscapeOrientation, true); + view.showMaximized(); +#endif return app.exec(); } diff --git a/examples/qt3d/nesting/main.cpp b/examples/qt3d/nesting/main.cpp index f3d5764d0..46bd53300 100644 --- a/examples/qt3d/nesting/main.cpp +++ b/examples/qt3d/nesting/main.cpp @@ -45,13 +45,20 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); CubeView view; + +#ifdef Q_OS_SYMBIAN + view.setAttribute(Qt::WA_LockLandscapeOrientation, true); + view.showMaximized(); +#else if (view.stereoType() != QGLView::RedCyanAnaglyph) - view.camera()->setEyeSeparation(0.5f); + 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(); } diff --git a/examples/qt3d/nesting/nesting.pro b/examples/qt3d/nesting/nesting.pro index f1b179702..a0734a410 100644 --- a/examples/qt3d/nesting/nesting.pro +++ b/examples/qt3d/nesting/nesting.pro @@ -13,3 +13,7 @@ OTHER_FILES += \ nesting.rc RC_FILE = nesting.rc + +symbian { + ICON = ../qt3d.svg +} diff --git a/examples/qt3d/solarsystem/main.cpp b/examples/qt3d/solarsystem/main.cpp index 6a27309da..8bad03066 100644 --- a/examples/qt3d/solarsystem/main.cpp +++ b/examples/qt3d/solarsystem/main.cpp @@ -46,6 +46,11 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); SolarSystemView 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"))) @@ -54,5 +59,7 @@ int main(int argc, char *argv[]) view.showFullScreen(); else view.show(); +#endif + return app.exec(); } diff --git a/examples/qt3d/solarsystem/solarsystem.pro b/examples/qt3d/solarsystem/solarsystem.pro index 71e9e595e..42d8cfde8 100644 --- a/examples/qt3d/solarsystem/solarsystem.pro +++ b/examples/qt3d/solarsystem/solarsystem.pro @@ -22,3 +22,7 @@ OTHER_FILES += \ solarsystem.rc RC_FILE = solarsystem.rc + +symbian { + ICON = ../qt3d.svg +} diff --git a/examples/qt3d/tank/main.cpp b/examples/qt3d/tank/main.cpp index 3907c5272..930e2b439 100644 --- a/examples/qt3d/tank/main.cpp +++ b/examples/qt3d/tank/main.cpp @@ -50,12 +50,20 @@ int main(int argc, char *argv[]) QApplication a(argc, argv); TankView 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 a.exec(); } diff --git a/examples/qt3d/tank/tank.pro b/examples/qt3d/tank/tank.pro index 1f1daef2c..3b4b932f4 100644 --- a/examples/qt3d/tank/tank.pro +++ b/examples/qt3d/tank/tank.pro @@ -18,3 +18,7 @@ OTHER_FILES += \ tank.rc RC_FILE = tank.rc + +symbian { + ICON = ../qt3d.svg +} diff --git a/examples/qt3d/teapot/main.cpp b/examples/qt3d/teapot/main.cpp index e14a10306..c5cc7b432 100644 --- a/examples/qt3d/teapot/main.cpp +++ b/examples/qt3d/teapot/main.cpp @@ -47,6 +47,11 @@ int main(int argc, char *argv[]) QApplication app(argc, argv); TeapotView view; //! [main-args] + +#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"))) @@ -55,6 +60,8 @@ int main(int argc, char *argv[]) view.showFullScreen(); else view.show(); +#endif + //! [main-args-end] return app.exec(); } diff --git a/examples/qt3d/teapot/teapot.pro b/examples/qt3d/teapot/teapot.pro index dbd8de35f..ef24b6635 100644 --- a/examples/qt3d/teapot/teapot.pro +++ b/examples/qt3d/teapot/teapot.pro @@ -12,3 +12,7 @@ OTHER_FILES += \ teapot.rc RC_FILE = teapot.rc + +symbian { + ICON = ../qt3d.svg +} diff --git a/examples/quick3d/basket/basket.pro b/examples/quick3d/basket/basket.pro index 4ebc0c053..9bf8cf622 100644 --- a/examples/quick3d/basket/basket.pro +++ b/examples/quick3d/basket/basket.pro @@ -3,6 +3,8 @@ TARGET = basket_qml CONFIG += qt warn_on !package: CONFIG += qt3dquick +!package: CONFIG += qt3dquick + SOURCES += main.cpp include(../../../qt3dquick_pkg_dep.pri) diff --git a/examples/quick3d/basket/main.cpp b/examples/quick3d/basket/main.cpp index 1dd1a61da..c751194ac 100644 --- a/examples/quick3d/basket/main.cpp +++ b/examples/quick3d/basket/main.cpp @@ -38,24 +38,29 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ - #include <QtGui/QApplication> -#include <QtDeclarative/qdeclarativeview.h> -#include <QtCore/qdir.h> +#include "qdeclarativeview3d.h" int main(int argc, char *argv[]) { QApplication app(argc, argv); - QDeclarativeView view; + QDeclarativeView3D view; + view.setSource(QUrl(QLatin1String("qrc:///qml/basket.qml"))); +#ifdef Q_OS_SYMBIAN + view.setAttribute(Qt::WA_LockLandscapeOrientation, true); + view.setResizeMode(QDeclarativeView::SizeRootObjectToView); + view.showMaximized(); +#else if (QApplication::arguments().contains(QLatin1String("-maximize"))) view.showMaximized(); else if (QApplication::arguments().contains(QLatin1String("-fullscreen"))) view.showFullScreen(); else view.show(); +#endif return app.exec(); } diff --git a/examples/quick3d/basket/qml/basket.jpg b/examples/quick3d/basket/qml/basket.jpg Binary files differindex 438e7a0c2..c292a83d9 100644 --- a/examples/quick3d/basket/qml/basket.jpg +++ b/examples/quick3d/basket/qml/basket.jpg diff --git a/examples/quick3d/cube/main.cpp b/examples/quick3d/cube/main.cpp index b8c32ade6..7e369f73f 100644 --- a/examples/quick3d/cube/main.cpp +++ b/examples/quick3d/cube/main.cpp @@ -40,7 +40,7 @@ ****************************************************************************/ #include <QtGui/QApplication> -#include <QtDeclarative/qdeclarativeview.h> +#include "qdeclarativeview3d.h" #include "../qmlres.h" @@ -48,16 +48,23 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); - QDeclarativeView view; + QDeclarativeView3D view; QString qml = q_get_qmldir(QLatin1String("qml/cube.qml")); + view.setSource(QUrl::fromLocalFile(qml)); +#ifdef Q_OS_SYMBIAN + view.setAttribute(Qt::WA_LockLandscapeOrientation, true); + view.setResizeMode(QDeclarativeView::SizeRootObjectToView); + view.showMaximized(); +#else if (QApplication::arguments().contains(QLatin1String("-maximize"))) view.showMaximized(); else if (QApplication::arguments().contains(QLatin1String("-fullscreen"))) view.showFullScreen(); else view.show(); +#endif return app.exec(); } diff --git a/examples/quick3d/forest/forest.pro b/examples/quick3d/forest/forest.pro index 6d78ecbfe..5d19b8147 100644 --- a/examples/quick3d/forest/forest.pro +++ b/examples/quick3d/forest/forest.pro @@ -3,6 +3,8 @@ TARGET = forest_qml CONFIG += qt warn_on !package: CONFIG += qt3dquick +!package: CONFIG += qt3dquick + SOURCES += main.cpp include(../../../qt3dquick_pkg_dep.pri) diff --git a/examples/quick3d/forest/main.cpp b/examples/quick3d/forest/main.cpp index 7abf20c24..9eacd5cd9 100644 --- a/examples/quick3d/forest/main.cpp +++ b/examples/quick3d/forest/main.cpp @@ -40,24 +40,31 @@ ****************************************************************************/ #include <QtGui/QApplication> -#include <QtDeclarative/qdeclarativeview.h> +#include "qdeclarativeview3d.h" #include "../qmlres.h" int main(int argc, char *argv[]) { QApplication app(argc, argv); + QDeclarativeView3D view; - QDeclarativeView view; QString qml = q_get_qmldir(QLatin1String("qml/forest.qml")); + view.setSource(QUrl::fromLocalFile(qml)); +#ifdef Q_OS_SYMBIAN + view.setAttribute(Qt::WA_LockLandscapeOrientation, true); + view.setResizeMode(QDeclarativeView::SizeRootObjectToView); + view.showMaximized(); +#else if (QApplication::arguments().contains(QLatin1String("-maximize"))) view.showMaximized(); else if (QApplication::arguments().contains(QLatin1String("-fullscreen"))) view.showFullScreen(); else view.show(); +#endif return app.exec(); } diff --git a/examples/quick3d/lander/main.cpp b/examples/quick3d/lander/main.cpp index 848e5908e..623e8eae8 100644 --- a/examples/quick3d/lander/main.cpp +++ b/examples/quick3d/lander/main.cpp @@ -38,9 +38,8 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ - #include <QtGui/QApplication> -#include <QtDeclarative/qdeclarativeview.h> +#include "qdeclarativeview3d.h" #include "../qmlres.h" @@ -48,16 +47,22 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); - QDeclarativeView view; + QDeclarativeView3D view; QString qml = q_get_qmldir(QLatin1String("qml/lander.qml")); view.setSource(QUrl::fromLocalFile(qml)); +#ifdef Q_OS_SYMBIAN + view.setAttribute(Qt::WA_LockLandscapeOrientation, true); + view.setResizeMode(QDeclarativeView::SizeRootObjectToView); + view.showMaximized(); +#else if (QApplication::arguments().contains(QLatin1String("-maximize"))) view.showMaximized(); else if (QApplication::arguments().contains(QLatin1String("-fullscreen"))) view.showFullScreen(); else view.show(); +#endif return app.exec(); } diff --git a/examples/quick3d/matrix_animation/main.cpp b/examples/quick3d/matrix_animation/main.cpp index 54d7df86d..6afc45f3e 100644 --- a/examples/quick3d/matrix_animation/main.cpp +++ b/examples/quick3d/matrix_animation/main.cpp @@ -40,24 +40,29 @@ ****************************************************************************/ #include <QtGui/QApplication> -#include <QtDeclarative/qdeclarativeview.h> - +#include "qdeclarativeview3d.h" #include "../qmlres.h" int main(int argc, char *argv[]) { QApplication app(argc, argv); - QDeclarativeView view; + QDeclarativeView3D view; QString qml = q_get_qmldir(QLatin1String("qml/matrix-animation.qml")); view.setSource(QUrl::fromLocalFile(qml)); +#ifdef Q_OS_SYMBIAN + view.setAttribute(Qt::WA_LockLandscapeOrientation, true); + view.setResizeMode(QDeclarativeView::SizeRootObjectToView); + view.showMaximized(); +#else if (QApplication::arguments().contains(QLatin1String("-maximize"))) view.showMaximized(); else if (QApplication::arguments().contains(QLatin1String("-fullscreen"))) view.showFullScreen(); else view.show(); +#endif return app.exec(); } diff --git a/examples/quick3d/monkeygod/main.cpp b/examples/quick3d/monkeygod/main.cpp index 15d0eea02..7f7df0655 100644 --- a/examples/quick3d/monkeygod/main.cpp +++ b/examples/quick3d/monkeygod/main.cpp @@ -40,7 +40,7 @@ ****************************************************************************/ #include <QtGui/QApplication> -#include <QtDeclarative/qdeclarativeview.h> +#include "qdeclarativeview3d.h" #include "../qmlres.h" @@ -48,16 +48,22 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); - QDeclarativeView view; + QDeclarativeView3D view; QString qml = q_get_qmldir(QLatin1String("qml/monkeygod.qml")); view.setSource(QUrl::fromLocalFile(qml)); +#ifdef Q_OS_SYMBIAN + view.setAttribute(Qt::WA_LockLandscapeOrientation, true); + view.setResizeMode(QDeclarativeView::SizeRootObjectToView); + view.showMaximized(); +#else if (QApplication::arguments().contains(QLatin1String("-maximize"))) view.showMaximized(); else if (QApplication::arguments().contains(QLatin1String("-fullscreen"))) view.showFullScreen(); else view.show(); +#endif return app.exec(); } diff --git a/examples/quick3d/moon/main.cpp b/examples/quick3d/moon/main.cpp index 82c7c1216..22000ace2 100644 --- a/examples/quick3d/moon/main.cpp +++ b/examples/quick3d/moon/main.cpp @@ -40,7 +40,7 @@ ****************************************************************************/ #include <QtGui/QApplication> -#include <QtDeclarative/qdeclarativeview.h> +#include "qdeclarativeview3d.h" #include "../qmlres.h" @@ -48,16 +48,21 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); - QDeclarativeView view; + QDeclarativeView3D view; QString qml = q_get_qmldir(QLatin1String("qml/moon.qml")); view.setSource(QUrl::fromLocalFile(qml)); +#ifdef Q_OS_SYMBIAN + view.setAttribute(Qt::WA_LockLandscapeOrientation, true); + view.setResizeMode(QDeclarativeView::SizeRootObjectToView); + view.showMaximized(); +#else if (QApplication::arguments().contains(QLatin1String("-maximize"))) view.showMaximized(); else if (QApplication::arguments().contains(QLatin1String("-fullscreen"))) view.showFullScreen(); else view.show(); - +#endif return app.exec(); } diff --git a/examples/quick3d/photoroom/main.cpp b/examples/quick3d/photoroom/main.cpp index 20f2bc916..afb35002e 100644 --- a/examples/quick3d/photoroom/main.cpp +++ b/examples/quick3d/photoroom/main.cpp @@ -40,7 +40,7 @@ ****************************************************************************/ #include <QtGui/QApplication> -#include <QtDeclarative/qdeclarativeview.h> +#include "qdeclarativeview3d.h" #include "../qmlres.h" @@ -48,7 +48,7 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); - QDeclarativeView view; + QDeclarativeView3D view; QString qml = q_get_qmldir(QLatin1String("qml/photoroom.qml")); view.setSource(QUrl::fromLocalFile(qml)); diff --git a/examples/quick3d/shaders/main.cpp b/examples/quick3d/shaders/main.cpp index 49a1aab0e..69e9b6203 100644 --- a/examples/quick3d/shaders/main.cpp +++ b/examples/quick3d/shaders/main.cpp @@ -40,7 +40,7 @@ ****************************************************************************/ #include <QtGui/QApplication> -#include <QtDeclarative/qdeclarativeview.h> +#include "qdeclarativeview3d.h" #include "../qmlres.h" @@ -48,16 +48,22 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); - QDeclarativeView view; + QDeclarativeView3D view; QString qml = q_get_qmldir(QLatin1String("qml/shaders.qml")); view.setSource(QUrl::fromLocalFile(qml)); +#ifdef Q_OS_SYMBIAN + view.setAttribute(Qt::WA_LockLandscapeOrientation, true); + view.setResizeMode(QDeclarativeView::SizeRootObjectToView); + view.showMaximized(); +#else if (QApplication::arguments().contains(QLatin1String("-maximize"))) view.showMaximized(); else if (QApplication::arguments().contains(QLatin1String("-fullscreen"))) view.showFullScreen(); else view.show(); +#endif return app.exec(); } diff --git a/examples/quick3d/sphere/main.cpp b/examples/quick3d/sphere/main.cpp index e64e3d738..25d5f7a3d 100644 --- a/examples/quick3d/sphere/main.cpp +++ b/examples/quick3d/sphere/main.cpp @@ -40,7 +40,7 @@ ****************************************************************************/ #include <QtGui/QApplication> -#include <QtDeclarative/qdeclarativeview.h> +#include "qdeclarativeview3d.h" #include "../qmlres.h" @@ -48,16 +48,22 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); - QDeclarativeView view; + QDeclarativeView3D view; QString qml = q_get_qmldir(QLatin1String("qml/sphere.qml")); view.setSource(QUrl::fromLocalFile(qml)); +#ifdef Q_OS_SYMBIAN + view.setAttribute(Qt::WA_LockLandscapeOrientation, true); + view.setResizeMode(QDeclarativeView::SizeRootObjectToView); + view.showMaximized(); +#else if (QApplication::arguments().contains(QLatin1String("-maximize"))) view.showMaximized(); else if (QApplication::arguments().contains(QLatin1String("-fullscreen"))) view.showFullScreen(); else view.show(); +#endif return app.exec(); } diff --git a/src/imports/threed/viewport.cpp b/src/imports/threed/viewport.cpp index efb3be519..d5da789ab 100644 --- a/src/imports/threed/viewport.cpp +++ b/src/imports/threed/viewport.cpp @@ -444,18 +444,20 @@ void Viewport::paint(QPainter *p, const QStyleOptionGraphicsItem * style, QWidge if (!painter.begin(p)) { if (widget) { // Probably running with a plain QDeclarativeView (e.g. qmlviewer). - // Switch the surrounding QGraphicsView to use a QGLWidget as its - // viewport. We cannot do it here during painting, so schedule a - // slot to switch it the next time we reach the event loop. + // We need to have switched the surrounding QGraphicsView to use a + // QGLWidget as its viewport. QGraphicsView *view = qobject_cast<QGraphicsView *>(widget->parentWidget()); - if (view) { - QTimer::singleShot(0, this, SLOT(switchToOpenGL())); + if (!view) { return; + } else { + QGLWidget *glw = qobject_cast<QGLWidget *>(view->viewport()); + if (!glw) { + qWarning("GL graphics system is not active; cannot use 3D items"); + return; + } } } - qWarning("GL graphics system is not active; cannot use 3D items"); - return; } // Initialize the objects in the scene if this is the first paint. @@ -731,33 +733,6 @@ void Viewport::cameraChanged() update(); } -/*! - \internal -*/ -void Viewport::switchToOpenGL() -{ - // If there are multiple Viewport items in the QML, then it is - // possible that another Viewport has already switched to QGLWidget. - QList<QGraphicsView *> views = scene()->views(); - if (!views.isEmpty()) { - QGLWidget *glw = qobject_cast<QGLWidget *>(views[0]->viewport()); - if (glw) { - d->viewWidget = glw; - return; - } - } - - QGraphicsView *view = - qobject_cast<QGraphicsView *>(d->viewWidget->parentWidget()); - if (view) { - bool focused = view->viewport()->hasFocus(); - d->viewWidget = new QGLWidget(view); - view->setViewport(d->viewWidget); - if (focused) - d->viewWidget->setFocus(); - } -} - static inline void sendEnterEvent(QObject *object) { QEvent event(QEvent::Enter); diff --git a/src/imports/threed/viewport.h b/src/imports/threed/viewport.h index 62f304eb1..9e8024127 100644 --- a/src/imports/threed/viewport.h +++ b/src/imports/threed/viewport.h @@ -109,8 +109,7 @@ public Q_SLOTS: void update3d(); private Q_SLOTS: - void cameraChanged(); - void switchToOpenGL(); + void cameraChanged(); protected: void mousePressEvent(QGraphicsSceneMouseEvent *event); diff --git a/src/quick3d/qdeclarativeview3d.cpp b/src/quick3d/qdeclarativeview3d.cpp new file mode 100644 index 000000000..1ddd84284 --- /dev/null +++ b/src/quick3d/qdeclarativeview3d.cpp @@ -0,0 +1,88 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtQuick3D module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qdeclarativeview3d.h" +#include <QtOpenGL/QGLWidget> + +/*! + \qmlclass QDeclarativeView3D + \brief The QDeclarativeView3D replaces the QDeclarativeView for applications + using OpenGL. + \since 4.8 + \ingroup qt3d::qml3d + + \section1 Usage + + This class is substituted for the QDeclarativeView class when creating + Qt3D applications. It replaces the standard raster viewport with an OpenGL + capable viewport suitable for rendering 3D content. +*/ + +QT_BEGIN_NAMESPACE + +/*! + \internal +*/ +QDeclarativeView3D::QDeclarativeView3D(QWidget *parent) : QDeclarativeView(parent) +{ + //Set up the GL viewport widget format in the same manner that + //qmlviewer does when openGL is specified. + QGLFormat format = QGLFormat::defaultFormat(); +#ifdef Q_WS_MAC + format.setSampleBuffers(true); +#else + format.setSampleBuffers(false); +#endif + + //Assign a GLWidget as the viewport. + defaultViewportWidget = new QGLWidget(format); + setViewport(defaultViewportWidget); +} + +/*! + \internal +*/ +QDeclarativeView3D::~QDeclarativeView3D() +{ + if (defaultViewportWidget) delete defaultViewportWidget; +} + +QT_END_NAMESPACE diff --git a/src/quick3d/qdeclarativeview3d.h b/src/quick3d/qdeclarativeview3d.h new file mode 100644 index 000000000..a59f6c767 --- /dev/null +++ b/src/quick3d/qdeclarativeview3d.h @@ -0,0 +1,70 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtQuick3D module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QDECLARATIVEVIEW3D_H +#define QDECLARATIVEVIEW3D_H + +#include <QtDeclarative/qdeclarativeview.h> +#include "qt3dquickglobal.h" + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(QtQuick3D) + +class QGLWidget; + +class Q_QT3D_QUICK_EXPORT QDeclarativeView3D : public QDeclarativeView +{ +public: + QDeclarativeView3D(QWidget *parent = 0); + ~QDeclarativeView3D(); + +protected: + QGLWidget *defaultViewportWidget; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif diff --git a/src/quick3d/quick3d.pri b/src/quick3d/quick3d.pri index 35d178eeb..97a637def 100644 --- a/src/quick3d/quick3d.pri +++ b/src/quick3d/quick3d.pri @@ -6,9 +6,13 @@ HEADERS += \ qdeclarativeitem3d.h \ qdeclarativeeffect.h \ qdeclarativemesh.h \ - qdeclarativeviewport.h \ + qdeclarativeview3d.h \ + qdeclarativeviewport.h + SOURCES += \ qdeclarativeeffect.cpp \ qdeclarativeitem3d.cpp \ + qdeclarativeview3d.cpp \ qdeclarativemesh.cpp + diff --git a/tutorials/qt3d/cube1/cube1.pro b/tutorials/qt3d/cube1/cube1.pro index 0054518f1..04230cb32 100644 --- a/tutorials/qt3d/cube1/cube1.pro +++ b/tutorials/qt3d/cube1/cube1.pro @@ -4,3 +4,7 @@ CONFIG += qt warn_on qt3d SOURCES = cubeview.cpp main.cpp HEADERS = cubeview.h DESTDIR = ../../../../bin/qt3d/tutorials + +symbian { + ICON = ../../qt3d.svg +} diff --git a/tutorials/qt3d/cube2/cube2.pro b/tutorials/qt3d/cube2/cube2.pro index 61f496fd3..2d1ecbace 100644 --- a/tutorials/qt3d/cube2/cube2.pro +++ b/tutorials/qt3d/cube2/cube2.pro @@ -4,3 +4,7 @@ CONFIG += qt warn_on qt3d SOURCES = cubeview.cpp main.cpp HEADERS = cubeview.h DESTDIR = ../../../../bin/qt3d/tutorials + +symbian { + ICON = ../../qt3d.svg +} diff --git a/tutorials/qt3d/cube3/cube3.pro b/tutorials/qt3d/cube3/cube3.pro index b61205e2c..aca98164a 100644 --- a/tutorials/qt3d/cube3/cube3.pro +++ b/tutorials/qt3d/cube3/cube3.pro @@ -4,3 +4,7 @@ CONFIG += qt warn_on qt3d SOURCES = cubeview.cpp main.cpp HEADERS = cubeview.h DESTDIR = ../../../../bin/qt3d/tutorials + +symbian { + ICON = ../../qt3d.svg +} diff --git a/tutorials/qt3d/cube4/cube4.pro b/tutorials/qt3d/cube4/cube4.pro index 46b6c3c2f..908a35230 100644 --- a/tutorials/qt3d/cube4/cube4.pro +++ b/tutorials/qt3d/cube4/cube4.pro @@ -5,3 +5,7 @@ SOURCES = cubeview.cpp main.cpp HEADERS = cubeview.h RESOURCES = cube.qrc DESTDIR = ../../../../bin/qt3d/tutorials + +symbian { + ICON = ../../qt3d.svg +} diff --git a/tutorials/qt3d/penguin/penguin.pro b/tutorials/qt3d/penguin/penguin.pro index 7f179dbf3..a1b710117 100644 --- a/tutorials/qt3d/penguin/penguin.pro +++ b/tutorials/qt3d/penguin/penguin.pro @@ -6,3 +6,7 @@ SOURCES = modelview.cpp \ HEADERS = modelview.h RESOURCES = model.qrc DESTDIR = ../../../../bin/qt3d/tutorials + +symbian { + ICON = ../../qt3d.svg +} diff --git a/tutorials/qt3d/penguin_advanced/penguin_advanced.pro b/tutorials/qt3d/penguin_advanced/penguin_advanced.pro index 35aab03ed..f728a277d 100644 --- a/tutorials/qt3d/penguin_advanced/penguin_advanced.pro +++ b/tutorials/qt3d/penguin_advanced/penguin_advanced.pro @@ -6,3 +6,7 @@ SOURCES = modelview.cpp \ main.cpp HEADERS = modelview.h RESOURCES = model_advanced.qrc + +symbian { + ICON = ../../qt3d.svg +} diff --git a/tutorials/quick3d/teapot_bounce_qml/main.cpp b/tutorials/quick3d/teapot_bounce_qml/main.cpp index 65b03b85a..7c2cb4652 100644 --- a/tutorials/quick3d/teapot_bounce_qml/main.cpp +++ b/tutorials/quick3d/teapot_bounce_qml/main.cpp @@ -40,8 +40,7 @@ ****************************************************************************/ #include <QtGui/QApplication> -#include <QtDeclarative/qdeclarativeview.h> -#include <QtCore/qdir.h> +#include "qdeclarativeview3d.h" #include "../qmlres.h" @@ -49,16 +48,22 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); - QDeclarativeView view; + QDeclarativeView3D view; QString qml = q_get_qmldir(QLatin1String("qml/teapot-bounce.qml")); view.setSource(QUrl::fromLocalFile(qml)); +#ifdef Q_OS_SYMBIAN + view.setAttribute(Qt::WA_LockLandscapeOrientation, true); + view.setResizeMode(QDeclarativeView::SizeRootObjectToView); + view.showMaximized(); +#else if (QApplication::arguments().contains(QLatin1String("-maximize"))) view.showMaximized(); else if (QApplication::arguments().contains(QLatin1String("-fullscreen"))) view.showFullScreen(); else view.show(); +#endif return app.exec(); } diff --git a/tutorials/quick3d/teapot_qml/main.cpp b/tutorials/quick3d/teapot_qml/main.cpp index ac83cf125..fc86aef23 100644 --- a/tutorials/quick3d/teapot_qml/main.cpp +++ b/tutorials/quick3d/teapot_qml/main.cpp @@ -40,8 +40,7 @@ ****************************************************************************/ #include <QtGui/QApplication> -#include <QtDeclarative/qdeclarativeview.h> -#include <QtCore/qdir.h> +#include "qdeclarativeview3d.h" #include "../qmlres.h" @@ -49,16 +48,22 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); - QDeclarativeView view; + QDeclarativeView3D view; QString qml = q_get_qmldir(QLatin1String("qml/teapot.qml")); view.setSource(QUrl::fromLocalFile(qml)); +#ifdef Q_OS_SYMBIAN + view.setAttribute(Qt::WA_LockLandscapeOrientation, true); + view.setResizeMode(QDeclarativeView::SizeRootObjectToView); + view.showMaximized(); +#else if (QApplication::arguments().contains(QLatin1String("-maximize"))) view.showMaximized(); else if (QApplication::arguments().contains(QLatin1String("-fullscreen"))) view.showFullScreen(); else view.show(); +#endif return app.exec(); } |