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: I46378cc1aab44211cdc326afc5fabc78bf4b36a3
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Nodes with dynamic properties cannot be reparented under a newly
created node in the same transaction without breaking said properties.
To work around this issue, ensureMaterialLibraryNode() was split into
two transactions. This also meant removing ensureMaterialLibraryNode()
call from materialLibraryNode(), so now material library will only be
created in response to model attach or qtquick3d import addition.
This should still cover all cases where user doesn't manually remove
the material library node.
Fixes: QDS-8095
Change-Id: Icff449b2bee0da2b43b02bbf5e0d28189aa2b3a9
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
To improve testability external dependencies are now broken with an
interface. It is a first step to test individual units without injection
of source files.
Task-number: QDS-7571
Change-Id: I4255c8668022f1097947e4ea5788f2a6b605365d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
We apply not very often the parent to views. So it can lead to dangling
pointer if the parent is used by other objects and does not handle the
null pointer case. It can lead to double deletion if the parent is
deleted before the object when it is on the stack or handled by smart
pointer.
If you really want to use it there is still setParent.
Change-Id: I1fc6b145a50f037a0e9d415fb36e7970ea7296ed
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Many validation tests can now be skipped.
Task-number: QDS-7454
Change-Id: I9c93498b96c1f1facd72a98d58751d3ad031c483
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* States are now taken into account.
* If name is empty in expressionChanged(), then this
is just a notifier for the QML frontend and has to be ignored.
* When exposing the expression to QML we also have to take into
account states.
* Implementing resetting dynamic properties. We have to hardcode
the default values for the base state
* I also implemented the callbacks in the views for PropertyChanges.
Change-Id: I08247a3c1783a52853db7bf0f7f249520f7edc1c
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This is done to avoid recursive writes to model.
Change-Id: Ie7cdd9c38fc54276a2c6617ba51137fd78946f4a
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Converted old auxiliary properties usage in material preview to
the new API. Since most properties need to be both persisted to the
document and used by puppet, those properties had to be duplicated.
Fixes: QTCREATORBUG-28085
Fixes: QDS-7624
Change-Id: Idf51c773a2d49d44413bfaf69d4a683692ea8a0d
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Added dynamic properties section to property editor and material
editor for all nodes. It shows all dynamic properties defined
for the node with proper editors for the supported types.
Dynamic properties can be added and removed via property editor
as well.
Material editor shows dynamic properties similarly.
Fixes: QDS-7411
Change-Id: Id195f5ca23d55544cea29eb8996690a7eed1cc57
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
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>
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>
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
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>
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>
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>
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>
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>
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>
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>
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>
Added model pointer validity checks into a few places.
Fixes: QDS-7191
Change-Id: I94beb134f4d9a0b1c7fc9dc87da1d02ad255beaa
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>