-#-------------------------------------------------
-#
+# -------------------------------------------------
# Project created by QtCreator 2010-03-26T07:57:35
-#
-#-------------------------------------------------
-
+# -------------------------------------------------
TARGET = Situare
TEMPLATE = app
-
-
-SOURCES += src/main.cpp\
- src/ui/mainwindow.cpp
-
-HEADERS += src/ui/mainwindow.h
+SOURCES += src/main.cpp \
+ src/ui/mainwindow.cpp \
+ src/ui/listviewtab.cpp \
+ src/ui/mapviewtab.cpp
+HEADERS += src/ui/mainwindow.h \
+ src/ui/listviewtab.h \
+ src/ui/mapviewtab.h
--- /dev/null
+/*
+ Situare - A location system for Facebook
+ Copyright (C) 2010 Ixonos Plc. Authors:
+
+ 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
+ version 2 as published by the Free Software Foundation.
+
+ Situare is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Situare; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+ USA.
+*/
+
+#include "listviewtab.h"
+
+SituareListView::SituareListView(QWidget *parent)
+ : QWidget(parent)
+{
+ QPushButton *listViewButton = new QPushButton(tr("This is listview"));
+ QHBoxLayout *listViewLayout = new QHBoxLayout;
+ listViewLayout->addWidget(listViewButton);
+ setLayout(listViewLayout);
+}
--- /dev/null
+ /*
+ Situare - A location system for Facebook
+ Copyright (C) 2010 Ixonos Plc. Authors:
+
+ 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
+ version 2 as published by the Free Software Foundation.
+
+ Situare is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Situare; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+ USA.
+ */
+
+
+#ifndef LISTVIEWTAB_H
+#define LISTVIEWTAB_H
+
+#include <QtGui>
+
+/**
+* @brief List View class. Used for displaying List of friends
+*
+* @class SituareListView mainwindow.h "src/ui/mainwindow.h"
+*/
+class SituareListView : public QWidget
+{
+public:
+ SituareListView(QWidget *parent = 0);
+};
+
+#endif // LISTVIEWTAB_H
#include <QtGui>
#include "mainwindow.h"
+#include "listviewtab.h"
+#include "mapviewtab.h"
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
setCentralWidget(widget);
createViews();
- QHBoxLayout *tabsLayout = new QHBoxLayout;
- QLabel *tabFieldLabel = new QLabel;
- tabFieldLabel->setText(tr("This is TabBar label"));
- tabsLayout->addWidget(situareTabs);
- tabsLayout->addWidget(tabFieldLabel);
+ QGridLayout *tabsLayout = new QGridLayout;
+ tabFieldLabel = new QLabel;
+ QFont font;
+ font.setPixelSize(10);
+ tabFieldLabel->setFont(font);
+ tabFieldLabel->setText(tr("This is TabBar label\nCurrent StackedWidget index: %1\nTsdaa: %2").arg(situareViews->currentIndex()).arg(2));
+ tabsLayout->addWidget(situareTabs,0,0,1,1);
+ tabsLayout->addWidget(tabFieldLabel,0,1,1,2);
QVBoxLayout *mainLayout = new QVBoxLayout;
mainLayout->addLayout(tabsLayout);
situareTabs->addTab(tr("List"));
situareTabs->addTab(tr("Map"));
connect(situareTabs, SIGNAL(currentChanged(int)), situareViews, SLOT(setCurrentIndex(int)));
+ connect(situareTabs, SIGNAL(currentChanged(int)), this, SLOT(updateTabLabel()));
}
-SituareListView::SituareListView(QWidget *parent)
- : QWidget(parent)
+void MainWindow::updateTabLabel()
{
- QPushButton *listViewButton = new QPushButton(tr("This is listview"));
- QHBoxLayout *listViewLayout = new QHBoxLayout;
- listViewLayout->addWidget(listViewButton);
- setLayout(listViewLayout);
-}
-
-SituareMapView::SituareMapView(QWidget *parent)
- : QWidget(parent)
-{
- QPushButton *mapViewButton = new QPushButton(tr("THIS IS MAPVIEEEEEW!"));
- QHBoxLayout *mapViewLayout = new QHBoxLayout;
- mapViewLayout->addWidget(mapViewButton);
- setLayout(mapViewLayout);
+ tabFieldLabel->setText(tr("This is TabBar label\nCurrent StackedWidget index: %1\nTsdaa: %2").arg(situareViews->currentIndex()).arg(2));
}
USA.
*/
+
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
MainWindow(QWidget *parent = 0);
~MainWindow();
-private:
/**
* @brief Private method to create List and Map views as a stacked widget
*
QStackedWidget *situareViews;
QTabBar *situareTabs;
+ QLabel *tabFieldLabel;
/**
* @brief DUMMY LABEL, REMOVE WHEN BOTH VIEWS ARE COMPLETE
* @todo REMOVE THIS
*/
QLabel *infoLabel;
-};
-
-/**
-* @brief List View class. Used for displaying List of friends
-*
-* @class SituareListView mainwindow.h "src/ui/mainwindow.h"
-*/
-class SituareListView : public QWidget
-{
-public:
- SituareListView(QWidget *parent = 0);
-};
-/**
-* @brief Map View class. Used to display Map
-*
-* @class SituareMapView mainwindow.h "src/ui/mainwindow.h"
-*/
-class SituareMapView : public QWidget
-{
-public:
- SituareMapView(QWidget *parent = 0);
+public slots:
+ void updateTabLabel();
};
#endif // MAINWINDOW_H
--- /dev/null
+/*
+ Situare - A location system for Facebook
+ Copyright (C) 2010 Ixonos Plc. Authors:
+
+ 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
+ version 2 as published by the Free Software Foundation.
+
+ Situare is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Situare; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+ USA.
+*/
+
+#include "mapviewtab.h"
+
+SituareMapView::SituareMapView(QWidget *parent)
+ : QWidget(parent)
+{
+ QPushButton *mapViewButton = new QPushButton(tr("This is MAPVIEW"));
+ QHBoxLayout *mapViewLayout = new QHBoxLayout;
+ mapViewLayout->addWidget(mapViewButton);
+ setLayout(mapViewLayout);
+}
--- /dev/null
+ /*
+ Situare - A location system for Facebook
+ Copyright (C) 2010 Ixonos Plc. Authors:
+
+ 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
+ version 2 as published by the Free Software Foundation.
+
+ Situare is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Situare; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+ USA.
+ */
+
+
+#ifndef MAPVIEWTAB_H
+#define MAPVIEWTAB_H
+
+#include <QtGui>
+
+/**
+* @brief Map View class. Used to display Map
+*
+* @class SituareMapView mainwindow.h "src/ui/mainwindow.h"
+*/
+class SituareMapView : public QWidget
+{
+public:
+ SituareMapView(QWidget *parent = 0);
+};
+
+#endif // MAPVIEWTAB_H