Commit Graph

141 Commits

Author SHA1 Message Date
Kai Köhne
56baf8c058 Remove GPL-3.0+ from license identifiers
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>
2023-01-06 11:15:13 +00:00
Miikka Heikkinen
c55ac53f3c QmlDesigner: Hide bundle materials from components view
Fixes: QDS-8121
Change-Id: I1a6d316f5f48b7f57bbe48742728d14a3c90dca9
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2022-10-31 12:57:42 +00:00
Marc Mutz
8eb4d52342 Port from qAsConst() to std::as_const()
We've been requiring C++17 since Qt 6.0, and our qAsConst use finally
starts to bother us (QTBUG-99313), so time to port away from it
now.

Since qAsConst has exactly the same semantics as std::as_const (down
to rvalue treatment, constexpr'ness and noexcept'ness), there's really
nothing more to it than a global search-and-replace.

Task-number: QTBUG-99313
Change-Id: I88edd91395849574436299b8badda21bb93bea39
Reviewed-by: hjk <hjk@qt.io>
2022-10-07 13:47:53 +00:00
Marco Bubke
da36459759 QmlDesigner: Refactor isSubClass
IsSubClass is renamed to isBasedOn and takes now NodeMetaInfo as a
parameter. But for most cases there are is... functions as short cut.
The model is providing shortcut NodeMetaInfos too. This is done in the
sake of caching.

Task-number: QDS-7445
Change-Id: Iff2dea66e253b412105427134bd49cb16ed76193
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-08-26 15:02:24 +00:00
Lucie Gérard
a7956df3ca Use SPDX license identifiers
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>
2022-08-26 12:27:18 +00:00
Eike Ziller
6a296ab68a Merge remote-tracking branch 'origin/7.0'
Conflicts:
	src/plugins/qmlprojectmanager/qmlprojectplugin.cpp

Change-Id: I14030f58303839e706af892dd12a67566e3bed68
2022-05-18 13:35:47 +02:00
Mahmoud Badri
666a032840 QmlDesigner: Move QDS mime types to constants
Also:
- Rename libraryresource to asset to match the assets view name.
- Replace the outdated "bauhaus" name with "qtdesignstudio".

Change-Id: I4cacfdc33c029431b1a7b906439dabc3d9a7ee26
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-05-11 07:33:44 +00:00
Eike Ziller
41538832c3 Merge remote-tracking branch 'origin/7.0'
Conflicts:
	src/libs/utils/qtcprocess.cpp
	src/plugins/qmldesigner/components/curveeditor/curveeditorview.cpp
	src/plugins/qmldesigner/components/itemlibrary/itemlibrarymodel.cpp

Change-Id: Id0c31719e46d1c44770ea89663eee321a0517ff4
2022-02-24 11:42:57 +01:00
Thomas Hartmann
59982f1ca9 QmlDesigner: Remove superfluous update
Change-Id: I3bc4fc4b480e9cb895357580968c6568e7150cbb
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-02-23 15:01:45 +00:00
Knud Dollereder
8e3496a6ce Do not call endResetModel twice
Moved beginResetModel/endResetModel calls out of
ItemLibrary::updateVisibility into the calling functions.
This way endResetModel is not called twice in ItemLibraryModel::update.

Change-Id: I9588ba97aeb9da7c5a629612c9b3dc6315859501
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-02-08 17:52:21 +00:00
Miikka Heikkinen
590d01e8a9 QmlDesigner: Block modifying imports when editing in-file subcomponent
Adding import statements fails silently when editing in-file
subcomponent, and removing them can crash creator, so block various
cases in component library, navigator, and 3D edit view that do this.

Fixes: QDS-5353
Change-Id: Ide5429cd97d2bf78f884b14e83cdffd10399f929
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-11-05 12:44:21 +00:00
Mahmoud Badri
5de4743bb4 QmlDesigner: Persist horizontal component library's selected category
Moved showing and hiding categories logic to Cpp side so that:
- Currently selected category is persisted when the component library
  model is reset.
- QML side is clean of the mix of logic and UI.

Also reworked some logic/variables that are making the logic complex.

