diff options
author | Ali Kianian <ali.kianian@qt.io> | 2024-04-11 12:59:18 +0300 |
---|---|---|
committer | Ali Kianian <ali.kianian@qt.io> | 2024-04-17 12:02:35 +0000 |
commit | f006cfb233f03c85f32530ec287d3608764d2666 (patch) | |
tree | 83042b2e08a6e4872009f5d114644e5810ea366f /share/qtcreator | |
parent | 6f7e38d64d97ca3967f6e2e2bd4638e0e77e0fee (diff) |
QmlDesigner: Warn the user if the project is not imported
When the project is not importd in the design document, DataStore cannot
be found by the project manager. User should add it to make the Model
Editor work. So we will warn the user in the Model Editor view.
Task-number: QDS-12119
Change-Id: I313e5553e8b0a0ef3b97c50d61db80c0a8d382f8
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Diffstat (limited to 'share/qtcreator')
-rw-r--r-- | share/qtcreator/qmldesigner/collectionEditorQmlSource/CollectionDetailsView.qml | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/share/qtcreator/qmldesigner/collectionEditorQmlSource/CollectionDetailsView.qml b/share/qtcreator/qmldesigner/collectionEditorQmlSource/CollectionDetailsView.qml index e3f1a58959..e40a3c9457 100644 --- a/share/qtcreator/qmldesigner/collectionEditorQmlSource/CollectionDetailsView.qml +++ b/share/qtcreator/qmldesigner/collectionEditorQmlSource/CollectionDetailsView.qml @@ -498,10 +498,38 @@ Rectangle { } } + ColumnLayout { + id: importsProblem + + visible: !topRow.visible && rootView.dataStoreExists && !rootView.projectImportExists + width: parent.width + anchors.verticalCenter: parent.verticalCenter + clip: true + + Text { + text: qsTr("Import the project to your design document to make the Model Editor enabled.") + Layout.alignment: Qt.AlignCenter + Layout.maximumWidth: parent.width + leftPadding: StudioTheme.Values.collectionItemTextPadding + rightPadding: StudioTheme.Values.collectionItemTextPadding + color: StudioTheme.Values.themeTextColor + font.pixelSize: StudioTheme.Values.mediumFontSize + wrapMode: Text.Wrap + } + + HelperWidgets.Button { + text: qsTr("Enable DataStore (This will add the required import)") + Layout.alignment: Qt.AlignCenter + onClicked: rootView.addProjectImport() + leftPadding: StudioTheme.Values.collectionItemTextPadding + rightPadding: StudioTheme.Values.collectionItemTextPadding + } + } + Text { anchors.centerIn: parent text: qsTr("There are no models in this project.\nAdd or import a model.") - visible: !topRow.visible + visible: !topRow.visible && !importsProblem.visible color: StudioTheme.Values.themeTextColor font.pixelSize: StudioTheme.Values.mediumFontSize } |