diff options
-rw-r--r-- | qt-ui/maintab.cpp | 13 | ||||
-rw-r--r-- | qt-ui/maintab.h | 2 |
2 files changed, 15 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); } diff --git a/qt-ui/maintab.h b/qt-ui/maintab.h index 764ed2306..af76fbb67 100644 --- a/qt-ui/maintab.h +++ b/qt-ui/maintab.h @@ -60,6 +60,8 @@ public slots: void on_rating_valueChanged(int value); void on_visibility_valueChanged(int value); void tabChanged(int idx); + void editCylinderWidget(const QModelIndex& index); + void editWeigthWidget(const QModelIndex& index); private: Ui::MainTab *ui; |