forked from qt-creator/qt-creator
QmlDesigner: Rename QmlDesigner::Utils to QmlDesigner::ModelUtils
Change-Id: Ie586482c49e84660cb725f4581fd9413e42f80a8 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
@@ -922,7 +922,7 @@ void Edit3DView::addQuick3DImport()
|
|||||||
{
|
{
|
||||||
DesignDocument *document = QmlDesignerPlugin::instance()->currentDesignDocument();
|
DesignDocument *document = QmlDesignerPlugin::instance()->currentDesignDocument();
|
||||||
if (document && !document->inFileComponentModelActive() && model()
|
if (document && !document->inFileComponentModelActive() && model()
|
||||||
&& Utils::addImportWithCheck(
|
&& ModelUtils::addImportWithCheck(
|
||||||
"QtQuick3D",
|
"QtQuick3D",
|
||||||
[](const Import &import) { return !import.hasVersion() || import.majorVersion() >= 6; },
|
[](const Import &import) { return !import.hasVersion() || import.majorVersion() >= 6; },
|
||||||
model())) {
|
model())) {
|
||||||
|
|||||||
@@ -709,7 +709,7 @@ void ItemLibraryAssetImporter::finalizeQuick3DImport()
|
|||||||
try {
|
try {
|
||||||
RewriterTransaction transaction = model->rewriterView()->beginRewriterTransaction(
|
RewriterTransaction transaction = model->rewriterView()->beginRewriterTransaction(
|
||||||
QByteArrayLiteral("ItemLibraryAssetImporter::finalizeQuick3DImport"));
|
QByteArrayLiteral("ItemLibraryAssetImporter::finalizeQuick3DImport"));
|
||||||
bool success = Utils::addImportsWithCheck(m_requiredImports, model);
|
bool success = ModelUtils::addImportsWithCheck(m_requiredImports, model);
|
||||||
if (!success)
|
if (!success)
|
||||||
addError(tr("Failed to insert import statement into qml document."));
|
addError(tr("Failed to insert import statement into qml document."));
|
||||||
transaction.commit();
|
transaction.commit();
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ bool ItemLibraryWidget::eventFilter(QObject *obj, QEvent *event)
|
|||||||
// For drag to be handled correctly, we must have the component properly imported
|
// For drag to be handled correctly, we must have the component properly imported
|
||||||
// beforehand, so we import the module immediately when the drag starts
|
// beforehand, so we import the module immediately when the drag starts
|
||||||
if (!entry.requiredImport().isEmpty()
|
if (!entry.requiredImport().isEmpty()
|
||||||
&& !Utils::addImportWithCheck(entry.requiredImport(), m_model)) {
|
&& !ModelUtils::addImportWithCheck(entry.requiredImport(), m_model)) {
|
||||||
qWarning() << __FUNCTION__ << "Required import adding failed:"
|
qWarning() << __FUNCTION__ << "Required import adding failed:"
|
||||||
<< entry.requiredImport();
|
<< entry.requiredImport();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -885,7 +885,7 @@ ModelNode NavigatorTreeModel::handleItemLibraryFontDrop(const QString &fontFamil
|
|||||||
|
|
||||||
void NavigatorTreeModel::addImport(const QString &importName)
|
void NavigatorTreeModel::addImport(const QString &importName)
|
||||||
{
|
{
|
||||||
if (!Utils::addImportWithCheck(importName, m_view->model()))
|
if (!ModelUtils::addImportWithCheck(importName, m_view->model()))
|
||||||
qWarning() << __FUNCTION__ << "Adding import failed:" << importName;
|
qWarning() << __FUNCTION__ << "Adding import failed:" << importName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
namespace QmlDesigner::Utils {
|
namespace QmlDesigner::ModelUtils {
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
@@ -102,4 +102,4 @@ PropertyMetaInfo metainfo(const ModelNode &node, const PropertyName &propertyNam
|
|||||||
return node.metaInfo().property(propertyName);
|
return node.metaInfo().property(propertyName);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace QmlDesigner::Utils
|
} // namespace QmlDesigner::ModelUtils
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ namespace QmlDesigner {
|
|||||||
class PropertyMetaInfo;
|
class PropertyMetaInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace QmlDesigner::Utils {
|
namespace QmlDesigner::ModelUtils {
|
||||||
|
|
||||||
QMLDESIGNERCORE_EXPORT bool addImportsWithCheck(const QStringList &importNames,
|
QMLDESIGNERCORE_EXPORT bool addImportsWithCheck(const QStringList &importNames,
|
||||||
const std::function<bool(const Import &)> &predicate,
|
const std::function<bool(const Import &)> &predicate,
|
||||||
@@ -29,4 +29,4 @@ QMLDESIGNERCORE_EXPORT PropertyMetaInfo metainfo(const AbstractProperty &propert
|
|||||||
QMLDESIGNERCORE_EXPORT PropertyMetaInfo metainfo(const ModelNode &node,
|
QMLDESIGNERCORE_EXPORT PropertyMetaInfo metainfo(const ModelNode &node,
|
||||||
const PropertyName &propertyName);
|
const PropertyName &propertyName);
|
||||||
|
|
||||||
} // namespace QmlDesigner::Utils
|
} // namespace QmlDesigner::ModelUtils
|
||||||
|
|||||||
Reference in New Issue
Block a user