Commit Graph

41 Commits

Author SHA1 Message Date
Marcus Tillmanns
0939b44d16 MaterialEditor: Fix warnings for unused parameter
Change-Id: I39b153692860397bf1d8aec25271d02604dedc70
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-09-06 11:53:36 +00:00
Eike Ziller
a2f21d40f5 Merge remote-tracking branch 'origin/8.0'
Conflicts:
	src/plugins/debugger/debuggerdialogs.cpp
	src/plugins/qmldesigner/components/materialeditor/materialeditorview.cpp
	src/plugins/texteditor/fontsettingspage.cpp

Change-Id: I5a6accd2065e0d8320045b57ade7b54a9a09aae0
2022-08-31 11:03:13 +02: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
Marco Bubke
35a773b2dc QmlDesigner: Use ProjectStorage
Task-number: QDS-7379
Change-Id: I50c8a4a527daa7268a723094b6ceec37d10dfaa6
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-08-26 10:57:09 +00:00
Miikka Heikkinen
3e17d8eed4 QmlDesigner: Change default material preview env to studio env
Since "Default" option is no longer default, it was changed to "Basic"

Change-Id: I8654efbd98fe62f6c4817141fc8559757f5e58e8
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2022-08-26 08:15:15 +00:00
Eike Ziller
64247bf571 Merge remote-tracking branch 'origin/8.0'
Reverts/comments out parts of 45f93a817a,
which needs to be resolved in a follow-up commit.

 Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri
	share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp
	src/plugins/clangcodemodel/clangmodelmanagersupport.cpp
	src/plugins/cmakeprojectmanager/cmakesettingspage.cpp
	src/plugins/python/pythoneditor.cpp
	src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp
	src/plugins/scxmleditor/common/colorsettings.cpp

Change-Id: I7f0f7b7120e75a9fc3a8886bc57c17345cbb501b
2022-08-19 12:48:27 +02:00
Miikka Heikkinen
e4b35fa576 QmlDesigner: Block preview data change handling when initializing
Handling the data change is pointless when we are initializing UI
to stored values, and can also trigger undesirable secondary effects
like showing color selection dialog.

Fixes: QDS-7415
Change-Id: I0321c47d5a63971dc890c37f90ec6fedc8293eca
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-08-18 11:10:53 +00:00
Miikka Heikkinen
326f70c40f QmlDesigner: Add support for component materials
Component materials can now be seen on material browser and their
properties are properly shown on material editor

Fixes: QDS-7390
Change-Id: I3f7edfe655bdb0da1fa71739c825d09d6101c386
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-08-18 11:10:42 +00:00
Miikka Heikkinen
2e8574bd76 QmlDesigner: Add scene root material support to material editor/browser
If the scene root item is Material subclass, material library is not
created for the scene. Material editor and browser functionalities that
relate to having material library are disabled.
Material editor will always show the material that is the scene root.

Fixes: QDS-7374
Change-Id: Icd1c212c17b59e4a2caa6b3b4d7e615e68b21eb9
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2022-08-18 11:10:04 +00:00
Miikka Heikkinen
45f93a817a QmlDesigner: Add environment and model selectors to material preview
The model and the scene environment used to render material previews
can now be selected via buttons next to the preview in material editor.

Task-number: QDS-7347
Change-Id: I03089029e8420f80ed65be1c7b7a1ce4581f2fd4
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-08-11 13:33:59 +00:00
Marco Bubke
c13e2b89f5 QmlDesigner: Add type enumeration to auxiliary data
Auxiliary data so far used naming conventions to declare the kind of the
data. Now an enumeration is used. The auxiliaryData(...) is returning an
optional too so that it is known if a value exists. There is now
auxiliaryDataWithDefault(...) which is returning an invalid
QVariant instead.

The instance cache is now disabled because there is not notification for
information changes. So if we get the real data from the node instances
there will be no information changes because nothing changed. So the
form editor is a strange state of being reset but not all data
arrived. Before this patch there were still changes happen because of
some side effects that auxiliary properties were sent which were never
intended to be sent. If we re-enable the cache we need to send
information changes or every view must expect that the information is
already there.

Task-number: QDS-7338
Change-Id: I0cafd149c53df552c7c8442f1e8ba87f5451dbd1
Reviewed-by: Aleksei German <aleksei.german@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-08-09 17:52:03 +00:00
Eike Ziller
3ec87e37ee Merge remote-tracking branch 'origin/8.0'
Conflicts:
	src/plugins/todo/optionsdialog.cpp
	src/plugins/todo/todoprojectsettingswidget.cpp

