Menu buttons for map and list views, no functionality yet.
authorKaj Wallin <kaj.wallin@ixonos.com>
Mon, 29 Mar 2010 05:49:10 +0000 (08:49 +0300)
committerKaj Wallin <kaj.wallin@ixonos.com>
Mon, 29 Mar 2010 05:49:10 +0000 (08:49 +0300)
src/ui/mainwindow.cpp
src/ui/mainwindow.h

index bf1473b..2c797e3 100644 (file)
@@ -3,6 +3,7 @@
     Copyright (C) 2010  Ixonos Plc. Authors:
 
        Henri Lampela - henri.lampela@ixonos.com
+       Kaj Wallin - kaj.wallin@ixonos.com
 
     Situare is free software; you can redistribute it and/or
     modify it under the terms of the GNU General Public License
     USA.
  */
 
-
+#include <QtGui>
 #include "mainwindow.h"
 
 MainWindow::MainWindow(QWidget *parent)
     : QMainWindow(parent)
 {
     this->setWindowTitle(tr("Situare"));
+    createMenus();
 }
 
 MainWindow::~MainWindow()
 {
 
 }
+
+void MainWindow::createMenus()
+{
+    toListViewAct = new QAction(tr("List"),this);
+    toMapViewAct = new QAction(tr("Map"),this);
+    viewMenu = menuBar()->addMenu(tr("View"));
+    viewMenu->addAction(toListViewAct);
+    viewMenu->addAction(toMapViewAct);
+}
index 78c5ceb..7f40d92 100644 (file)
@@ -3,6 +3,7 @@
     Copyright (C) 2010  Ixonos Plc. Authors:
 
        Henri Lampela - henri.lampela@ixonos.com
+       Kaj Wallin - kaj.wallin@ixonos.com
 
     Situare is free software; you can redistribute it and/or
     modify it under the terms of the GNU General Public License
@@ -24,6 +25,9 @@
 
 #include <QtGui/QMainWindow>
 
+class QMenu;
+class QAction;
+
 class MainWindow : public QMainWindow
 {
     Q_OBJECT
@@ -31,6 +35,13 @@ class MainWindow : public QMainWindow
 public:
     MainWindow(QWidget *parent = 0);
     ~MainWindow();
+
+private:
+    void createMenus();
+
+    QMenu *viewMenu;
+    QAction *toListViewAct;
+    QAction *toMapViewAct;
 };
 
 #endif // MAINWINDOW_H