From d3a245574ef4cbd0b9bf9aaa3af386420c094299 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Fri, 2 Sep 2022 12:13:31 +0200 Subject: [PATCH] Qt Examples: Fix that supported device information was not updated When the user selects a different example set / Qt version from the drop down, we must in all cases update the cached "supported device type", which is later used to e.g. filter out all non-Android examples when selecting an Android Qt version. We only did that in case the selected example set was backed internally by a QtVersion pointer, but there are example sets where that isn't the case. The issue is reproducible by e.g. installing Qt 5.15 for Android and Qt 6.3 for multiple platforms. For the latter we only show a single entry in the drop down, and do not have a single QtVersion pointer as a backing. When switching the drop down from Qt 5.15 Android to Qt 6.3, only examples with the "android" tag are shown, even though our Qt 6.3 installation supports more than that. If we don't have a QtVersion pointer we now assume that everything is supported. Fixes: QTCREATORBUG-27017 Change-Id: I7a7666c3cfec098d85cfcbb0062c63395af6d0c0 Reviewed-by: Qt CI Bot Reviewed-by: Reviewed-by: Alessandro Portale --- src/plugins/qtsupport/exampleslistmodel.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/qtsupport/exampleslistmodel.cpp b/src/plugins/qtsupport/exampleslistmodel.cpp index 404a565463e..eb62ce3d4f4 100644 --- a/src/plugins/qtsupport/exampleslistmodel.cpp +++ b/src/plugins/qtsupport/exampleslistmodel.cpp @@ -682,6 +682,8 @@ void ExampleSetModel::selectExampleSet(int index) if (getType(m_selectedExampleSetIndex) == ExampleSetModel::QtExampleSet) { QtVersion *selectedQtVersion = QtVersionManager::version(getQtId(m_selectedExampleSetIndex)); m_selectedQtTypes = selectedQtVersion->targetDeviceTypes(); + } else { + m_selectedQtTypes.clear(); } emit selectedExampleSetChanged(m_selectedExampleSetIndex); }