Change-Id: I24ca90c2fc2cd707df901d42694df6d0e27d696d
2022-07-20 12:03:40 +02:00
Thomas Hartmann
1627acd659 QmlDesigner: Track MaterialEditor usage
Change-Id: Ie8daf34bf21d9b12711704be4fdea9b291307f02
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-07-13 12:42:38 +00:00
Marco Bubke
9faf6d0826 QmlDesigner: Adapt to C++ 17 [[maybe_unused]]
It has the advantage to to move the attribute to the declaration instead
of using a workaround.

Change-Id: I08b712f146a0625d0367657c31d6c1e5f7caec41
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2022-07-11 09:29:52 +00:00
Marco Bubke
fe50af151d QmlDesigner: Simply property type name check
Move some repetitive pattern to PropertyMetaInfo

Change-Id: Iba8722d3d95881c1db85c12cbc2b2b8c4b629f2c
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-07-07 17:48:23 +00:00
Marco Bubke
fd41105191 QmlDesigner: Introduction of PropertyMetaInfo
Because the project storage is integer id based the string based API
isn't fitting well for the new approach. PropertyMetaInfo can be easier
mapped to the project storage.

Task-number: QDS-7197
Change-Id: I49bc650abdaacf4b039d76c2514b5ad05ec84abe
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-07-06 12:40:58 +00:00
Tim Jenssen
56bcad81ad Merge remote-tracking branch 'origin/7.0' into 8.0
Change-Id: I7cd5d3808007ef739212f4347ba9b16e7b298943
2022-07-01 09:22:10 +00:00
Miikka Heikkinen
a627d43d39 QmlDesigner: Fix crash on mode change
Added model pointer validity checks into a few places.

Fixes: QDS-7191
Change-Id: I94beb134f4d9a0b1c7fc9dc87da1d02ad255beaa
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-06-27 08:20:21 +00:00
Miikka Heikkinen
93cd068d3e QmlDesigner: Create material library at import change
There are still rewriter issues with Qt5, where component library
templates for models contain materials, so create material library
when quick3d import is added to ensure we never need to create
it when models are added.

Change-Id: I7006a39228d316dbfd84f49d19c025bb42b6765c
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2022-06-23 13:09:15 +00:00
Mahmoud Badri
cc1bf95dc2 QmlDesigner: Ensure material lib node exists on project launch
In this commit material library node is created on model attach.
A timer keeps monitoring until it is suitable to create the node.

This will properly move materials into material library for
projects created with previous QDS versions.

Also removed unnecessary handling on new material dragging, as
rewriter now works properly with material library creation.

Fixes: QDS-7178
Change-Id: Idf6f41906e02bc064961d8de9841ba1644bd3552
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-06-22 14:16:23 +00:00
Miikka Heikkinen
2cb45cbb6b QmlDesigner: Reduce number of preview requests from material editor
Removed preview request call from setValue, as it is called in long
loops during initial project load and added the calls outside those
loops where they already weren't there.

Fixes: QDS-7175
Change-Id: Ia83814a0de6fe801d954373dc8ce0e4920e8a6a6
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-06-22 12:44:28 +00:00
Mahmoud Badri
d080e6331f QmlDesigner: Parse material library on model attach
Parsing has to happen so material in an old project are correctly
appearing in the material views. Using a timer to wait until it is ok
to create the material editor node. Otherwise errors happen.

Change-Id: I54b532211f8a865c5183fab0fd8c12e5f15b983a
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-06-17 08:47:04 +00:00
Mahmoud Badri
568004e121 QmlDesigner: Detect asset drag'n'drop support based on property type
Handle property support for asset drag based on property type rather
than name in order to support properties with any name
(like lightProbe).

Change-Id: I20fd422119db96aebd505b47888c97f0d94bf7f9
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-06-16 14:05:10 +00:00
Miikka Heikkinen
7269aafbd8 QmlDesigner: Ensure material library is created when needed
Added material library accessor to AbstractView, which creates the
material library and moves existing materials under it in case it
doesn't yet exist. Also added material assignment function to
AbstractView. The reason these were added to AbstractView instead of
being handled e.g. via custom notification in material editor is that
they need to be called from multiple different views in the same
transaction that triggers the need of material library.

Fixes: QDS-7081
Change-Id: If2bb884f87d04c9f3599c2342df66ef51ec238ee
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-06-07 14:14:56 +00:00
Eike Ziller
84ff5eb169 Merge remote-tracking branch 'origin/7.0' into 8.0
Change-Id: Ib669e2e993c4675a7382f721ccb7d6ecff11fc20
2022-06-07 10:28:37 +02:00
Miikka Heikkinen
92a3ebd3ef QmlDesigner: Fix crash on project load
Creating material library node in response to model change
notifications is problematic, so don't do that.

