Android: Fix broken system palette
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Wed, 26 Nov 2014 12:12:08 +0000 (13:12 +0100)
committerJani Heikkinen <jani.heikkinen@theqtcompany.com>
Wed, 3 Dec 2014 11:29:09 +0000 (12:29 +0100)
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>
src/plugins/platforms/android/qandroidplatformtheme.cpp

index f9f2e4a94404b9a80f31bda57dcbe7fdfcb29106..375096139dce1c2f2d2b9e691d2ee969d8545839 100644 (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())));