Optimize usage of QPalette

setPalette() does not replace the old one but rather adds the
difference. Thus a previous copy of the palette is unnecessary.

Change-Id: I5c06da456b76144efc4a984ccda13c7d2243a7bc
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
Lorenz Haas
2014-01-07 20:38:32 +01:00
committed by Eike Ziller
parent a142270d2c
commit ac70c168da
15 changed files with 17 additions and 20 deletions

View File

@@ -451,11 +451,9 @@ void FancyTabWidget::removeTab(int index)
void FancyTabWidget::setBackgroundBrush(const QBrush &brush)
{
QPalette pal = m_tabBar->palette();
QPalette pal;
pal.setBrush(QPalette::Mid, brush);
m_tabBar->setPalette(pal);
pal = m_cornerWidgetContainer->palette();
pal.setBrush(QPalette::Mid, brush);
m_cornerWidgetContainer->setPalette(pal);
}