summaryrefslogtreecommitdiffstats
path: root/qt-ui/maintab.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-05-22 11:00:20 -0300
committerGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-05-22 11:00:20 -0300
commit0b30c821ae5b8cb9f5e3e8d49152d56f215aeec4 (patch)
tree5d4a6c9ca607465f4a67dd31f3b94129cc81ee80 /qt-ui/maintab.cpp
parent94ba79c0fedc92113df22da27a4ff2cf01b26f94 (diff)
downloadsubsurface-0b30c821ae5b8cb9f5e3e8d49152d56f215aeec4.tar.gz
Added a 'trash' icon on the Cylinders and Weigthsystem models
So, the Cylinders and Weigthsystems got a new Trash icon, and the interface already intercepts the clicks ( on all columns ) and send this to the 'remove' method on boch models. On the model I'm just filtering the indexes that are not 'DELETE' and creating a stub method to be filled later. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Diffstat (limited to 'qt-ui/maintab.cpp')
-rw-r--r--qt-ui/maintab.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp
index 0a8710e09..a52058816 100644
--- a/qt-ui/maintab.cpp
+++ b/qt-ui/maintab.cpp
@@ -75,6 +75,14 @@ MainTab::MainTab(QWidget *parent) : QTabWidget(parent),
addWeight->setToolTip(tr("Add Weight System"));
connect(addWeight, SIGNAL(clicked(bool)), this, SLOT(addWeight_clicked()));
addWeight->setEnabled(false);
+
+ connect(ui->cylinders, SIGNAL(clicked(QModelIndex)), ui->cylinders->model(), SLOT(remove(QModelIndex)));
+ connect(ui->weights, SIGNAL(clicked(QModelIndex)), ui->weights->model(), SLOT(remove(QModelIndex)));
+
+ ui->cylinders->setColumnWidth( CylindersModel::REMOVE, 24);
+ ui->cylinders->horizontalHeader()->setResizeMode (CylindersModel::REMOVE , QHeaderView::Fixed);
+ ui->weights->setColumnWidth( WeightModel::REMOVE, 24);
+ ui->cylinders->horizontalHeader()->setResizeMode (WeightModel::REMOVE , QHeaderView::Fixed);
}
// We need to manually position the 'plus' on cylinder and weight.