Fixes: QDS-7075
Change-Id: Ib688d71223a851b8a98e1c8fcfe598f6decdaf16
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2022-06-03 13:29:24 +00:00
Mahmoud Badri
8d11ec2656 QmlDesigner: Fix adding the first material to the material library
Fixed that material editor node was not being created when no materials
exist.

Fixes: QDS-7069
Change-Id: I358c497325e8865fc5f012531783dcbe46c32490
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2022-06-03 10:00:49 +00:00
Thomas Hartmann
a734e1b4e8 QmlDesigner: Move reparenting of materials into transaction
Without a transaction we will reparse the document for each reparent.
This will make the process very slow if there are e.g. 20 materials
in the document.

The new parent has to be created first. This cannot be part of the same
transaction, because of limiations in the rewriter.

Change-Id: Ie2c587d0f072b8163846c660dc2dd66bee7146c1
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2022-06-02 13:21:20 +00:00
Mahmoud Badri
d47ad10728 QmlDesigner: Fix small typo
Change-Id: Ic3fb65b8f8ecf80dcf65c21f5f3e5a35c42d0735
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2022-06-02 09:51:51 +00:00
Eike Ziller
68c5968447 Merge remote-tracking branch 'origin/7.0' into 8.0
Conflicts:
	src/libs/utils/launchersocket.cpp

Change-Id: I7ec649485bb7fc7c299b571d92519d2b7fc9506b
2022-06-02 10:54:10 +02:00
Mahmoud Badri
e1bb5d058d QmlDesigner: Mark unused params in material editor and browser
Change-Id: I5d1e2dcd340e766f829fe78edb63dfa8beacfa78
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2022-06-02 08:50:26 +00:00
Mahmoud Badri
c9b140eb7e QmlDesigner: Correct asset to material editor dnd behavior
Only check the first asset when dnd multiple assets to be in sync with
the dnd handling in the QML side after drop.

Change-Id: I32ecf6be87284dc8e32f51f674ba082fab7cad7a
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2022-05-31 13:06:01 +00:00
Mahmoud Badri
175343e24a QmlDesigner: Highlight material editor properties upon asset drag
When starting an asset drag in the assets view, highlight all
supported properties in the material editor.

Change-Id: I60935756e4c1384edcc284068163d08ebe529a05
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Samuel Ghinet <samuel.ghinet@qt.io>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2022-05-31 08:57:43 +00:00
hjk
a33594fa76 QmlDesigner: Sprinkle code with Q_UNUSED
Less noise when compiling.

Change-Id: I7cac44912d5d5165f25ce411db6c6de486688c45
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2022-05-30 14:50:42 +00:00
Eike Ziller
09efabaf89 Merge remote-tracking branch 'origin/7.0' into 8.0
Change-Id: I3780a56c1e02c2e98028aaf02b54733c6f222498
2022-05-30 14:14:04 +02:00
Mahmoud Badri
0b51afe21d QmlDesigner: Implement "duplicate material" feature
Fixes: QDS-7013
Change-Id: I28a11dbd9d6586631c0edcf8003e551917eaac98
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Samuel Ghinet <samuel.ghinet@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-05-27 11:20:48 +00:00
Eike Ziller
82ee8baad8 Merge remote-tracking branch 'origin/7.0'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri

Change-Id: I254066f8be63cb5b15650ef2a470206db56de026
2022-05-25 11:42:13 +02:00
Mahmoud Badri
917ae81ce6 QmlDesigner: focus material browser upon open
When clicking the open material browser button in the material editor,
focus the material browser window if it is already open. Also do the
same when opening the material editor by double clicking a material
in the material browser.

Fixes: QDS-7006
Change-Id: If64d1ff6595dea5e33771485622322df708405d9
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2022-05-24 13:10:42 +00:00
Mahmoud Badri
71e553f497 QmlDesigner: Disable apply material to selected when no selection exist
When there is no valid model selected, disable the "apply to selected"
actions in the material editor and browser.

Change-Id: Id8e771c64e69c0ba2f42dff01d19ffbf4afafb77
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-05-24 13:01:20 +00:00
Mahmoud Badri
f09d4538e7 QmlDesigner: Implement Material Editor
Task-number: QDS-6438
Task-number: QDS-6439
Change-Id: I04e899a68aea665f0df8b65e21523632174ec76b
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Samuel Ghinet <samuel.ghinet@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-05-23 16:44:02 +00:00