From 9e265901a7205213e8f96445295f4754393bd82c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Heli=20Hyv=C3=A4ttinen?= Date: Tue, 19 Jul 2011 16:45:15 +0300 Subject: [PATCH] Added a "Quit" item to the menu. The application can again be exited on N900... --- seascene.cpp | 8 ++++++++ seascene.h | 1 + 2 files changed, 9 insertions(+) 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_; -- 1.7.9.5