Commit Graph

1120 Commits

Author SHA1 Message Date
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
Eike Ziller
7eaa36e6e5 Merge remote-tracking branch 'origin/8.0' into 9.0
Conflicts:
	src/plugins/qmldesigner/components/materialbrowser/materialbrowserview.cpp
	src/plugins/qmldesigner/designercore/imagecache/meshimagecachecollector.cpp

Change-Id: I38f196e8f42cf11f7b613e7a723745600e35c5e9
2022-09-27 10:03:37 +02:00
Thomas Hartmann
85b911d30b QmlDesigner: Fix anchor targets
In some cases the binding for anchor targets is not properly resolved.
Using explicitly the root context we define the ids in does solve
the issue.

Change-Id: I69e5bd237668719ec9417d30d0bac8635c79506a
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-09-23 14:53:48 +00:00
Thomas Hartmann
507b1fff39 QmlDesigner: Create importComponentObject in root context
This might be the implicit default, but let's make this
explicit.

Change-Id: Ic42735b12f22819767ceb642d265f813201c9146
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-09-23 14:53:41 +00:00
Miikka Heikkinen
3d672dbf16 QmlDesigner: Fix material 2D view preview for material root components
Change-Id: I7930e5087014b47ccc054109cbb607ef9c373515
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-09-23 14:12:15 +00:00
Miikka Heikkinen
c909e791d6 QmlDesigner: Remove unused variable
Change-Id: Ifaddb79f01887d73cc2d715ba45f41f2dcd30a0a
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2022-09-23 11:25:26 +00:00
Henning Gruendl
754be28e36 QmlDesigner: Fix state shown after reordering
Fix an issue which caused the wrong state to be shown in the form editor
after reordering the states in the state editor.

Task-number: QDS-7753
Change-Id: I220bb5b11beb4f9bfc6a85069a688c9ff2984d8f
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-09-22 20:24:56 +00:00
Marco Bubke
4bb4e07ad8 QmlDesigner: Inline SynchronizeCommand
Change-Id: Id030fb6aba7f1ba61ce97ebebb5e91a809ab6d8d
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-09-22 19:06:21 +00:00
Tim Jenssen
80e2eddd95 Merge remote-tracking branch 'origin/8.0'
resolved conflicts:
	share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5rendernodeinstanceserver.cpp
	src/plugins/qmldesigner/components/formeditor/formeditorview.cpp
	src/plugins/qmldesigner/designercore/exceptions/exception.cpp

Change-Id: I13a5248415fa1ae03e1c6d0972d9b3bb8c80a3b0
2022-09-22 10:32:40 +02:00
Knud Dollereder
93d4b057cf Check for more dirty flags
This fixes an issue of the formeditor which did not update properly if
components contain items that have one of zvalue, opacity or visibility
attributes animated.

Change-Id: I1b20f09177878419b2b18aaf94c84b6ae437be7d
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-09-21 12:37:06 +00:00
Eike Ziller
5d55cfdae5 Merge remote-tracking branch 'origin/8.0'
Conflicts:
	share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorEditor.qml
	share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/icons.ttf
	src/libs/utils/fileutils.cpp
	src/plugins/qmldesigner/components/edit3d/edit3dwidget.cpp
	src/plugins/qmldesigner/designercore/include/abstractview.h
	src/plugins/qmldesigner/designercore/include/nodemetainfo.h
	src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp
	src/plugins/qmldesigner/designercore/model/model_p.h
	src/plugins/remotelinux/linuxdevice.cpp
	tests/auto/utils/fileutils/tst_fileutils.cpp

Change-Id: I26a21e2523d3d725fdb8c548a531cdbdaeaeca20
2022-09-19 09:54:06 +02:00
Thomas Hartmann
4bf105b662 QmlDesigner: Ignore "when" property for all states
We actually did set the "when" property for StateGroups.

Change-Id: I45a1663d60f8f443b4deafa529d1fd2788a8459e
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-09-15 10:51:05 +00:00
Marco Bubke
8aee8df4df QmlDesigner: Break dependency to View3DActionCommand
The node instance view and his commands should be not called directly
from other views. There are special classes QmlItem which can do it but
every change should go through the model.

