MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
{
+ qDebug() << __PRETTY_FUNCTION__;
QWidget *widget = new QWidget;
setCentralWidget(widget);
createViews();
MainWindow::~MainWindow()
{
- /**
- * Add delete's if you get memory leak warnings with cppcheck
- */
+ qDebug() << __PRETTY_FUNCTION__;
delete toListViewAct;
delete toMapViewAct;
delete situareViews;
void MainWindow::createMenus()
{
+ qDebug() << __PRETTY_FUNCTION__;
toListViewAct = new QAction(tr("List"), this);
connect(toListViewAct, SIGNAL(triggered()), this, SLOT(toListView()));
toMapViewAct = new QAction(tr("Map"), this);
void MainWindow::createViews()
{
+ qDebug() << __PRETTY_FUNCTION__;
situareViews = new QStackedWidget(this);
situareViews->addWidget(new SituareListView(this));
situareViews->addWidget(new SituareMapView(this));
void MainWindow::toListView()
{
+ qDebug() << __PRETTY_FUNCTION__;
this->situareViews->setCurrentIndex(0);
infoLabel->setText(tr("Current: %1").arg(situareViews->currentIndex()));
this->setWindowTitle("List");
void MainWindow::toMapView()
{
+ qDebug() << __PRETTY_FUNCTION__;
this->situareViews->setCurrentIndex(1);
infoLabel->setText(tr("Current: %1").arg(situareViews->currentIndex()));
this->setWindowTitle("Map");
#include <QtGui/QMainWindow>
#include <QWidget>
+#include <QDebug>
class QLabel;
class QStackedWidget;
~MainWindow();
/**
+ * @brief Widget Stack object for the List and Map Views
+ *
+ * @var situareViews
+ */
+ QStackedWidget *situareViews;
+
+private:
+ /**
* @brief Private method to create List and Map views as a stacked widget
*
* @fn createViews
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
*/
void toListView();
/**
- * @brief Private slots, which initiates toMapViewAct action
+ * @brief Private slot, which initiates toMapViewAct action
*
* @fn toMapView
*/