Item Refactor complete
This commit is contained in:
parent
219fbfb4c7
commit
24c168cf64
17 changed files with 78 additions and 41 deletions
|
|
@ -38,7 +38,7 @@ ItemWidget::ItemWidget(std::weak_ptr<Item> item, QWidget *parent) :
|
|||
else
|
||||
connect(ui->checkBox, &QCheckBox::toggled, this, &ItemWidget::moveToState);
|
||||
connect(ui->pushButton, &QPushButton::clicked, this, &ItemWidget::showSettingsDialog);
|
||||
connect(workingItem.get(), &Relay::valueChanged, this, &ItemWidget::stateChanged);
|
||||
connect(workingItem.get(), &Item::updated, this, &ItemWidget::onItemUpdated);
|
||||
connect(ui->pushButton_Remove, &QPushButton::clicked, this, &ItemWidget::deleteItem);
|
||||
|
||||
}
|
||||
|
|
@ -115,6 +115,11 @@ std::weak_ptr<Item> ItemWidget::getItem()
|
|||
return item_;
|
||||
}
|
||||
|
||||
void ItemWidget::onItemUpdated(ItemUpdateRequest update)
|
||||
{
|
||||
stateChanged(update.payload.getValue());
|
||||
}
|
||||
|
||||
void ItemWidget::stateChanged(int state)
|
||||
{
|
||||
ui->slider->blockSignals(true);
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ public:
|
|||
public slots:
|
||||
|
||||
void stateChanged(int state);
|
||||
void onItemUpdated(ItemUpdateRequest update);
|
||||
|
||||
private:
|
||||
Ui::ItemWidget *ui;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue