Added debug code to help understand the Profile

This commit adds a QTableView if built in debug mode. This is very userful
to understand the Profile that will be drawn by the graphics classes and
fix the possible errors.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2014-01-15 13:20:05 -02:00 committed by Dirk Hohndel
parent 7affccdf5b
commit 52064d9e02
3 changed files with 15 additions and 1 deletions

View file

@ -125,6 +125,9 @@ void MainWindow::on_actionOpen_triggered()
loadFiles( QStringList() << filename );
}
QTabWidget *MainWindow::tabWidget(){
return ui.tabWidget;
}
void MainWindow::on_actionSave_triggered()
{
file_save();

View file

@ -55,7 +55,7 @@ public:
void loadFiles(const QStringList files);
void importFiles(const QStringList importFiles);
void cleanUpEmpty();
QTabWidget *tabWidget();
private slots:
/* file menu action */
void on_actionNew_triggered();

View file

@ -12,6 +12,11 @@
#include <QMenu>
#include <QContextMenuEvent>
#ifndef QT_NO_DEBUG
#include <QTableView>
#include "mainwindow.h"
#endif
ProfileWidget2::ProfileWidget2(QWidget *parent) :
QGraphicsView(parent),
dataModel(new DivePlotDataModel(this)),
@ -212,6 +217,12 @@ ProfileWidget2::ProfileWidget2(QWidget *parent) :
// Starting the transitions:
stateMachine->start();
#ifndef QT_NO_DEBUG
QTableView *diveDepthTableView = new QTableView();
diveDepthTableView->setModel(dataModel);
mainWindow()->tabWidget()->addTab(diveDepthTableView, "Depth Model");
#endif
}
// Currently just one dive, but the plan is to enable All of the selected dives.