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>
This commit is contained in:
Tomaz Canabrava 2013-05-22 11:00:20 -03:00
parent 94ba79c0fe
commit 0b30c821ae
4 changed files with 63 additions and 4 deletions

View file

@ -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.