summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qpalette.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel/qpalette.cpp')
-rw-r--r--src/gui/kernel/qpalette.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gui/kernel/qpalette.cpp b/src/gui/kernel/qpalette.cpp
index 9ccfb9b819..b4383c5bfc 100644
--- a/src/gui/kernel/qpalette.cpp
+++ b/src/gui/kernel/qpalette.cpp
@@ -941,7 +941,8 @@ qint64 QPalette::cacheKey() const
}
/*!
- Returns a new QPalette that has attributes copied from \a other.
+ Returns a new QPalette that is a union of this instance and \a other.
+ Color roles set in this instance take precedence.
*/
QPalette QPalette::resolve(const QPalette &other) const
{
@@ -959,6 +960,7 @@ QPalette QPalette::resolve(const QPalette &other) const
if (!(data.resolve_mask & (1<<role)))
for(int grp = 0; grp < (int)NColorGroups; grp++)
palette.d->br[grp][role] = other.d->br[grp][role];
+ palette.data.resolve_mask |= other.data.resolve_mask;
return palette;
}
@@ -981,7 +983,7 @@ QPalette QPalette::resolve(const QPalette &other) const
#ifndef QT_NO_DATASTREAM
static const int NumOldRoles = 7;
-static const int oldRoles[7] = { QPalette::Foreground, QPalette::Background, QPalette::Light,
+static const int oldRoles[7] = { QPalette::WindowText, QPalette::Window, QPalette::Light,
QPalette::Dark, QPalette::Mid, QPalette::Text, QPalette::Base };
/*!