Change-Id: I734e5538d7f6ecb07d736912f647c5eb92dc7631
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-09-15 09:20:12 +00:00
Miikka Heikkinen
e15d834601 QmlDesigner: Create 3D models at the point of context menu trigger
Fixes: QDS-7640
Change-Id: I2f178c2e2661dedc4efe23b675363283e3cd3bc3
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-09-13 10:15:34 +00:00
Eike Ziller
5ae23f8c66 Merge remote-tracking branch 'origin/8.0'
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
2022-09-13 11:15:16 +02:00
Miikka Heikkinen
ed89cc730d QmlDesigner: Fix material preview env and model aux handling
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>
2022-09-09 14:22:57 +00:00
Miikka Heikkinen
3485d97755 QmlDesigner: Add support any pickable node with 3d view context menu
Previously only 3D models could be picked for context menu target.
Now any node that can be resolved from a point at 3D edit view can be
picked.

Fixes: QDS-7518
Change-Id: Id4a30d96744c42907d45688493776bdff35b934e
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-09-08 10:36:11 +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
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
Miikka Heikkinen
169ba3b6f7 QmlDesigner: Convert the form editor preview image to correct format
We were passing the image with premultiplied alpha obtained from
QSGRhiLayer::toImage() to be shown in form editor. This corrupts the
colors in with 3D materials having partially transparent colors.
Converting the image to QImage::Format_ARGB32 format fixes the issue.

Fixes: QDS-7474
Change-Id: Id0b689d7e2d9fc111e98f28b18db0af3ac30041f
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-08-26 12:19:43 +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
c6c92ec096 Merge remote-tracking branch 'origin/8.0'
Conflicts:
	src/libs/qmljs/qmljsmodelmanagerinterface.cpp
	src/plugins/clangcodemodel/clangdclient.cpp
	src/plugins/qmldesigner/components/edit3d/edit3dwidget.cpp
	src/plugins/qmldesigner/components/materialbrowser/materialbrowserview.cpp
	src/plugins/qmldesigner/designercore/include/modelnode.h
	src/plugins/qmldesigner/designercore/model/modelnode.cpp
	src/plugins/qmldesigner/designercore/model/rewriterview.cpp

Change-Id: I93c57879b79f27325321bfc045ca618bd835af93
2022-08-26 08:40:23 +02:00
Mahmoud Badri
8656bafbd4 QmlDesigner: Add delete action to 3D Editor's context menu
This entails selecting a model upon right-clicking if it is not selected.
Also fixed a memory leak and small tweaks.

Fixes: QDS-7401
Change-Id: I592acb3fff30ecc3236f3cf2fbe126de4fb389dc
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2022-08-25 09:55:32 +00:00
Miikka Heikkinen
f6e8b5f753 QmlDesigner: Use actual material for model previews
Fixes: QDS-7412
Change-Id: Iec020578460e417e602f832ed0d667fbdda4e96a
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2022-08-25 09:40:05 +00:00
Thomas Hartmann
ae872359d0 QmlDesigner: Render state previews for StateGroup
Render previews for all state groups in the document.

Change-Id: I89d9c43a53eb3d9844b863278395fd9098a07772
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-08-24 17:58:23 +00:00
Thomas Hartmann
8e65e2815c QmlDesigner: Add NodeInstanceServer::allGroupStateInstances()
Change-Id: I26b20976746c3790d679a63db209fb535eb58382
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-08-24 17:58:08 +00:00
Thomas Hartmann
80922268ab QmlDesigner: Implement ObjectNodeInstance::stateInstances() for StateGroup
Change-Id: Ia6e239530d399da34ab63253762e3ebd2a79f4db
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
2022-08-24 17:57:55 +00:00
Thomas Hartmann
f3e9fbd748 QmlDesigner: Do not set state property on QQuickStateGroup
The state is determined by the state view.

Change-Id: I3b76b25c618d4f860f13d2e005d88d93a660fbc0
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-08-24 17:57:18 +00:00
Thomas Hartmann
0e23845618 QmlDesigner: Always skip when condition
There is no reason to set the when condition ever.

Change-Id: I4c6b5ca04cdb7ba62f833225c6878da83a02abaf
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-08-24 17:57:03 +00:00
Mahmoud Badri
fc4ebb0cab QmlDesigner: Create a context menu for the 3D Editor
For now only 1 action is implemented (edit material), more actions are
coming next.

