diff options
author | Tomaz Canabrava <tcanabrava@kde.org> | 2014-01-15 13:20:05 -0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-01-16 10:12:31 +0700 |
commit | 52064d9e02a6ca559beb8f8e64e28e2ef77c5e44 (patch) | |
tree | d3327a8dca6a0e7d80120c0af08e9bab44583802 /qt-ui | |
parent | 7affccdf5b2baff6fb757ca41ffe11ec953f27d6 (diff) | |
download | subsurface-52064d9e02a6ca559beb8f8e64e28e2ef77c5e44.tar.gz |
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>
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/mainwindow.cpp | 3 | ||||
-rw-r--r-- | qt-ui/mainwindow.h | 2 | ||||
-rw-r--r-- | qt-ui/profile/profilewidget2.cpp | 11 |
3 files changed, 15 insertions, 1 deletions
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index ad7d26a4e..293bc84be 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -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(); diff --git a/qt-ui/mainwindow.h b/qt-ui/mainwindow.h index 7da4dbceb..67b0cc0d9 100644 --- a/qt-ui/mainwindow.h +++ b/qt-ui/mainwindow.h @@ -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(); diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index b2c59b2cc..067fc97fb 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -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. |