Commit Graph

39 Commits

Author SHA1 Message Date
Knud Dollereder
b18b7920bb Refuse to add properties from unselected nodes
... and select property after adding it to the model.

Change-Id: I4210e9b1e27b3d396ba5f421629a2b90d2771f50
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2023-09-15 13:23:02 +00:00
Knud Dollereder
2dda34f781 Extend bindingmodel and minor fixes
- Include singletons in the list of sources (former sourceModelNodes)
- Do not suggest sources on bindings that are initialized without a
  source node. Prevent constructs like
  "property string p: button.qsTr("STREXPR3")".
- Allow changing the name of the target property and update the
  delegate properly when doing so.
- Remove superfluous emitCurrentIndex emission from the
  dynamicpropertiesmodel.
- Add missing qml imports.

Note that it is still possible to create illegal constructs if the user
wants to.

Change-Id: I084978f2f8d451df076d1b556db15764e17e31fb
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2023-09-11 09:15:31 +00:00
Knud Dollereder
759b560bab Cleanup ConnectionEditor models
Simplified interface for the BindingModel and DynamicPropertiesModel.

Change-Id: I772f31be704afe2a43c6368aefab1b026b85ec8b
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2023-09-06 17:14:38 +00:00
Thomas Hartmann
5907e480a0 QmlDesigner: Fix QML for bindings/properties
* Ensure a "node" is added to the model if missing, for e.g. Singletons
* Expose targetNode of property

Change-Id: Ifbb131c1d6efaaceb15a6e630ce56023ace63311
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
2023-09-01 16:31:46 +00:00
Thomas Hartmann
9a11fa3ef8 QmlDesigner: Add QML front-end for ConnectionView
This is still disabled by default until the UI gets polished.

Add roles to models. ConnectionModel, BindingModel and DynamicPropertiesModel.
In QML roles are used in the ListView to "mimic" columns. The columns are only
relevant for the "old" cpp QTableView and can be removed.

Making currentIndex part of the model. If rows are removed and added
again we have to "reset/keep" the currentIndex as part of the model, because
the index is temporarly invalid on the view.

Implementing DynamicPropertiesModelBackendDelegate as reference.
This is a pure "backend delegate" that exposes all relevant properties for
a current row to QML.

Adding StudioQuickWidget and exposing the backend.

Adding StudioQmlTextBackend and StudioQmlComboBoxBackend to
StudioQuickWidget (should be moved into their own files).
Those helper classes make is easy to expose a property to a combobox or
textfield. The backend has to know nothing about the actual frontend
and those classes act as a mini-model for a view in QML.
The API is similar to UI controls.

Change-Id: I7a2c6ad951306fbca1d586fb8f278acdd91a064b
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
Reviewed-by: Knud Dollereder <knud.dollereder@qt.io>
2023-07-07 09:36:34 +00:00
Marco Bubke
278d69df4f QmlDesigner: Fix deprecated function calls
count() -> size()
userType() -> typeId()
type() -> typeId()

Fixes: QTCREATORBUG-29237
Change-Id: Ic63b79f6fab1f6ed5227d97aa12dcbfdebb4f05f
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2023-06-07 11:31:25 +00:00
Tim Jenßen
feabda3aa7 Merge remote-tracking branch 'origin/10.0' into qds/dev
bigger conflicts resolved at:
  src/plugins/qmldesigner/CMakeLists.txt
  src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp

Change-Id: I08e2a109d8e37cbd77225129854e9e633725bfc7
2023-03-26 16:26:18 +02:00
Mahmoud Badri
cd70e9cecb QmlDesigner: Move connection classes out of Internal
Also clean up DynamicPropertiesProxyModel and DynamicPropertiesModel
classes.

Change-Id: I40a2864c1ffbd555dfea9452cd55bbeb23e9fdfa
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2023-03-16 16:49:34 +00:00
Miikka Heikkinen
0c0e7f1fe1 QmlDesigner: Insert added dynamic properties to correct position
Dynamic properties were sorted on initial open, but newly added
properties were just appended.

Fixes: QDS-9019
Change-Id: I20a47e3f3554274c794ee2cdea8b8c925c1c57fd
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2023-02-06 09:05:09 +00:00
Thomas Hartmann
94857925ab QmlDesigner: Slicence QTC_ASSERT
The selection can be empty.

Change-Id: I06856a58200893e841f99e95a02fa45acfc38332
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-01-27 12:40:14 +00:00
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
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
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
39f44cf57c QmlDesigner: Fix expressions in DynamicPropertyRow and states
* 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>
2022-09-16 15:04:29 +00:00
Thomas Hartmann
3ce5af7a79 QmlDesigner: Remove dangling PropertyChanges and KeyFrameGroups
This removes dangling PropertyChanges and KeyFrameGroups when removing
a dynamic property.

