aboutsummaryrefslogtreecommitdiffstats
path: root/share/qtcreator
diff options
context:
space:
mode:
authorMahmoud Badri <mahmoud.badri@qt.io>2024-03-27 19:02:50 +0200
committerMahmoud Badri <mahmoud.badri@qt.io>2024-03-28 09:18:39 +0000
commitc04eb4444d3e7990ed41896c0937d32b4e24c9fa (patch)
tree62622dfe1bb074b111107e382507fb8b1ea985ea /share/qtcreator
parentff4e33dc0a2224e35c969ef34879e6ef98d22aae (diff)
QmlDesigner: Use ExamplesModelV2
V2 adds minQDSVersion property for model items Change-Id: I27d36428f73b27b1d52d429e23654d094d6ff86d Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io> Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
Diffstat (limited to 'share/qtcreator')
-rw-r--r--share/qtcreator/qmldesigner/welcomepage/MainGridStack.qml12
1 files changed, 11 insertions, 1 deletions
diff --git a/share/qtcreator/qmldesigner/welcomepage/MainGridStack.qml b/share/qtcreator/qmldesigner/welcomepage/MainGridStack.qml
index 73b023bddc..555596223b 100644
--- a/share/qtcreator/qmldesigner/welcomepage/MainGridStack.qml
+++ b/share/qtcreator/qmldesigner/welcomepage/MainGridStack.qml
@@ -88,7 +88,17 @@ Item {
Layout.fillWidth: true
Layout.fillHeight: true
hover: hoverHandler.hovered
- model: ExamplesModel { id: examplesModel}
+
+ Component.onCompleted: {
+ // remove items with old versions from the examples model
+ for (let i = examplesModel.count - 1; i >= 0; --i) {
+ if (!projectModel.exampleVersionOk(examplesModel.get(i).minQDSVersion))
+ examplesModel.remove(i)
+ }
+ }
+
+ model: ExamplesModelV2 { id: examplesModel }
+
delegate: ThumbnailDelegate {
type: ThumbnailDelegate.Type.Example
downloadable: showDownload