Task-number: QDS-7414
Task-number: QDS-7398
Change-Id: Id8e36c23d9a4d35ee94d55d3d6b15df78241a05d
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2022-08-22 13:26:18 +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
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
Marco Bubke
ccc8c7c997 QmlDesigner: rotBlock is using it own aux type
rotBlock was using the mechanism to overwrite values but actually it is
only for communication to the puppet. So now there is
NodeInstanceAuxiliary as a generic way. NodeInstance was renamed
NodeInstancePropertyOverwrite to make it clear that it is for
overwriting properties.

Task-number: QDS-7338
Change-Id: Id5ab1f5c4761a184964a347f00d1449ae2d7d77f
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2022-08-16 16:13:46 +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
hjk
ed8c775def Merge remote-tracking branch 'origin/8.0'
Change-Id: Icbb87ac8bcee5fb86042d3863a973573510651b4
2022-08-05 08:50:27 +02:00
hjk
f7a087ce7a QmlPuppet: Compile fix
Change-Id: I4ff0fd46d8e0f2c00857de2b8f6d99a502d2675f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2022-08-04 15:42:19 +00:00
hjk
184a9cbd64 QmlPuppet: #include <QColor> in generalhelper.h
CI was complaining.

Change-Id: I7b2da474d3197de4c046efc0e2e54ab19b8d3663
Reviewed-by: Samuel Ghinet <samuel.ghinet@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2022-08-04 09:14:49 +00:00
hjk
7950a038b4 Merge remote-tracking branch 'origin/8.0'
Change-Id: I1dc664137eeecb7dd69f29af7a08164683d51077
2022-08-03 17:51:42 +02:00
Samuel Ghinet
86f93b8949 Sync color between environment map and 3D Editor background
Task-number: QDS-7097
Change-Id: I5f2c83bc43bd589d0d1f32e01e7512ab20a03bcf
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2022-08-03 09:35:11 +00:00
Tim Jenssen
05f9769d91 qml2puppet: fix build
Change-Id: I0f06da77efe852cd8f4b914a4dc843fabbdd8f31
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2022-07-12 09:58:52 +00:00
Tim Jenssen
d6c10e775d qmlpuppet: remove qmlprivategate DesignerSupport < Qt 5.6
Task-number: QTCREATORBUG-26600
Change-Id: I629c8cd1f497ed2dd354ff461aa890a77bdc2a01
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-07-12 09:20:04 +00:00
Marco Bubke
67324512e9 QmlPuppet: 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: Ia6115ab8fefbe03f247edfea2b7bed73e9149068
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2022-07-11 09:29:37 +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
Mahmoud Badri
5a9a6804ee QmlDesigner: Implement drag-n-drop materials to the 3D Editor
Fixes: QDS-7011
Change-Id: Id6e4aea2c19561ea861507480636ae2358ece067
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-07-01 15:38:29 +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
8a8a2f5c55 QmlDesigner: Unify the background of 3D preview images
Added 3D checkerboard floor on all 3D previews.
Since shadows generally look bad for arbitrary 3D scenes, and would
mostly be obscured by the model itself as we want the light mostly
from the front, removed shadows also from the material preview to unify
the previews.

Qt5 had issues rendering the 3D floor texture, so used a static image
there, as Qt5 only generates previews of one size.

Fixes: QDS-7078
Change-Id: I74d094878ed01e6e531ad60df1f8d9d7cf415860
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2022-06-23 13:06:04 +00:00
Miikka Heikkinen
9c3636af49 QmlDesigner: Ensure materials render properly after puppet reset
This is a workaround for quick3d issue QTBUG-103316, where
material library materials for editor are properly initialized only
if the first encountered View3D in the scene is also rendered first.

Fixes: QDS-7084
Change-Id: I8bb6a8e6bfe2fcffddfe86f92157d386fdf4095d
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-06-16 13:53:43 +00:00
Samuel Ghinet
50aadacb6e QDS Editor 3D: Allow the user to select (and reset) the color of grid lines
Task-number: QDS-7122
Change-Id: I686269e61b53bd5e3d5d1225376930612d869072
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2022-06-16 10:17:01 +00:00
Thomas Hartmann
7ae288d355 QmlDesigner: Use changed properties to update 3D preview
EffectReference is always dirty and it is the only dirty flag.
Instead, we update now if any property changed.

Task-number: QDS-7079
Change-Id: I157cf2d3b15120c33f4a6b3f53e526d555c7f80c
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2022-06-13 08:35:11 +00:00