Task-number: QDS-5215
Change-Id: I8e9f5893f37a982283f1b1be9fee022f0b8afa32
Reviewed-by: Samuel Ghinet <samuel.ghinet@qt.io>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2021-10-19 14:13:58 +00:00
Miina Puuronen
d0a4fc4b2c QmlDesigner: Implement a horizontal layout for Component Library
The view from vertical to horizontal is changed with Loader, depending
on Library's width. Vertical layout (old) is mostly the same as before.
Added new property categorySelected for categories. Items are also now
hoverable.

Task-number: QDS-4764
Change-Id: I031f3916f0d011fd76a963b247c238997d7a55d8
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Samuel Ghinet <samuel.ghinet@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-09-30 13:07:56 +00:00
Miina Puuronen
2935f79efc QmlDesigner: Change category order in Component Library
Added prefix for Qt Quick categories so "Basic" is sorted on top.
Rest of the categories are sorted alphabetically.

Task-number: QDS-4721
Change-Id: Ibdb1a77b121e2af729b9ec6b2acf5349a361b05b
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-07-29 09:38:23 +00:00
Thomas Hartmann
c8a6d94a39 QmlDesigner: Fix missmatch of category titles
"My Quick3D Components" was renamed to "My 3D Components".
ItemLibraryImport::quick3DAssetsTitle defines the title in a single place.

Task-number: QDS-4717
Change-Id: Ib96dcb029ce0b74de64ebdc904d890d66c240d2e
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-07-21 14:08:46 +00:00
Thomas Hartmann
71a081de64 QmlDesigner: Ignore invalid version
Task-number: QDS-4495
Change-Id: I2d01f68f9f598ea9106a72332f039ec35e188678
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-06-07 13:42:36 +00:00
Thomas Hartmann
005b604b9c QmlDesigner: Allow larger major versions
With this patch we show items in the library
also if the major import is larger.

Change-Id: Id1f40a616971d322a1e99bf512ef802c14e88283
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-04-29 20:46:46 +00:00
Miina Puuronen
ca3b8f3b32 QmlDesigner: Fix Component Library category collapsed state
Set category collapsed state only after checking the status of category
and not during it.

Fixes: QDS-4227
Change-Id: I4771a8641174ac2f0413b3ff2380dd8dbb77742f
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2021-04-23 14:36:57 +00:00
Miina Puuronen
8c5ba8b987 QmlDesigner: Fix hiding categories with similar names
Fixes: QDS-4144
Change-Id: I045a7457f0d5c949f4e3a445d7679108dd0b8495
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-04-21 08:52:26 +00:00
Miina Puuronen
24d88de228 QmlDesigner: Implement hiding component library categories
Task-number: QDS-3822
Change-Id: I4e22385497c4e58725b7f7a62a4e4351d0b78661
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-04-08 08:53:25 +00:00
Mahmoud Badri
392c466b20 QmlDesigner: Fix used imports not working correctly
The existing logic (in qmljsinterpreter.cpp) for updating used imports doesn't work correctly. It takes into consideration items that are not
part of the currently open document. Fixed by checking current model
items in the document and updating used imports based on it.

Fixes: QDS-3785
Change-Id: Ia50c3c7e7ca41b9bca0d69e7c2e253f29892933e
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-03-31 18:14:22 +00:00
Mahmoud Badri
e43a67447f QmlDesigner: Remove unnecessary method param
Introduced by d37f6648f3

Change-Id: Ib2f824c0a3755f4551b93f700bd0bb719a099003
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-03-22 09:24:36 +00:00
Mahmoud Badri
c11f5ebd42 QmlDesigner: add directory import support to the item library
Also:
- fix removing used directory imports from possible imports.
- query imports from a hash for improved performance.

Fixes: QDS-3974
Change-Id: I69d072e24d39d3fa931493ab3cf2f821d5574c85
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-03-18 17:15:13 +00:00
Mahmoud Badri
5fbef6c060 QmlDesigner: Add all Quick3DAssets under 1 import section
Fixes: QDS-3866
Change-Id: I3aad4aee0d6c388446b459e558d87f68b204de59
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-03-12 17:00:22 +00:00
Miikka Heikkinen
d37f6648f3 QmlDesigner: Preserve item library expand state
Section and category visibility updates always expanded section
or category. Now this forced expansion is only done when searching
for items.

