按钮申请主题切换时,调色板不自动更换,导致hover背景色不对

This commit is contained in:
zhaominyong 2022-05-16 14:55:31 +08:00
parent dc2da1a745
commit c9837b7b46
2 changed files with 14 additions and 14 deletions

View File

@ -212,13 +212,13 @@ void DataBackup::initFirstWidget()
ManageBackupPointList backupManager(first, ManageBackupPointList::DATA);
backupManager.exec();
});
// connect(GlobelBackupInfo::inst().getGlobalSignals(), &GlobalSignals::styleNameChanged, this, [=](bool isDark) {
// Q_UNUSED(isDark)
// // 深浅主题切换时,因为调色板已经更换,高亮等颜色已经改变,所以要重新加载图标。
// QPalette pal(backupPointManage->palette());
// pal.setColor(QPalette::Button, this->palette().base().color());
// backupPointManage->setPalette(pal);
// });
connect(GlobelBackupInfo::inst().getGlobalSignals(), &GlobalSignals::styleNameChanged, this, [=](bool isDark) {
Q_UNUSED(isDark)
// 深浅主题切换时,因为调色板已经更换,高亮等颜色已经改变,所以要重新加载图标。
QPalette pal(backupPointManage->palette());
pal.setColor(QPalette::Button, this->palette().base().color());
backupPointManage->setPalette(pal);
});
addWidget(first);
}

View File

@ -165,13 +165,13 @@ void SystemBackup::initFirstWidget()
ManageBackupPointList backupManager(first, ManageBackupPointList::SYSTEM);
backupManager.exec();
});
// connect(GlobelBackupInfo::inst().getGlobalSignals(), &GlobalSignals::styleNameChanged, this, [=](bool isDark) {
// Q_UNUSED(isDark)
// // 深浅主题切换时,因为调色板已经更换,高亮等颜色已经改变,所以要重新加载图标。
// QPalette pal(backupPointManage->palette());
// pal.setColor(QPalette::Button, this->palette().base().color());
// backupPointManage->setPalette(pal);
// });
connect(GlobelBackupInfo::inst().getGlobalSignals(), &GlobalSignals::styleNameChanged, this, [=](bool isDark) {
Q_UNUSED(isDark)
// 深浅主题切换时,因为调色板已经更换,高亮等颜色已经改变,所以要重新加载图标。
QPalette pal(backupPointManage->palette());
pal.setColor(QPalette::Button, this->palette().base().color());
backupPointManage->setPalette(pal);
});
addWidget(first);
}