From: Heli Hyvättinen Date: Tue, 19 Jul 2011 13:45:15 +0000 (+0300) Subject: Added a "Quit" item to the menu. X-Git-Tag: v0.3.0_fremantle~25 X-Git-Url: http://vcs.maemo.org/git/?p=ghostsoverboard;a=commitdiff_plain;h=9e265901a7205213e8f96445295f4754393bd82c Added a "Quit" item to the menu. The application can again be exited on N900... --- diff --git a/seascene.cpp b/seascene.cpp index 5b81a57..97291ff 100644 --- a/seascene.cpp +++ b/seascene.cpp @@ -423,6 +423,11 @@ void SeaScene::handleScreenTapped() about(); } + else if (pItem == pQuitItem_) + { + qApp->quit(); + } + //Selection is just used to get notice of a menu item being clicked, removed after use @@ -458,6 +463,9 @@ void SeaScene::createMenuItems() pAboutItem_ = new QGraphicsSimpleTextItem("About"); prepareForMenu(pAboutItem_); + pQuitItem_ = new QGraphicsSimpleTextItem("Quit"); + prepareForMenu(pQuitItem_); + } void SeaScene::prepareForMenu(QGraphicsItem * pItem) diff --git a/seascene.h b/seascene.h index 08e6a4e..7a0ea4f 100644 --- a/seascene.h +++ b/seascene.h @@ -116,6 +116,7 @@ protected: QGraphicsSimpleTextItem * pRestartGameItem_; QGraphicsSimpleTextItem * pSettingsItem_; QGraphicsSimpleTextItem * pAboutItem_; + QGraphicsSimpleTextItem * pQuitItem_; QList levelList_;