From 0748751c9f097d9d866605306bbdd4b96e2a5c4e Mon Sep 17 00:00:00 2001 From: David Boddie Date: Wed, 27 Apr 2011 19:16:41 +0200 Subject: Squashed commit of the changes from the mobile-examples repository (4.7-generated-declarative branch). --- examples/graphicsview/dragdroprobot/main.cpp | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'examples/graphicsview/dragdroprobot/main.cpp') diff --git a/examples/graphicsview/dragdroprobot/main.cpp b/examples/graphicsview/dragdroprobot/main.cpp index 315d2b6917..c8b84ecb97 100644 --- a/examples/graphicsview/dragdroprobot/main.cpp +++ b/examples/graphicsview/dragdroprobot/main.cpp @@ -45,6 +45,22 @@ #include +class GraphicsView : public QGraphicsView +{ +public: + GraphicsView(QGraphicsScene *scene) : QGraphicsView(scene) + { + } + +protected: + virtual void resizeEvent(QResizeEvent *event) + { +#if defined(Q_OS_SYMBIAN) + fitInView(sceneRect(), Qt::KeepAspectRatio); +#endif + } +}; + //! [0] int main(int argc, char **argv) { @@ -69,12 +85,16 @@ int main(int argc, char **argv) scene.addItem(robot); //! [1] //! [2] - QGraphicsView view(&scene); + GraphicsView view(&scene); view.setRenderHint(QPainter::Antialiasing); view.setViewportUpdateMode(QGraphicsView::BoundingRectViewportUpdate); view.setBackgroundBrush(QColor(230, 200, 167)); view.setWindowTitle("Drag and Drop Robot"); - view.show(); +#if defined(Q_OS_SYMBIAN) + view.showMaximized(); +#else + view.show(); +#endif return app.exec(); } -- cgit v1.2.3