Android: Fix broken system palette

When we overwrite the default palette, we have to make sure
we don't overwrite default values with black for all the
colors that are not retrieved from the json file. We would
for instance get black as both the base color and text
color which would make some components unusable.

Change-Id: I1079a70a0ac7eb379ed5e8d92c6b39c2ea77ba49
Task-number: QTBUG-42812
Task-number: QTBUG-42998
Reviewed-by: BogDan Vatra <bogdan@kde.org>
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
This commit is contained in:
Eskil Abrahamsen Blomfeldt 2014-11-26 13:12:08 +01:00 committed by Jani Heikkinen
parent 457496b830
commit ab6d645850

View File

@ -278,7 +278,8 @@ static std::shared_ptr<AndroidStyle> loadAndroidStyle(QPalette *defaultPalette)
const int pt = paletteType(key);
if (pt > -1 || !qtClassName.isEmpty()) {
// Extract palette information
QPalette palette;
QPalette palette = *defaultPalette;
attributeIterator = item.find(QLatin1String("defaultTextColorPrimary"));
if (attributeIterator != item.constEnd())
palette.setColor(QPalette::WindowText, QRgb(int(attributeIterator.value().toDouble())));