summaryrefslogtreecommitdiffstats
path: root/qt-ui/diveplanner.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-11-12 17:57:33 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-11-13 11:58:47 +0900
commitb98157a51932c1bf584eb5ac830c5e3b681c654c (patch)
treeb86138b50c9fc698bfd8ca5f843aed025a7b15f9 /qt-ui/diveplanner.cpp
parentc58dc29542f75f93fe19e1a3a2e116153c936804 (diff)
downloadsubsurface-b98157a51932c1bf584eb5ac830c5e3b681c654c.tar.gz
Partially revert d72c69db7a49f and fix its errors
In the offending commit a QWidget was changed to QTableView, but only in the header - and thus making avaliable all method calls, but the initialization of the widgets was still a QWidget, and nothing of QTableView was used besides an incorrect call to setColumnHidden. This commit fixes that by using the view() method provided by the TableView implementation which returns the true QTableView that should be used for specific nitpicking, like hidding columns. :) Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/diveplanner.cpp')
-rw-r--r--qt-ui/diveplanner.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp
index 76ea82e75..bdecf24ad 100644
--- a/qt-ui/diveplanner.cpp
+++ b/qt-ui/diveplanner.cpp
@@ -908,12 +908,11 @@ DivePlannerWidget::DivePlannerWidget(QWidget* parent, Qt::WindowFlags f): QWidge
ui.tableWidget->view()->setItemDelegateForColumn(DivePlannerPointsModel::GAS, new AirTypesDelegate(this));
ui.cylinderTableWidget->setTitle(tr("Available Gases"));
ui.cylinderTableWidget->setModel(CylindersModel::instance());
- // the setColumnHidden calls don't seem to work????
- ui.cylinderTableWidget->setColumnHidden(CylindersModel::START, true);
- ui.cylinderTableWidget->setColumnHidden(CylindersModel::END, true);
- ui.cylinderTableWidget->setColumnHidden(CylindersModel::DEPTH, false);
-
- ui.cylinderTableWidget->view()->setItemDelegateForColumn(CylindersModel::TYPE, new TankInfoDelegate());
+ QTableView *view = ui.cylinderTableWidget->view();
+ view->setColumnHidden(CylindersModel::START, true);
+ view->setColumnHidden(CylindersModel::END, true);
+ view->setColumnHidden(CylindersModel::DEPTH, false);
+ view->setItemDelegateForColumn(CylindersModel::TYPE, new TankInfoDelegate());
connect(ui.cylinderTableWidget, SIGNAL(addButtonClicked()), DivePlannerPointsModel::instance(), SLOT(addCylinder_clicked()));
connect(ui.tableWidget, SIGNAL(addButtonClicked()), DivePlannerPointsModel::instance(), SLOT(addStop()));
ui.tableWidget->setBtnToolTip(tr("add dive data point"));