forked from qt-creator/qt-creator
QmlDesigner: Create DataStore on demand
Task-number: QDS-11708 Change-Id: Ie08ab6260a1b720640c2c85f4b49b8093ec622d8 Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
This commit is contained in:
@@ -382,22 +382,6 @@
|
||||
{
|
||||
"source": "../shared-plugin/name/designer/plugin.metainfo",
|
||||
"target": "%{ProjectDirectory}/imports/%{ImportModuleName}/designer/plugin.metainfo"
|
||||
},
|
||||
{
|
||||
"source": "../shared-plugin/name/JsonData.qml.tpl",
|
||||
"target": "%{ProjectDirectory}/imports/%{ImportModuleName}/JsonData.qml"
|
||||
},
|
||||
{
|
||||
"source": "../shared-plugin/name/DataStore.qml.tpl",
|
||||
"target": "%{ProjectDirectory}/imports/%{ImportModuleName}/DataStore.qml"
|
||||
},
|
||||
{
|
||||
"source": "../shared-plugin/name/models.json.tpl",
|
||||
"target": "%{ProjectDirectory}/imports/%{ImportModuleName}/models.json"
|
||||
},
|
||||
{
|
||||
"source": "../shared-plugin/name/data.json.tpl",
|
||||
"target": "%{ProjectDirectory}/imports/%{ImportModuleName}/data.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -395,22 +395,6 @@
|
||||
{
|
||||
"source": "../shared-plugin/name/designer/plugin.metainfo",
|
||||
"target": "%{ProjectDirectory}/imports/%{ImportModuleName}/designer/plugin.metainfo"
|
||||
},
|
||||
{
|
||||
"source": "../shared-plugin/name/JsonData.qml.tpl",
|
||||
"target": "%{ProjectDirectory}/imports/%{ImportModuleName}/JsonData.qml"
|
||||
},
|
||||
{
|
||||
"source": "../shared-plugin/name/DataStore.qml.tpl",
|
||||
"target": "%{ProjectDirectory}/imports/%{ImportModuleName}/DataStore.qml"
|
||||
},
|
||||
{
|
||||
"source": "../shared-plugin/name/models.json.tpl",
|
||||
"target": "%{ProjectDirectory}/imports/%{ImportModuleName}/models.json"
|
||||
},
|
||||
{
|
||||
"source": "../shared-plugin/name/data.json.tpl",
|
||||
"target": "%{ProjectDirectory}/imports/%{ImportModuleName}/data.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -382,22 +382,6 @@
|
||||
{
|
||||
"source": "../shared-plugin/name/designer/plugin.metainfo",
|
||||
"target": "%{ProjectDirectory}/imports/%{ImportModuleName}/designer/plugin.metainfo"
|
||||
},
|
||||
{
|
||||
"source": "../shared-plugin/name/JsonData.qml.tpl",
|
||||
"target": "%{ProjectDirectory}/imports/%{ImportModuleName}/JsonData.qml"
|
||||
},
|
||||
{
|
||||
"source": "../shared-plugin/name/DataStore.qml.tpl",
|
||||
"target": "%{ProjectDirectory}/imports/%{ImportModuleName}/DataStore.qml"
|
||||
},
|
||||
{
|
||||
"source": "../shared-plugin/name/models.json.tpl",
|
||||
"target": "%{ProjectDirectory}/imports/%{ImportModuleName}/models.json"
|
||||
},
|
||||
{
|
||||
"source": "../shared-plugin/name/data.json.tpl",
|
||||
"target": "%{ProjectDirectory}/imports/%{ImportModuleName}/data.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -341,22 +341,6 @@
|
||||
{
|
||||
"source": "../shared-plugin/name/designer/plugin.metainfo",
|
||||
"target": "%{ProjectDirectory}/imports/%{ImportModuleName}/designer/plugin.metainfo"
|
||||
},
|
||||
{
|
||||
"source": "../shared-plugin/name/JsonData.qml.tpl",
|
||||
"target": "%{ProjectDirectory}/imports/%{ImportModuleName}/JsonData.qml"
|
||||
},
|
||||
{
|
||||
"source": "../shared-plugin/name/DataStore.qml.tpl",
|
||||
"target": "%{ProjectDirectory}/imports/%{ImportModuleName}/DataStore.qml"
|
||||
},
|
||||
{
|
||||
"source": "../shared-plugin/name/models.json.tpl",
|
||||
"target": "%{ProjectDirectory}/imports/%{ImportModuleName}/models.json"
|
||||
},
|
||||
{
|
||||
"source": "../shared-plugin/name/data.json.tpl",
|
||||
"target": "%{ProjectDirectory}/imports/%{ImportModuleName}/data.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -343,22 +343,6 @@
|
||||
{
|
||||
"source": "../shared-plugin/name/designer/plugin.metainfo",
|
||||
"target": "%{ProjectDirectory}/imports/%{ImportModuleName}/designer/plugin.metainfo"
|
||||
},
|
||||
{
|
||||
"source": "../shared-plugin/name/JsonData.qml.tpl",
|
||||
"target": "%{ProjectDirectory}/imports/%{ImportModuleName}/JsonData.qml"
|
||||
},
|
||||
{
|
||||
"source": "../shared-plugin/name/DataStore.qml.tpl",
|
||||
"target": "%{ProjectDirectory}/imports/%{ImportModuleName}/DataStore.qml"
|
||||
},
|
||||
{
|
||||
"source": "../shared-plugin/name/models.json.tpl",
|
||||
"target": "%{ProjectDirectory}/imports/%{ImportModuleName}/models.json"
|
||||
},
|
||||
{
|
||||
"source": "../shared-plugin/name/data.json.tpl",
|
||||
"target": "%{ProjectDirectory}/imports/%{ImportModuleName}/data.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -343,22 +343,6 @@
|
||||
{
|
||||
"source": "../shared-plugin/name/designer/plugin.metainfo",
|
||||
"target": "%{ProjectDirectory}/imports/%{ImportModuleName}/designer/plugin.metainfo"
|
||||
},
|
||||
{
|
||||
"source": "../shared-plugin/name/JsonData.qml.tpl",
|
||||
"target": "%{ProjectDirectory}/imports/%{ImportModuleName}/JsonData.qml"
|
||||
},
|
||||
{
|
||||
"source": "../shared-plugin/name/DataStore.qml.tpl",
|
||||
"target": "%{ProjectDirectory}/imports/%{ImportModuleName}/DataStore.qml"
|
||||
},
|
||||
{
|
||||
"source": "../shared-plugin/name/models.json.tpl",
|
||||
"target": "%{ProjectDirectory}/imports/%{ImportModuleName}/models.json"
|
||||
},
|
||||
{
|
||||
"source": "../shared-plugin/name/data.json.tpl",
|
||||
"target": "%{ProjectDirectory}/imports/%{ImportModuleName}/data.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -13,12 +13,7 @@ qt6_add_qml_module(%{ImportModuleName}
|
||||
RESOURCE_PREFIX "/qt/qml"
|
||||
QML_FILES
|
||||
Constants.qml
|
||||
DataStore.qml
|
||||
DirectoryFontLoader.qml
|
||||
EventListModel.qml
|
||||
EventListSimulator.qml
|
||||
JsonData.qml
|
||||
RESOURCES
|
||||
data.json
|
||||
models.json
|
||||
)
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
Module %{ImportModuleName}
|
||||
singleton DataStore 1.0 DataStore.qml
|
||||
singleton Constants 1.0 Constants.qml
|
||||
EventListSimulator 1.0 EventListSimulator.qml
|
||||
EventListModel 1.0 EventListModel.qml
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
singleton Constants 1.0 Constants.qml
|
||||
singleton DataStore 1.0 DataStore.qml
|
||||
EventListModel 1.0 EventListModel.qml
|
||||
EventListSimulator 1.0 EventListSimulator.qml
|
||||
DirectoryFontLoader 1.0 DirectoryFontLoader.qml
|
||||
|
||||
@@ -261,22 +261,6 @@
|
||||
"source": "%{QdsWizardPath}/shared-plugin/name/designer/plugin.metainfo",
|
||||
"target": "%{ProjectDirectory}/imports/%{ImportModuleName}/designer/plugin.metainfo",
|
||||
"condition": "%{QdsProjectStyle}"
|
||||
},
|
||||
{
|
||||
"source": "../shared-plugin/name/JsonData.qml.tpl",
|
||||
"target": "%{ProjectDirectory}/imports/%{ImportModuleName}/JsonData.qml"
|
||||
},
|
||||
{
|
||||
"source": "../shared-plugin/name/DataStore.qml.tpl",
|
||||
"target": "%{ProjectDirectory}/imports/%{ImportModuleName}/DataStore.qml"
|
||||
},
|
||||
{
|
||||
"source": "../shared-plugin/name/models.json.tpl",
|
||||
"target": "%{ProjectDirectory}/imports/%{ImportModuleName}/models.json"
|
||||
},
|
||||
{
|
||||
"source": "../shared-plugin/name/data.json.tpl",
|
||||
"target": "%{ProjectDirectory}/imports/%{ImportModuleName}/data.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -7,14 +7,14 @@
|
||||
#include "nodemetainfo.h"
|
||||
#include "propertymetainfo.h"
|
||||
|
||||
#include <variant>
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
#include <projectexplorer/projectmanager.h>
|
||||
#include <qmljs/qmljsmodelmanagerinterface.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <variant>
|
||||
|
||||
#include <QColor>
|
||||
#include <QJsonArray>
|
||||
@@ -290,6 +290,12 @@ bool ensureDataStoreExists(bool &justCreated)
|
||||
|
||||
if (qmlDirSaver.finalize()) {
|
||||
justCreated = true;
|
||||
|
||||
// Force code model reset to notice changes to existing module
|
||||
auto modelManager = QmlJS::ModelManagerInterface::instance();
|
||||
if (modelManager)
|
||||
modelManager->resetCodeModel();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user