{
QWidget *widget = new QWidget;
setCentralWidget(widget);
-// createViews();
+ createViews();
- QVBoxLayout *mainleiska = new QVBoxLayout;
+ QVBoxLayout *mainLayout = new QVBoxLayout;
infoLabel = new QLabel(tr("This is the beginning"),this);
- mainleiska->addWidget(infoLabel);
+ mainLayout->addWidget(infoLabel);
+ mainLayout->addWidget(situareViews);
+ widget->setLayout(mainLayout);
- widget->setLayout(mainleiska);
this->setWindowTitle(tr("Situare"));
createMenus();
-
}
MainWindow::~MainWindow()
void MainWindow::toListView()
{
- infoLabel->setText(tr("List view invoked"));
+ this->situareViews->setCurrentIndex(0);
+ infoLabel->setText(tr("Current: %1").arg(situareViews->currentIndex()));
}
void MainWindow::toMapView()
{
- infoLabel->setText(tr("Map view invoked"));
+ this->situareViews->setCurrentIndex(1);
+ infoLabel->setText(tr("Current: %1").arg(situareViews->currentIndex()));
}
void MainWindow::createViews()
SituareMapView::SituareMapView(QWidget *parent)
: QWidget(parent)
{
- QPushButton *mapViewButton = new QPushButton(tr("THIS IS MAPVIEW !!"));
+ QPushButton *mapViewButton = new QPushButton(tr("THIS IS MAPVIEEEEEW!"));
QHBoxLayout *mapViewLayout = new QHBoxLayout;
mapViewLayout->addWidget(mapViewButton);
setLayout(mapViewLayout);
class QStackedWidget;
class QLabel;
+/**
+* @Main Window Class
+*
+* @class MainWindow mainwindow.h "src/ui/mainwindow.h"
+*/
class MainWindow : public QMainWindow
{
Q_OBJECT
~MainWindow();
private:
+ /**
+ * @brief Private method to create the Menu items
+ *
+ * @fn createMenus
+ */
void createMenus();
+ /**
+ * @brief Private method to create List and Map views as a stacked widget
+ *
+ * @fn createViews
+ */
void createViews();
QMenu *viewMenu;
+ /**
+ * @brief Action item for changing view to List View
+ *
+ * @var toListViewAct
+ */
QAction *toListViewAct;
+ /**
+ * @brief Action item for changing view to Map View
+ *
+ * @var toMapViewAct
+ */
QAction *toMapViewAct;
+ /**
+ * @brief Widget Stack object for the List and Map Views
+ *
+ * @var situareViews
+ */
QStackedWidget *situareViews;
+ /**
+ * @brief DUMMY LABEL, REMOVE WHEN BOTH VIEWS ARE COMPLETE
+ *
+ * @var infoLabel
+ * @todo REMOVE THIS
+ */
QLabel *infoLabel;
private slots:
+ /**
+ * @brief Private slot, which initiates toListViewAct action
+ *
+ * @fn toListView
+ */
void toListView();
+ /**
+ * @brief Private slots, which initiates toMapViewAct action
+ *
+ * @fn toMapView
+ */
void toMapView();
};
+/**
+* @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: