From ab6d645850e88f3e351d196bf009135b6189ba8a Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Wed, 26 Nov 2014 13:12:08 +0100 Subject: 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 Reviewed-by: J-P Nurmi --- src/plugins/platforms/android/qandroidplatformtheme.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/android/qandroidplatformtheme.cpp b/src/plugins/platforms/android/qandroidplatformtheme.cpp index f9f2e4a944..375096139d 100644 --- a/src/plugins/platforms/android/qandroidplatformtheme.cpp +++ b/src/plugins/platforms/android/qandroidplatformtheme.cpp @@ -278,7 +278,8 @@ static std::shared_ptr 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()))); -- cgit v1.2.3