diff options
Diffstat (limited to 'examples/graphicsview/dragdroprobot')
-rw-r--r-- | examples/graphicsview/dragdroprobot/dragdroprobot.desktop | 11 | ||||
-rw-r--r-- | examples/graphicsview/dragdroprobot/dragdroprobot.pro | 3 | ||||
-rw-r--r-- | examples/graphicsview/dragdroprobot/main.cpp | 24 |
3 files changed, 36 insertions, 2 deletions
diff --git a/examples/graphicsview/dragdroprobot/dragdroprobot.desktop b/examples/graphicsview/dragdroprobot/dragdroprobot.desktop new file mode 100644 index 0000000000..c01e3a3425 --- /dev/null +++ b/examples/graphicsview/dragdroprobot/dragdroprobot.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=Drag and Drop Robot +Exec=/opt/usr/bin/dragdroprobot +Icon=dragdroprobot +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/graphicsview/dragdroprobot/dragdroprobot.pro b/examples/graphicsview/dragdroprobot/dragdroprobot.pro index 579e45d26d..db5d94a600 100644 --- a/examples/graphicsview/dragdroprobot/dragdroprobot.pro +++ b/examples/graphicsview/dragdroprobot/dragdroprobot.pro @@ -19,3 +19,6 @@ INSTALLS += target sources symbian: CONFIG += qt_example QT += widgets +maemo5: CONFIG += qt_example + +simulator: warning(This example might not fully work on Simulator platform) 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(); } |