Fixes: QDS-3811
Change-Id: I006124a92086c4851d54407c4ffba0e9c94a854d
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2021-03-08 15:47:45 +00:00
Miikka Heikkinen
fab090907d QmlDesigner: Remove duplicate sections from item library
If there are multiple imports of the same library, only use the
highest version to populate item library.

Fixes: QDS-3786
Change-Id: I2dd0976c9353692342b390bec15a99554e74aa05
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-03-05 13:28:32 +00:00
Miikka Heikkinen
dfeff5b30d QmlDesigner: Search also possible imports in item library
Possible imports are now also parsed for items in item library.
They are only shown in case the search string is not empty.
Starting a drag of unimported item will automatically add the import.
Added a small manhattanlength check to the start of the drag to
avoid unwanted import additions on clicks.

Also fixed the item sorting to alphabetical order within categories.

Task-number: QDS-3825
Change-Id: I93366182af3fd7eda38bf94d53807393ecf92a08
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2021-03-05 13:28:22 +00:00
Eike Ziller
6608bf1ad5 Merge remote-tracking branch 'origin/4.15'
Change-Id: I65e889663dac29a2efd85eba35bdb39a6611c801
2021-02-24 13:57:54 +01:00
Mahmoud Badri
83c61a7c53 QmlDesigner: 2 item library import section improvements
- Move imports with no categories to the bottom of the list.
- Remove the project import from the list.

Change-Id: I41d229bb776bfe845dadbfc5c1be5b7d50aeee3e
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2021-02-23 12:49:57 +00:00
Mahmoud Badri
80dfaf3be3 QmlDesigner: Expand collapsed component categories when searching
- Expand collapsed categories in the following 2 cases:
  - When searching.
  - When choosing "Expand all" from the context menu.
- Update only changed data when expand state changes rather than
resetting the whole model.
- Update search after adding a new QML import and switching to
the components view.

Task-number: QDS-3781
Task-number: QDS-3784
Task-number: QDS-3789
Change-Id: I09e6f1f97171cd9172cadf4202dd8d02cbb78513
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2021-02-23 09:17:06 +00:00
Mahmoud Badri
43eaa09b11 Add components library expand/collapse all context menu options
also change import name from "library" to "module" and relevant tweaks.

Task-number: QDS-3589
Change-Id: Ib467dda61b6720cebe843e34cb807aee6221f5cb
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-02-18 18:43:57 +00:00
Leander Schulten
213ad8368a Fix build
Change-Id: If4593342cd92716fb2238d633e5b25135a02ce57
Reviewed-by: hjk <hjk@qt.io>
2021-02-18 06:28:55 +00:00
Mahmoud Badri
151184a609 Implement new item library UI
- Create a new header qml widget.
- Move tabs and filtering search to the header widget.
- Add imports/assets using a new "+" button on the tabs.
- Remove import flow tag view (still some remainings to be removed in another commit).
- Change layout from grid to vbox.
- Rename some classes and variables to make them clearer.
- New "Add Library" view that replaces the QML imports view (older QML imports classes removed).
- Enable Search in the "add import" view.
- Hide category header if only 1 category is under an import.
- Assorted relevant fixes, tweaks, and clean ups.

Task-number: QDS-3589
Change-Id: I710aed50858b32e024200911c6a21fd963e1b692
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-02-17 09:38:20 +00:00
Miikka Heikkinen
71b5a9e19a Fix compile error
Change-Id: Icf20d3f83a0792e59e9bd3a305d883d32ab66c77
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2021-01-14 14:30:14 +00:00
Marco Bubke
d1b0c12d6b QmlDesigner: Add image cache
The image cache is saving images and icon of this images in a sqlite
database. If there are no images they are generated in the backgound.
The icons are fetched by item library.

Task-number: QDS-2782
Task-number: QDS-2783
Task-number: QDS-2858
Change-Id: I5a32cccfef7f8fd8eb78902605a09f5da18ce88e
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-10-16 10:01:21 +00:00
Aleksei German
00c07ca53e QmlDesigner: MCU configurations metadata
-Removed c++ hardcoded info about QDS MCU restrictions
 -Instead replaced it with dynamically loaded qml files
 -Replaced QLists with QSet/QHash to improve performance

