diff --git a/sources/ui/elementinfopartwidget.cpp b/sources/ui/elementinfopartwidget.cpp index e448bb7de..3961ffb97 100644 --- a/sources/ui/elementinfopartwidget.cpp +++ b/sources/ui/elementinfopartwidget.cpp @@ -35,9 +35,9 @@ ElementInfoPartWidget::ElementInfoPartWidget(QString key, QString translated_key ui->label_->setText(translated_key); if(key == "label") ui->checkBox->setChecked(true); - connect(ui->line_edit, &QLineEdit::textEdited, this, &ElementInfoPartWidget::textEdited); + connect(ui->line_edit, &QLineEdit::textEdited, this, &ElementInfoPartWidget::textEdited); connect(ui->line_edit, &QLineEdit::textChanged, this, &ElementInfoPartWidget::textChanged); - + connect(ui->checkBox, &QCheckBox::clicked, this, &ElementInfoPartWidget::showClicked); } /** diff --git a/sources/ui/elementinfopartwidget.h b/sources/ui/elementinfopartwidget.h index 062cfe11f..91737f9ab 100644 --- a/sources/ui/elementinfopartwidget.h +++ b/sources/ui/elementinfopartwidget.h @@ -42,8 +42,9 @@ class ElementInfoPartWidget : public QWidget void setFocusTolineEdit(); signals: - void textEdited (const QString & text); - void textChanged(const QString & text); + void textEdited (const QString & text); + void textChanged (const QString & text); + void showClicked (bool checked); //ATTRIBUTES private: diff --git a/sources/ui/elementinfowidget.cpp b/sources/ui/elementinfowidget.cpp index 2dc651191..4611155f5 100644 --- a/sources/ui/elementinfowidget.cpp +++ b/sources/ui/elementinfowidget.cpp @@ -151,7 +151,10 @@ bool ElementInfoWidget::event(QEvent *event) void ElementInfoWidget::enableLiveEdit() { foreach (ElementInfoPartWidget *eipw, m_eipw_list) + { connect(eipw, &ElementInfoPartWidget::textChanged, this, &ElementInfoWidget::apply); + connect(eipw, &ElementInfoPartWidget::showClicked, this, &ElementInfoWidget::apply); + } } /** @@ -161,7 +164,10 @@ void ElementInfoWidget::enableLiveEdit() void ElementInfoWidget::disableLiveEdit() { foreach (ElementInfoPartWidget *eipw, m_eipw_list) + { disconnect(eipw, &ElementInfoPartWidget::textChanged, this, &ElementInfoWidget::apply); + disconnect(eipw, &ElementInfoPartWidget::showClicked, this, &ElementInfoWidget::apply); + } } /**