QTfrontend/ui/widget/mapContainer.cpp
changeset 14828 8ed0c3761640
parent 14666 95b1b9ea505a
child 14836 b9437746bffb
equal deleted inserted replaced
14827:266f973745b8 14828:8ed0c3761640
  1213     // the map has no pre-defined theme, so let's use the selected one
  1213     // the map has no pre-defined theme, so let's use the selected one
  1214     if (m_mapInfo.theme.isNull() || m_mapInfo.theme.isEmpty())
  1214     if (m_mapInfo.theme.isNull() || m_mapInfo.theme.isEmpty())
  1215     {
  1215     {
  1216         if (!selectedTheme.isNull() && !selectedTheme.isEmpty())
  1216         if (!selectedTheme.isNull() && !selectedTheme.isEmpty())
  1217         {
  1217         {
       
  1218             // Fall back to a default theme if current theme is a background theme or hidden
       
  1219             QModelIndexList mdl = m_themeModel->match(m_themeModel->index(0), ThemeModel::ActualNameRole, m_theme);
       
  1220             if (mdl.size() > 0)
       
  1221             {
       
  1222                 if ((mdl.at(0).data(ThemeModel::Roles::IsBackgroundThemeRole).toBool() == true) || (mdl.at(0).data(ThemeModel::Roles::IsHiddenRole).toBool() == true))
       
  1223                 {
       
  1224                     selectedTheme = "Nature";
       
  1225                 }
       
  1226             }
  1218             setTheme(selectedTheme);
  1227             setTheme(selectedTheme);
  1219             emit themeChanged(selectedTheme);
  1228             emit themeChanged(selectedTheme);
  1220         }
  1229         }
  1221     }
  1230     }
  1222     else
  1231     else