aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qtsupport/exampleslistmodel.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Examples: Ignore remote Qt versionsEike Ziller2024-03-131-2/+4
| | | | | | | | | While showing examples from remote Qt versions would probably be possible, it is not a great idea performance-wise. Task-number: QTCREATORBUG-30512 Change-Id: I2d00640bc8cbb3b19a89af1b17108e28604ef5a8 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* Welcome: Implement new designAlessandro Portale2024-02-271-1/+1
| | | | | | | | 2024 redesign Change-Id: I6629849921272d856f201693973a8e29c6465e94 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* Examples: Read and handle "documentation dependencies"Eike Ziller2024-01-191-28/+49
| | | | | | | | | | | | | | | | | Some examples are defined in a Qt module (and therefore examples- manifest), but have dependencies on other modules. The example-manifests contain a `module` attribute for their `instructionals` tag, and examples can contain "docdependencies" items in their meta data, which are comma-separated lists of these module names. Read the `module` attributes (the meta data is already generically read) and check if the current set of examples-manifest contains all required ones for an example. Hide it, if not. Task-number: QTBUG-120759 Change-Id: Ib8ff80cf8a13965e57b5c4317e5d121c4127278b Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Kai Köhne <kai.koehne@qt.io>
* Examples: Fix reading the category ordering from manifestEike Ziller2024-01-101-4/+8
| | | | | | | | | | | | | | | qtcreator_tutorials.xml contains ordering information for the tutorials, and if we read that (first) we ignore any subsequent ordering that the set of Qt examples defines (in qtdoc/examples-manifest.xml). Only read the tutorials.xml if we are actually interested in tutorials. Amends 08bbe885b49d6782178f0bc7b19c1bb162633666 Change-Id: I9148cc9f1060500f46be2bbc9c9ef6c2512c2f6c Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Kai Köhne <kai.koehne@qt.io>
* QtSupport: Don't show semi laid out examples while updatingAlessandro Portale2023-10-311-2/+6
| | | | | | | | | | | | | This hides the examples SectionedGridView while the examples.xml files are loaded. When shown, they are directly in the full size. An additional benefit lies in the initial loading of less thumbnail images because with QTCREATORBUG-29811, many more thumbnails were visible in the initial view than now. Fixes: QTCREATORBUG-29811 Change-Id: I42f362497859b0b98dc48ef0f1b6399d91c0db28 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Examples: Avoid warning about scaling null imageEike Ziller2023-10-311-2/+5
| | | | | | Change-Id: I16f75c2c6d05017b99596ca0855e0d86f4a74a6f Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* Merge remote-tracking branch 'origin/master' into 12.0Eike Ziller2023-09-291-1/+1
|\ | | | | | | Change-Id: I0e2c7f8afb1c036814414160934f9ca1ac22bba7
| * Utils, all: Standardize on QtcSettingshjk2023-09-271-1/+1
| | | | | | | | | | Change-Id: Id222016f15b1c3bfe6710fe5d0297666d4565ef1 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* | Examples: Adhere to filter when switching example setEike Ziller2023-09-281-0/+8
|/ | | | | | | Fixes: QTCREATORBUG-29652 Change-Id: I0ccea2da7338c98bd3c5bf919e137339ed12e837 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* Utils: Use Key more widely in QtcSettingshjk2023-08-301-3/+3
| | | | | | | And adapt user code. Change-Id: I6efe4ebe6823de4cc862f304a57e041b02c40eac Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* QtSupport: Avoid an unneeded update of examplesEike Ziller2023-08-281-3/+5
| | | | | | | | | When starting Qt Creator with the examples page visible. Avoid emitting the selectedExampleSetChanged signal twice in a row, but guarantee it once. Change-Id: I6a2c4032a53d531a8e7d2ac612e88d4b4bdbb6b5 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* QtSupport: Load examples / tutorials only when visibleCristian Adam2023-08-281-0/+20
| | | | | | | | | This speeds up QtCreator startup a bit by not loading the examples all the time, but only when the user clicks on the "Examples" button. Change-Id: I8fb3656e871cf3f2f884c5eb12270eba427cd999 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* QtSupport: Rename qtkitinformation.{h,cpp} -> qtkitaspect.{h,cpp}hjk2023-08-151-1/+1
| | | | | Change-Id: I12229e5e98b468101d32edd35be74bbda0921d89 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* QtSupport: Use QImage::fromData instead of QImageReaderAlessandro Portale2023-08-021-7/+3
| | | | | | | | | QImage offers this convenience shortcut since Qt 6.2. Change-Id: Ia1b286597ed13bcadeb663cf80b3dd3da964c5b7 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Examples: Support manifest-defined category orderEike Ziller2023-07-241-3/+7
| | | | | | | | | | | | Reads a separate sorted list of categories from the manifest files. The first of these lists that is found in the manifest files is used. For example the Qt documentation defines the list in the manifest file for qtdoc. Change-Id: I57c2779862a5ebfc27707b53d43d4ed9e7e8c5f9 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Examples: Re-add categories for sortingEike Ziller2023-07-201-0/+4
| | | | | | | | that got accidentally lost while merging 11.0 because the code moved Change-Id: I786d89f0909ccf5f3159a734b1d10d78e96904c5 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Use categories for Tutorials pageEike Ziller2023-07-141-2/+18
| | | | | | | | | | | | Instead of adding the category into the title with "Help: ..." etc, use the actual categorized view that we already use for examples and marketplace. Set the corresponding meta data in the manifest file and read it also for tutorials. Change-Id: Id9081518c1c0afee8d080af3ca8a5dca5cdde775 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* Merge remote-tracking branch 'origin/10.0' into 11.0Eike Ziller2023-05-251-56/+0
|\ | | | | | | | | | | | | Conflicts: src/plugins/qtsupport/exampleslistmodel.cpp Change-Id: Idbe0117ce810b4ab180a7c4f9b7b35c9c4b988e5
| * Examples: Move categorization to examplesparserEike Ziller2023-05-251-52/+0
| | | | | | | | | | | | | | | | For easier testing. Change-Id: I11f9de3f4fbcc2c85c196f1b59b2147e73ea8209 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* | Examples: Use Qt logging instead of environment variableEike Ziller2023-05-221-30/+25
| | | | | | | | | | | | | | | | | | Use logging category qtc.examples instead of a custom QTC_DEBUG_EXAMPLESMODEL environment variable. Change-Id: Idbd6d4b29dbd7b9e8c5976eca6efeb232bf7fa5f Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* | Examples: Centralize constants in one placeAlessandro Portale2023-05-031-1/+2
| | | | | | | | | | | | | | | | | | Having all constants in WelcomePageHelpers makes reading the welcome scren code a bit less interesting. Change-Id: Idc2e402f33042b49d041c43ecc78a6e8d2d3536a Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* | Merge remote-tracking branch 'origin/10.0'Eike Ziller2023-04-181-11/+27
|\| | | | | | | | | | | | | | | Conflicts: src/plugins/android/androidrunnerworker.cpp src/plugins/qtsupport/exampleslistmodel.cpp Change-Id: I1628528dbc0ffe874b49bbe022da5933b1348057
| * Examples: Automatically enable showing categories for Qt >= 6.5.1Eike Ziller2023-04-171-11/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | Supposedly that is the version that will have a sensible amount of examples sorted into categories to not look weird. It is still possible to force showing the categories with QTC_USE_EXAMPLE_CATEGORIES. Fixes: QTCREATORBUG-28546 Change-Id: Ia1e6afa97d9b1b86763c29209fcf6f674d0844f5 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
| * Examples: Optionally parse categories from meta dataEike Ziller2023-04-131-13/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Optionally parses example categories from the examples manifests, when setting the environment variable QTC_USE_EXAMPLE_CATEGORIES (can be done in Qt Creator's Environment > System > Environment settings). It doesn't make sense to unconditionally enable that yet, because only few examples actually have categories so far, so we will need to wait until some Qt version is suited for enabling this. If an example set does not provide categories, the "highlighted" property is used to provide a "Featured" category, as before. If an example set does provide categories, these are shown instead, sorted alphabetically, and examples with the "highlighted" property are put at the front of the category, overriding the otherwise alphabetical listing inside the categories. Examples without a category are put into a separate "Other" category at the end. Task-number: QTCREATORBUG-28546 Change-Id: I7ca312686eae13e16961def1b4b36ffd7050a447 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> (cherry picked from commit a2de016f64f91c154a222a2216c50f59e9350459)
| * Convert Examples model to FilePathEike Ziller2023-04-131-5/+10
| | | | | | | | | | | | | | | | Change-Id: I56219d2f9516662b32d45fd9b2108a0ad34113cc Reviewed-by: David Schulz <david.schulz@qt.io> (cherry picked from commit 255afd45bf614f20b5c0ccee092dcf28c50a1827) Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
| * Move examples manifest parser in separate functionEike Ziller2023-04-111-211/+15
| | | | | | | | | | | | | | | | | | and file. To make it auto-testable. Change-Id: I19d263bf080a0089eb9a4ec0f379c52446771c0a Reviewed-by: David Schulz <david.schulz@qt.io> (cherry picked from commit 7e7509744761cf8b42bdfbb5f6f849d432a3ec9f) Reviewed-by: hjk <hjk@qt.io>
* | Examples: Limit categories to single row and allow showing allEike Ziller2023-04-131-10/+14
| | | | | | | | | | | | | | | | | | | | | | | | Limit the items shown for categories to a single row (two rows for first, "featured" category), and add a "Show All" link/button in the heading, that shows all items in that category only (with a "Back" button). The "Search in Examples" input ignores categories. Change-Id: I7c8561a306ad86c3b537587621d3fd030cd08af8 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* | Examples: Optionally parse categories from meta dataEike Ziller2023-03-161-13/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Optionally parses example categories from the examples manifests, when setting the environment variable QTC_USE_EXAMPLE_CATEGORIES (can be done in Qt Creator's Environment > System > Environment settings). It doesn't make sense to unconditionally enable that yet, because only few examples actually have categories so far, so we will need to wait until some Qt version is suited for enabling this. If an example set does not provide categories, the "highlighted" property is used to provide a "Featured" category, as before. If an example set does provide categories, these are shown instead, sorted alphabetically, and examples with the "highlighted" property are put at the front of the category, overriding the otherwise alphabetical listing inside the categories. Examples without a category are put into a separate "Other" category at the end. Task-number: QTCREATORBUG-28546 Change-Id: I7ca312686eae13e16961def1b4b36ffd7050a447 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* | Convert Examples model to FilePathEike Ziller2023-02-231-5/+10
| | | | | | | | | | Change-Id: I56219d2f9516662b32d45fd9b2108a0ad34113cc Reviewed-by: David Schulz <david.schulz@qt.io>
* | Move examples manifest parser in separate functionEike Ziller2023-02-231-211/+15
|/ | | | | | | and file. To make it auto-testable. Change-Id: I19d263bf080a0089eb9a4ec0f379c52446771c0a Reviewed-by: David Schulz <david.schulz@qt.io>
* QtSupport: Fix potential null dereferenceOrgad Shaneh2023-01-231-1/+1
| | | | | | | Shouldn't happen in real life, but done to make Coverity happier. Change-Id: I3316030f59ec74516d2271973ac53c41554c3893 Reviewed-by: hjk <hjk@qt.io>
* Welcome/Qt: Show featured examples in separate sectionEike Ziller2023-01-181-11/+28
| | | | | | | Task-number: QTCREATORBUG-28546 Change-Id: I9cf42cd11b442f720070c250da789d23001a1375 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Welcome/Qt: Use separate model instances for examples and tutorialsEike Ziller2023-01-181-61/+41
| | | | | | | | And get rid of the need to filter the model in a special way. Change-Id: I42dd80e3b8b122dcd2d5f454d0acde1facf556bd Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* ExamplesListModel: Remove direct access of model items variableEike Ziller2023-01-181-18/+27
| | | | | Change-Id: I8dc2833f61fe0267953acfa8746151cea893c7f3 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Welcome: Remove requirement for subclassing ListModelEike Ziller2023-01-181-39/+40
| | | | | | | | By using aggregation for the pixmap fetching. Change-Id: I6647cc6fa7995581c692050af32e41ba9aa86491 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* ExamplesListModel: Remove unneeded override of data(...)Eike Ziller2023-01-161-23/+0
| | | | | | | | | It seems to have been a workaround for taking tags into account for the filtering, but that is done completely different nowadays, and not with the DisplayRole. Change-Id: Iff73c1a33de4a40c4919794a8644fdc4af710ba1 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Remove GPL-3.0+ from license identifiersKai Köhne2023-01-061-1/+1
| | | | | | | | | | | | | | | Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0, this applies only to a hypothetical newer version of GPL, that doesn't exist yet. If such a version emerges, we can still decide to relicense... While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only Change was done by running find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \; Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* QtSupport: Replace foreach with range-based for loopsJarek Kobus2022-11-241-8/+10
| | | | | Change-Id: Ia941c8dec41a73ca126c91304223d1fe98bc2972 Reviewed-by: hjk <hjk@qt.io>
* Merge remote-tracking branch 'origin/8.0'Eike Ziller2022-09-131-0/+2
|\ | | | | | | | | | | | | | | | | | | | | Conflicts: .github/workflows/build_cmake.yml src/plugins/qmldesigner/components/connectioneditor/dynamicpropertiesmodel.cpp src/plugins/qmldesigner/components/materialeditor/materialeditorview.h src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp src/plugins/qmldesigner/designercore/model/model.cpp Change-Id: I111b9140375b894a5487cc012b17cc32100bdb8d
| * Qt Examples: Fix that supported device information was not updatedEike Ziller2022-09-021-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Projects: Use qtcEnvironmentVariable* instead of qEnvironmentVariable*Eike Ziller2022-08-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | And instead of qgetenv. Takes Qt Creator's setting at "Environment > System > Environment" into account, which makes it easier on some platforms to set them (e.g. macOS), can be configured differently in different settings paths, and potentially can be changed at runtime (depending on usage). Change-Id: I2217f13336ec816d28bd447ccd14a405bff2a3a7 Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* | Use SPDX license identifiersLucie Gérard2022-08-261-24/+2
| | | | | | | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Task-number: QTBUG-67283 Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* | examples: Dont try to load pixmaps from URLsMarcus Tillmanns2022-07-291-5/+12
| | | | | | | | | | Change-Id: Idd4e01509077c27d2bd1569566788710e99d9539 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* | QtSupport: Convert to Tr::trhjk2022-07-251-1/+0
|/ | | | | Change-Id: Id0f7a2e55f329fe37b9c23e890c314e145e36d79 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* QtSupport: Remove screenshot cropperAlessandro Portale2022-05-241-3/+8
| | | | | | | | | | | | | | | Reduce maintenance by removing a feature that broke in 7.0, caused assertions. The absence of the cropper won't most likely be noticed, because the examples thumbnail size was increased quite a bit in the last Welcome Screen redesign. Instead of cropping, we now always scale the thumbnail to ListModel::defaultImageSize. As a benefit of this simplification, the thumbnail is now also High-DPI enabled. Fixes: QTCREATORBUG-27141 Change-Id: I57cafb000c3095dd387cd96814b6e946980b2aed Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Fix duplicate entries in examples dropdownEike Ziller2022-04-201-1/+13
| | | | | | | | | | | | | | Both the "normal" Qt node adds an example set, and the Android/ Automotive node adds another one with the same paths, leading to e.g. two items "Qt6 6.2.4" in the dropdown for the examples. De-duplicate example sets with the same paths, which we already do if an example set and a Qt version itself refer to the same path. Fixes: QTCREATORBUG-27294 Change-Id: Ia469045b2f2812612fcd8328bdfd223479b8d449 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Examples: Make sure to select some example set if availableEike Ziller2022-04-061-0/+3
| | | | | | | | | | | | | | In the case of the bug report, there is no previously selected index, and no valid Qt version, so setting the index to the highest Qt version doesn't result in anything. Make sure to select something in the dropdown, if we have any item there at all, even if our heuristics don't come up with an optimal selection. Fixes: QTCREATORBUG-26791 Change-Id: I2327594f0fd36e312aa71d1990e8ccab4a488367 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* QtSupport: Introduce a type alias for QList<BaseQtVersion *>hjk2022-01-241-3/+3
| | | | | | Change-Id: I96b0eccc04da2f4a1a4e5ea9bdceb91b3fa3d724 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Rename QtSupport::BaseQtVersion to QtVersionhjk2022-01-241-13/+13
| | | | | | | | | | ... and the Utils::QtVersion enum to Utils::QtMajorVersion to avoid conflicts. Change-Id: Ib688c67388272b7204a91444155f60b8c18a56bd Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Utils: Rename FilePath::normalizePathName to normalizedPathNamehjk2021-08-261-1/+1
| | | | | Change-Id: Ib7bcc9968749649f762a396d3861f7b67711e926 Reviewed-by: Christian Stenger <christian.stenger@qt.io>