Change-Id: I333b6a61bec34a0bcde1d19372166b3cfaea195b
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2022-09-15 10:38:40 +00:00
Thomas Hartmann
26a2afea01 QmlDesigner: Sort dynamic properties by name
Change-Id: I303904872982c0464f1853320f6b47f68c9181de
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2022-09-15 09:42:51 +00:00
Thomas Hartmann
ff95787887 QmlDesigner: Use "This is a string" as default for string
Change-Id: I3d4d6e3dc32e5589e519fdadab0ae0996f7ae21e
Reviewed-by: Mats Honkamaa <mats.honkamaa@qt.io>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-09-15 09:42:38 +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
Thomas Hartmann
45fb37abe7 QmlDesigner: Use null instead of 0 for Item
Change-Id: Ifd6f06642308a981f7c50604ac1f1db56eabc261
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2022-09-09 09:23:26 +00:00
Miikka Heikkinen
a9576256b8 QmlDesigner: Fix crashes if selected node is invalidated
Change-Id: Ie85e9b023bca0dccd9c032e0d32e1462d0e77857
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-09-08 07:51:27 +00:00
Thomas Hartmann
4c91ed496a QmlDesigner: Add dynamic properties to property editor
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>
2022-09-06 12:40:50 +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
Eike Ziller
90a03391d7 Merge remote-tracking branch 'origin/8.0'
Change-Id: I37a1f78caf9ae258c6b052efa3be15b3dbcbe164
2022-07-12 13:56:23 +02:00
Thomas Hartmann
35db14897a QmlDesigner: Fix crash
Change-Id: Ie2d2b2226c576997af3e86c79ea8f9cb0cf66964
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-07-11 13:24:59 +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
Thomas Hartmann
8953be1d3f QmlDesigner: Add transaction to deleteDynamicPropertyByRow()
Change-Id: Iebbd127ba43698b82e7f7124c5b929e406687f22
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-07-11 09:02:40 +00:00
Eike Ziller
10163afae0 Merge remote-tracking branch 'origin/8.0'
Conflicts:
	share/qtcreator/translations/qtcreator_ja.ts

Change-Id: I436b8f60971f11a5fb7962a57600ad075135f397
2022-07-08 10:21:30 +02:00
Thomas Hartmann
6f0d2e6565 QmlDesigner: Add unusedProperty() as public member
Change-Id: If24e0d09145f0bb9e5459cae1b13302610818913
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-07-08 07:22:06 +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
Artem Sokolovskii
427c26d900 QmlDesigner: Remove foreach / Q_FOREACH usage in componentcore
Task-number: QTCREATORBUG-27464
Change-Id: I89d78d131a11b84b592d3d10577fe1ea4c7a6b4c
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-05-13 09:31:05 +00:00
Christian Kandeler
9cbcbfff33 Fix various clang warnings
Unused variables & functions, unneeded copies in range-for loops,
missing overrides.

Change-Id: I27b60e7c92a6ca425a84c89b537d5c3815449a94
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-12-08 15:39:20 +00:00
Thomas Hartmann
83036eff4c QmlDesigner: Add more trace points
Change-Id: I618e027785676de8492cd698f109579abb9b053a
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2020-11-20 11:19:45 +00:00
Christian Kandeler
7aec256087 QmlDesigner & friends: Fix various new warnings
Change-Id: Ia5e3d47e70e1881e70652f090ccc61543535df4e
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-11-18 17:05:51 +00:00
Thomas Hartmann
b9cc9c9bfa QmlDesigner: Fix crash
We have to check if the view is actually detached.

Change-Id: I160c1a15f921092ef66999ed6a27ffcdbbe205d9
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-10-05 17:27:45 +00:00
Thomas Hartmann
fe7d928f3b QmlDesigner: Do not keep separate selection state
When nodes are deleted the selection can changes without a notifier.
There is no reason to keep the selection separately.

Change-Id: I166d3695762e3d5cd6ff4808586384fd26bafef4
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2020-10-05 09:37:11 +00:00
Aleksei German
e9e1e797c7 QmlDesigner: Support aliases in Connection View
- Allows user to select aliases in connections view
 - Seeks signals for aliases

Task: QDS-2411

Change-Id: I69eb875eb99cbf8cd6a842d5f7e166d9990bb255
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-07-02 14:47:48 +00:00
Aleksei German
507019ef93 QmlDesigner: Add Binding Editor to Views
- Binding Editor support for Binding Properties View
 - Binding Editor support for Dynamic Properties View
 - Small fix for Binding Editor comboboxes
Task: QDS-2164

Change-Id: I94da14ea97a16d40c5da0b21ff0e6f315f9e84a4
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-06-12 14:03:48 +00:00
Knud Dollereder
376c6b9d59 Add curve editor
Moved qmldesignerextension into component

Updated build systems

Change-Id: I8d2d0757a1639a472d426b66c0c8ae6fb84cc3d2
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2019-06-19 09:22:31 +00:00