fixed crash when changing theme after closing tab

This commit is contained in:
fourtf
2018-04-13 23:17:10 +02:00
parent 2c5d05dfa1
commit 1654130dbc
4 changed files with 11 additions and 7 deletions
+6 -5
View File
@@ -26,6 +26,11 @@ BaseWidget::BaseWidget(BaseWidget *parent, Qt::WindowFlags f)
this->init();
}
BaseWidget::~BaseWidget()
{
this->themeConnection.disconnect();
}
float BaseWidget::getScale() const
{
// return 1.f;
@@ -82,15 +87,11 @@ void BaseWidget::setScaleIndependantHeight(int value)
void BaseWidget::init()
{
pajlada::Signals::Connection connection = this->themeManager.updated.connect([this]() {
this->themeConnection = this->themeManager.updated.connect([this]() {
this->themeRefreshEvent();
this->update();
});
QObject::connect(this, &QObject::destroyed, [connection]() mutable {
connection.disconnect(); //
});
}
void BaseWidget::childEvent(QChildEvent *event)