diff options
author | Eike Ziller <eike.ziller@qt.io> | 2022-09-02 12:13:31 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2022-09-02 12:22:50 +0000 |
commit | d3a245574ef4cbd0b9bf9aaa3af386420c094299 (patch) | |
tree | d5963258aafc6f2018ec3cea2071c3f90ee02327 /src/plugins/qtsupport/exampleslistmodel.cpp | |
parent | e4bc08fb21c29e2f1b226ca4d73e019681f7bfc6 (diff) |
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 <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Diffstat (limited to 'src/plugins/qtsupport/exampleslistmodel.cpp')
-rw-r--r-- | src/plugins/qtsupport/exampleslistmodel.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/plugins/qtsupport/exampleslistmodel.cpp b/src/plugins/qtsupport/exampleslistmodel.cpp index 404a565463..eb62ce3d4f 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); } |