summaryrefslogtreecommitdiffstats
path: root/examples/graphicsview/dragdroprobot/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/graphicsview/dragdroprobot/main.cpp')
-rw-r--r--examples/graphicsview/dragdroprobot/main.cpp24
1 files changed, 22 insertions, 2 deletions
diff --git a/examples/graphicsview/dragdroprobot/main.cpp b/examples/graphicsview/dragdroprobot/main.cpp
index 8c2acc499a..001b81e0b7 100644
--- a/examples/graphicsview/dragdroprobot/main.cpp
+++ b/examples/graphicsview/dragdroprobot/main.cpp
@@ -45,6 +45,22 @@
#include <math.h>
+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();
}