diff options
Diffstat (limited to 'qt-ui/maintab.cpp')
-rw-r--r-- | qt-ui/maintab.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index 82550a3f4..f9d36342f 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -78,7 +78,9 @@ MainTab::MainTab(QWidget *parent) : QTabWidget(parent), addWeight->setEnabled(false); connect(ui->cylinders, SIGNAL(clicked(QModelIndex)), ui->cylinders->model(), SLOT(remove(QModelIndex))); + connect(ui->cylinders, SIGNAL(clicked(QModelIndex)), this, SLOT(editCylinderWidget(QModelIndex))); connect(ui->weights, SIGNAL(clicked(QModelIndex)), ui->weights->model(), SLOT(remove(QModelIndex))); + connect(ui->weights, SIGNAL(clicked(QModelIndex)), this, SLOT(editWeigthWidget(QModelIndex))); QFontMetrics metrics(defaultModelFont()); QFontMetrics metrics2(font()); @@ -532,5 +534,16 @@ void MainTab::initialUiSetup() ui->weights->resizeColumnToContents(i); } s.endGroup(); +} +void MainTab::editCylinderWidget(const QModelIndex& index) +{ + if (index.column() != CylindersModel::REMOVE) + ui->cylinders->edit(index); +} + +void MainTab::editWeigthWidget(const QModelIndex& index) +{ + if (index.column() != WeightModel::REMOVE) + ui->weights->edit(index); } |