Added a "Quit" item to the menu.
authorHeli Hyvättinen <heli.hyvattinen@kymp.net>
Tue, 19 Jul 2011 13:45:15 +0000 (16:45 +0300)
committerHeli Hyvättinen <heli.hyvattinen@kymp.net>
Tue, 19 Jul 2011 13:45:15 +0000 (16:45 +0300)
The application can again be exited on N900...

seascene.cpp
seascene.h

index 5b81a57..97291ff 100644 (file)
@@ -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)
index 08e6a4e..7a0ea4f 100644 (file)
@@ -116,6 +116,7 @@ protected:
     QGraphicsSimpleTextItem * pRestartGameItem_;
     QGraphicsSimpleTextItem * pSettingsItem_;
     QGraphicsSimpleTextItem * pAboutItem_;
+    QGraphicsSimpleTextItem * pQuitItem_;
 
     QList<Level> levelList_;