QmlDesigner: use initializer lists

Change-Id: Ibdc46d30ad3f2b703d4cbdd796a1032030bd17cd
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Tim Jenssen
2017-04-26 14:32:02 +02:00
parent 5ca34bd3f3
commit 0de18abbc2
22 changed files with 55 additions and 54 deletions

View File

@@ -139,7 +139,7 @@ static ComponentTextModifier *createComponentTextModifier(TextModifier *original
bool DesignDocument::loadInFileComponent(const ModelNode &componentNode)
{
QString componentText = rewriterView()->extractText(QList<ModelNode>() << componentNode).value(componentNode);
QString componentText = rewriterView()->extractText({componentNode}).value(componentNode);
if (componentText.isEmpty())
return false;
@@ -383,7 +383,7 @@ void DesignDocument::copySelected()
{
QScopedPointer<Model> copyModel(Model::create("QtQuick.Rectangle", 1, 0, currentModel()));
copyModel->setFileUrl(currentModel()->fileUrl());
copyModel->changeImports(currentModel()->imports(), QList<Import>());
copyModel->changeImports(currentModel()->imports(), {});
Q_ASSERT(copyModel);
@@ -480,7 +480,7 @@ void DesignDocument::paste()
{
QScopedPointer<Model> pasteModel(Model::create("empty", 1, 0, currentModel()));
pasteModel->setFileUrl(currentModel()->fileUrl());
pasteModel->changeImports(currentModel()->imports(), QList<Import>());
pasteModel->changeImports(currentModel()->imports(), {});
Q_ASSERT(pasteModel);
@@ -575,7 +575,7 @@ void DesignDocument::paste()
transaction.commit();
NodeMetaInfo::clearCache();
view.setSelectedModelNodes(QList<ModelNode>() << pastedNode);
view.setSelectedModelNodes({pastedNode});
transaction.commit();
} catch (const RewritingException &e) {
qWarning() << e.description(); //silent error