Task: QDS-2794

Change-Id: Ifc23d1299155001b6573dc0ed789dda5d2cfaf24
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-10-06 14:10:04 +00:00
Eike Ziller
a1e3001fa4 QmlDesigner: Fix build with Qt6
Task-number: QTCREATORBUG-24098
Change-Id: I3d5c7d821402acc13ccd505550afc66a531b13b5
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2020-09-21 06:56:06 +00:00
Aleksei German
b11bfd5652 QmlDesigner: Disable more properties for QUL
Disabling more items in ItemLibrary and properties

Change-Id: Ib019c1cbe356e0f7e3889d3500c080b0f5756c34
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-09-03 08:39:26 +00:00
Thomas Hartmann
71202abcbc QmlDesigner: Do not show items not available fot QtForMCU
Change-Id: Ia61634a5108db51b49241fd58b73ab71e9e5e2e8
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-09-01 09:19:12 +00:00
Christian Kandeler
48be20cf48 Fix clang warnings about copies in range-for constructs
Change-Id: If50553964483626e72a816b1d23fa81b45ed9ca7
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-06-15 12:38:17 +00:00
Alessandro Portale
625a35e492 QmlDesigner: performance-for-range-copy
Avoid copying the loop variable on each iteration if a const reference
would suffice.

For QPointers<>, this change only adds a const.

Change-Id: I5abe7d793cd46859a9a4f9304ec1bd41f899d72c
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-06-14 20:10:01 +00:00
Vikas Pachdha
662c224bab Fix crash with sorting library items
Strict weak ordering relation for the comparison was not followed.
Using shared_ptr and removing QSharedData. The entry data is shared
between instances

Task-number: QDS-2011
Change-Id: Idfcd23b2d458f9c7cada47180cb6ab3b4b090416
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-04-29 08:37:07 +00:00
Tim Jenssen
23ce744407 QmlDesigner: cleanup ItemLibrary a bit
Change-Id: Ib3b35e68434e94a8dde10653881fc765e449beb1
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-04-23 11:51:33 +00:00
Thomas Hartmann
022b2b47e9 QmlDesigner: Remove check
This is taken care of in update already.
Empty section are not shown.

Change-Id: I48763c42bb7d1b39e36b87be35e48c558a512c77
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-04-20 14:44:17 +00:00
Thomas Hartmann
f94c8e1143 QmlDesigner: Show FlowWildcard and FlowDecision in item library
We want to show those in the flow mode.

Change-Id: Ifc997102f37495d759355adcefb98b1febd11d53
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-04-20 14:43:59 +00:00
Tim Jenssen
e571c98661 QmlDesigner: fix a rarely happen crash
It was difficult to reproduce, but happen regular while importing
something from design tools.

Task-number: QTCREATORBUG-23707
Change-Id: I93e8c8cf9d44ecf20f5754ae48a0599f056a8610
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-04-02 09:12:31 +00:00
Thomas Hartmann
4da76ae005 QmlDesigner: Remove qDebug
We allow such items in the item library now.
Examples are materials, 3dObjects and animations.

Change-Id: I5e5b614c9797e489db8f62e8f287e1dbfe91fc99
Reviewed-by: Aleksei German <aleksei.german@qt.io>
Reviewed-by: Knud Dollereder <knud.dollereder@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-03-23 12:12:50 +00:00
Thomas Hartmann
868e3133c0 QmlDesigner: Add flow mode to ItemLibrary
If in flow mode we only show FlowItems.

Change-Id: I7d41155eac8bc180c7ac1d0092b35d7fc3f9be91
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-01-29 14:49:05 +00:00
Thomas Hartmann
63a646af9b QmlDesigner: Add hints for visibility in library and navigator
Change-Id: If5d3a4c34a0010cc5a826296aa428a5915142659
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2019-04-29 10:10:08 +00:00
Alessandro Portale
616e19ff9e Fix warning: "Missing emit keyword on signal call"
[-Wclazy-incorrect-emit]

Change-Id: I93bdc6e23cdaccf35c9899ae16870ccc65a54f80
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2019-01-17 15:54:56 +00:00