Skip to content

Commit

Permalink
fix: disconnect when object got destroyed
Browse files Browse the repository at this point in the history
Change-Id: I481837928a379418356c90b267b8e427bf67beef
  • Loading branch information
BLumia committed Jan 10, 2019
1 parent 10e526f commit 7fe6c1e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,11 @@ QWidget *Settings::createFontComBoBoxHandle(QObject *obj)
// init.
comboBox->setCurrentText(option->value().toString());

connect(option, &DSettingsOption::valueChanged, [=] (QVariant var) {
connect(option, &DSettingsOption::valueChanged, comboBox, [=] (QVariant var) {
comboBox->setCurrentText(var.toString());
});

option->connect(comboBox, &QComboBox::currentTextChanged, [=] (const QString &text) {
option->connect(comboBox, &QComboBox::currentTextChanged, option, [=] (const QString &text) {
option->setValue(text);
});

Expand Down
2 changes: 1 addition & 1 deletion src/thememodule/themepanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ void ThemePanel::popup()
animation->setEndValue(QRect(windowRect.width() - rect.width(), rect.y(), rect.width(), rect.height()));
animation->start();

connect(animation, &QPropertyAnimation::valueChanged, [=] { m_themeView->adjustScrollbarMargins(); });
connect(animation, &QPropertyAnimation::valueChanged, this, [=] { m_themeView->adjustScrollbarMargins(); });
connect(animation, &QPropertyAnimation::finished, animation, &QPropertyAnimation::deleteLater);
}

Expand Down

0 comments on commit 7fe6c1e

Please sign in to comment.