diff options
Diffstat (limited to 'src/plugins/qmldesigner/components')
19 files changed, 67 insertions, 67 deletions
diff --git a/src/plugins/qmldesigner/components/componentcore/crumblebar.cpp b/src/plugins/qmldesigner/components/componentcore/crumblebar.cpp index 56d4548183..5f5eaa6d4a 100644 --- a/src/plugins/qmldesigner/components/componentcore/crumblebar.cpp +++ b/src/plugins/qmldesigner/components/componentcore/crumblebar.cpp @@ -107,7 +107,7 @@ void CrumbleBar::pushFile(const QString &fileName) CrumbleBarInfo crumbleBarInfo; crumbleBarInfo.fileName = fileName; - crumblePath()->pushElement(fileName.split("/").last(), QVariant::fromValue(crumbleBarInfo)); + crumblePath()->pushElement(fileName.split(QLatin1String("/")).last(), QVariant::fromValue(crumbleBarInfo)); m_isInternalCalled = false; @@ -176,7 +176,7 @@ void CrumbleBar::onCrumblePathElementClicked(const QVariant &data) m_isInternalCalled = true; if (!clickedCrumbleBarInfo.modelNode.isValid() - && clickedCrumbleBarInfo.fileName == currentDesignDocument()->fileName().fileName()) { + && Utils::FileName::fromString(clickedCrumbleBarInfo.fileName) == currentDesignDocument()->fileName()) { nextFileIsCalledInternally(); currentDesignDocument()->changeToDocumentModel(); QmlDesignerPlugin::instance()->viewManager().setComponentViewToMaster(); diff --git a/src/plugins/qmldesigner/components/formeditor/abstractformeditortool.cpp b/src/plugins/qmldesigner/components/formeditor/abstractformeditortool.cpp index dbb32b748e..f26db72e57 100644 --- a/src/plugins/qmldesigner/components/formeditor/abstractformeditortool.cpp +++ b/src/plugins/qmldesigner/components/formeditor/abstractformeditortool.cpp @@ -206,8 +206,8 @@ void AbstractFormEditorTool::dropEvent(const QList<QGraphicsItem*> &/*itemList*/ void AbstractFormEditorTool::dragEnterEvent(const QList<QGraphicsItem*> &itemList, QGraphicsSceneDragDropEvent *event) { - if (event->mimeData()->hasFormat("application/vnd.bauhaus.itemlibraryinfo") || - event->mimeData()->hasFormat("application/vnd.bauhaus.libraryresource")) { + if (event->mimeData()->hasFormat(QLatin1String("application/vnd.bauhaus.itemlibraryinfo")) || + event->mimeData()->hasFormat(QLatin1String("application/vnd.bauhaus.libraryresource"))) { event->accept(); view()->changeToDragTool(); view()->currentTool()->dragEnterEvent(itemList, event); diff --git a/src/plugins/qmldesigner/components/formeditor/formeditorwidget.cpp b/src/plugins/qmldesigner/components/formeditor/formeditorwidget.cpp index 752a677c2d..2926612972 100644 --- a/src/plugins/qmldesigner/components/formeditor/formeditorwidget.cpp +++ b/src/plugins/qmldesigner/components/formeditor/formeditorwidget.cpp @@ -51,7 +51,7 @@ FormEditorWidget::FormEditorWidget(FormEditorView *view) : QWidget(), m_formEditorView(view) { - setStyleSheet(QString::fromUtf8(Utils::FileReader::fetchQrc(":/qmldesigner/formeditorstylesheet.css"))); + setStyleSheet(QString::fromUtf8(Utils::FileReader::fetchQrc(QLatin1String(":/qmldesigner/formeditorstylesheet.css")))); QVBoxLayout *fillLayout = new QVBoxLayout(this); fillLayout->setMargin(0); @@ -70,21 +70,21 @@ FormEditorWidget::FormEditorWidget(FormEditorView *view) m_noSnappingAction->setShortcutContext(Qt::WidgetWithChildrenShortcut); m_noSnappingAction->setCheckable(true); m_noSnappingAction->setChecked(true); - m_noSnappingAction->setIcon(QPixmap(":/icon/layout/no_snapping.png")); + m_noSnappingAction->setIcon(QPixmap(QLatin1String(":/icon/layout/no_snapping.png"))); m_snappingAndAnchoringAction = layoutActionGroup->addAction(tr("Snap to parent or sibling items and generate anchors (W).")); m_snappingAndAnchoringAction->setShortcut(Qt::Key_W); m_snappingAndAnchoringAction->setShortcutContext(Qt::WidgetWithChildrenShortcut); m_snappingAndAnchoringAction->setCheckable(true); m_snappingAndAnchoringAction->setChecked(true); - m_snappingAndAnchoringAction->setIcon(QPixmap(":/icon/layout/snapping_and_anchoring.png")); + m_snappingAndAnchoringAction->setIcon(QPixmap(QLatin1String(":/icon/layout/snapping_and_anchoring.png"))); m_snappingAction = layoutActionGroup->addAction(tr("Snap to parent or sibling items but do not generate anchors (E).")); m_snappingAction->setShortcut(Qt::Key_E); m_snappingAction->setShortcutContext(Qt::WidgetWithChildrenShortcut); m_snappingAction->setCheckable(true); m_snappingAction->setChecked(true); - m_snappingAction->setIcon(QPixmap(":/icon/layout/snapping.png")); + m_snappingAction->setIcon(QPixmap(QLatin1String(":/icon/layout/snapping.png"))); addActions(layoutActionGroup->actions()); @@ -100,7 +100,7 @@ FormEditorWidget::FormEditorWidget(FormEditorView *view) m_showBoundingRectAction->setShortcutContext(Qt::WidgetWithChildrenShortcut); m_showBoundingRectAction->setCheckable(true); m_showBoundingRectAction->setChecked(true); - m_showBoundingRectAction->setIcon(QPixmap(":/icon/layout/boundingrect.png")); + m_showBoundingRectAction->setIcon(QPixmap(QLatin1String(":/icon/layout/boundingrect.png"))); addAction(m_showBoundingRectAction.data()); upperActions.append(m_showBoundingRectAction.data()); @@ -139,7 +139,7 @@ FormEditorWidget::FormEditorWidget(FormEditorView *view) m_resetAction = new QAction(tr("Reset view (R)."), this); m_resetAction->setShortcut(Qt::Key_R); m_resetAction->setShortcutContext(Qt::WidgetWithChildrenShortcut); - m_resetAction->setIcon(QPixmap(":/icon/reset.png")); + m_resetAction->setIcon(QPixmap(QLatin1String(":/icon/reset.png"))); connect(m_resetAction.data(), SIGNAL(triggered(bool)), this, SLOT(resetNodeInstanceView())); addAction(m_resetAction.data()); upperActions.append(m_resetAction.data()); @@ -148,7 +148,7 @@ FormEditorWidget::FormEditorWidget(FormEditorView *view) m_graphicsView = new FormEditorGraphicsView(this); fillLayout->addWidget(m_graphicsView.data()); - m_graphicsView.data()->setStyleSheet(QString::fromUtf8(Utils::FileReader::fetchQrc(":/qmldesigner/scrollbar.css"))); + m_graphicsView.data()->setStyleSheet(QString::fromUtf8(Utils::FileReader::fetchQrc(QLatin1String(":/qmldesigner/scrollbar.css")))); } void FormEditorWidget::changeTransformTool(bool checked) diff --git a/src/plugins/qmldesigner/components/formeditor/toolbox.cpp b/src/plugins/qmldesigner/components/formeditor/toolbox.cpp index 2b2da15b6d..8993dcec57 100644 --- a/src/plugins/qmldesigner/components/formeditor/toolbox.cpp +++ b/src/plugins/qmldesigner/components/formeditor/toolbox.cpp @@ -39,8 +39,8 @@ namespace QmlDesigner { ToolBox::ToolBox(QWidget *parentWidget) : Utils::StyledBar(parentWidget), - m_leftToolBar(new QToolBar("LeftSidebar", this)), - m_rightToolBar(new QToolBar("RightSidebar", this)) + m_leftToolBar(new QToolBar(QLatin1String("LeftSidebar"), this)), + m_rightToolBar(new QToolBar(QLatin1String("RightSidebar"), this)) { setMaximumHeight(22); m_leftToolBar->setFloatable(true); diff --git a/src/plugins/qmldesigner/components/importmanager/importlabel.cpp b/src/plugins/qmldesigner/components/importmanager/importlabel.cpp index bfae9a3631..11ea76c72a 100644 --- a/src/plugins/qmldesigner/components/importmanager/importlabel.cpp +++ b/src/plugins/qmldesigner/components/importmanager/importlabel.cpp @@ -45,7 +45,7 @@ ImportLabel::ImportLabel(QWidget *parent) : m_removeButton = new QPushButton(this); - m_removeButton->setIcon(QIcon(Core::Constants::ICON_BUTTON_CLOSE)); + m_removeButton->setIcon(QIcon(QLatin1String(Core::Constants::ICON_BUTTON_CLOSE))); m_removeButton->setFlat(true); m_removeButton->setMaximumWidth(20); m_removeButton->setMaximumHeight(20); @@ -79,7 +79,7 @@ void ImportLabel::setReadOnly(bool readOnly) const if (readOnly) m_removeButton->setIcon(QIcon()); else - m_removeButton->setIcon(QIcon(Core::Constants::ICON_BUTTON_CLOSE)); + m_removeButton->setIcon(QIcon(QLatin1String(Core::Constants::ICON_BUTTON_CLOSE))); } void ImportLabel::emitRemoveImport() diff --git a/src/plugins/qmldesigner/components/importmanager/importmanagercombobox.cpp b/src/plugins/qmldesigner/components/importmanager/importmanagercombobox.cpp index d33f112cb0..cf1317b9ec 100644 --- a/src/plugins/qmldesigner/components/importmanager/importmanagercombobox.cpp +++ b/src/plugins/qmldesigner/components/importmanager/importmanagercombobox.cpp @@ -37,7 +37,7 @@ ImportManagerComboBox::ImportManagerComboBox(QWidget *parent) : QComboBox(parent) { - setStyleSheet(QString::fromUtf8(Utils::FileReader::fetchQrc(":/importmanager/importmanager.css"))); + setStyleSheet(QString::fromUtf8(Utils::FileReader::fetchQrc(QLatin1String(":/importmanager/importmanager.css")))); setToolTip(tr("Add new import")); } diff --git a/src/plugins/qmldesigner/components/importmanager/importmanagerview.cpp b/src/plugins/qmldesigner/components/importmanager/importmanagerview.cpp index 7f90ed709e..bf22d3030b 100644 --- a/src/plugins/qmldesigner/components/importmanager/importmanagerview.cpp +++ b/src/plugins/qmldesigner/components/importmanager/importmanagerview.cpp @@ -64,7 +64,7 @@ WidgetInfo ImportManagerView::widgetInfo() m_importsWidget->setImports(model()->imports()); } - return createWidgetInfo(m_importsWidget, 0, "ImportManager", WidgetInfo::LeftPane, 1); + return createWidgetInfo(m_importsWidget, 0, QLatin1String("ImportManager"), WidgetInfo::LeftPane, 1); } void ImportManagerView::modelAttached(Model *model) diff --git a/src/plugins/qmldesigner/components/integration/componentview.cpp b/src/plugins/qmldesigner/components/integration/componentview.cpp index 2bdd710c21..ecba31484c 100644 --- a/src/plugins/qmldesigner/components/integration/componentview.cpp +++ b/src/plugins/qmldesigner/components/integration/componentview.cpp @@ -118,7 +118,7 @@ bool ComponentView::hasEntryForNode(const ModelNode &node) const void ComponentView::addMasterDocument() { if (!hasMasterEntry()) { - QStandardItem *item = new QStandardItem("master"); + QStandardItem *item = new QStandardItem(QLatin1String("master")); item->setData(QVariant::fromValue(0), ModelNodeRole); item->setEditable(false); m_standardItemModel->appendRow(item); @@ -140,11 +140,11 @@ QString ComponentView::descriptionForNode(const ModelNode &node) const ModelNode parentNode = node.parentProperty().parentModelNode(); if (parentNode.id().isEmpty()) - description = parentNode.simplifiedTypeName() + QLatin1Char(' '); + description = QString::fromLatin1(parentNode.simplifiedTypeName()) + QLatin1Char(' '); else description = parentNode.id() + QLatin1Char(' '); - description += node.parentProperty().name(); + description += QString::fromLatin1(node.parentProperty().name()); } return description; diff --git a/src/plugins/qmldesigner/components/integration/designdocument.cpp b/src/plugins/qmldesigner/components/integration/designdocument.cpp index 27a7e76842..7ffbc4243c 100644 --- a/src/plugins/qmldesigner/components/integration/designdocument.cpp +++ b/src/plugins/qmldesigner/components/integration/designdocument.cpp @@ -120,7 +120,7 @@ static ComponentTextModifier *createComponentTextModifier(TextModifier *original const QString &componentText, const ModelNode &componentNode) { - bool explicitComponent = componentText.contains("Component"); + bool explicitComponent = componentText.contains(QLatin1String("Component")); ModelNode rootModelNode = rewriterView->rootModelNode(); @@ -406,7 +406,7 @@ void DesignDocument::copySelected() node.destroy(); } view.changeRootNodeType("QtQuick.Rectangle", 1, 0); - view.rootModelNode().setIdWithRefactoring("designer__Selection"); + view.rootModelNode().setIdWithRefactoring(QLatin1String("designer__Selection")); foreach (const ModelNode &selectedNode, selectedNodes) { ModelNode newNode(view.insertModel(selectedNode)); @@ -477,7 +477,7 @@ void DesignDocument::paste() if (rootNode.type() == "empty") return; - if (rootNode.id() == "designer__Selection") { + if (rootNode.id() == QLatin1String("designer__Selection")) { QList<ModelNode> selectedNodes = rootNode.directSubModelNodes(); pasteModel->detachView(&view); currentModel()->attachView(&view); diff --git a/src/plugins/qmldesigner/components/integration/designdocumentview.cpp b/src/plugins/qmldesigner/components/integration/designdocumentview.cpp index 9217f90884..8dcc506860 100644 --- a/src/plugins/qmldesigner/components/integration/designdocumentview.cpp +++ b/src/plugins/qmldesigner/components/integration/designdocumentview.cpp @@ -52,14 +52,14 @@ DesignDocumentView::~DesignDocumentView() static QStringList arrayToStringList(const QByteArray &byteArray) { QString str(QString::fromUtf8(byteArray)); - return str.split('\n'); + return str.split(QLatin1Char('\n')); } static QByteArray stringListToArray(const QStringList &stringList) { QString str; foreach (const QString &subString, stringList) - str += subString + '\n'; + str += subString + QLatin1Char('\n'); return str.toUtf8(); } @@ -74,7 +74,7 @@ void DesignDocumentView::toClipboard() const foreach (const Import &import, model()->imports()) imports.append(import.toImportString()); - data->setData("QmlDesigner::imports", stringListToArray(imports)); + data->setData(QLatin1String("QmlDesigner::imports"), stringListToArray(imports)); clipboard->setMimeData(data); } @@ -82,7 +82,7 @@ void DesignDocumentView::fromClipboard() { QClipboard *clipboard = QApplication::clipboard(); fromText(clipboard->text()); - QStringList imports = arrayToStringList(clipboard->mimeData()->data("QmlDesigner::imports")); + QStringList imports = arrayToStringList(clipboard->mimeData()->data(QLatin1String("QmlDesigner::imports"))); // foreach (const QString &importString, imports) { // Import import(Import::createLibraryImport(); // model()->addImport(import); //### imports diff --git a/src/plugins/qmldesigner/components/integration/xuifiledialog.cpp b/src/plugins/qmldesigner/components/integration/xuifiledialog.cpp index d7399b12bc..55561a30aa 100644 --- a/src/plugins/qmldesigner/components/integration/xuifiledialog.cpp +++ b/src/plugins/qmldesigner/components/integration/xuifiledialog.cpp @@ -45,7 +45,7 @@ void XUIFileDialog::runOpenFileDialog(const QString& path, QWidget* parent, QObj dir = XUIFileDialog::defaultFolder(); QString caption = QCoreApplication::translate("QmlDesigner::XUIFileDialog", "Open File"); - QString fileName = QFileDialog::getOpenFileName(parent, caption, dir, XUIFileDialog::fileNameFilters().join(";;"), 0, QFileDialog::ReadOnly); + QString fileName = QFileDialog::getOpenFileName(parent, caption, dir, XUIFileDialog::fileNameFilters().join(QLatin1String(";;")), 0, QFileDialog::ReadOnly); QmlDesigner::Internal::SignalEmitter emitter; QObject::connect(&emitter, SIGNAL(fileNameSelected(QString)), receiver, member); @@ -67,7 +67,7 @@ void XUIFileDialog::runSaveFileDialog(const QString& path, QWidget* parent, QObj dialog->open(receiver, member); } else { QString caption = QCoreApplication::translate("QmlDesigner::XUIFileDialog", "Save File"); - QString fileName = QFileDialog::getSaveFileName(parent, caption, dir, XUIFileDialog::fileNameFilters().join(";;")); + QString fileName = QFileDialog::getSaveFileName(parent, caption, dir, XUIFileDialog::fileNameFilters().join(QLatin1String(";;"))); QmlDesigner::Internal::SignalEmitter emitter; QObject::connect(&emitter, SIGNAL(fileNameSelected(QString)), receiver, member); diff --git a/src/plugins/qmldesigner/components/itemlibrary/itemlibrarytreeview.cpp b/src/plugins/qmldesigner/components/itemlibrary/itemlibrarytreeview.cpp index 8f85fbd7cc..b9a7972d1a 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/itemlibrarytreeview.cpp +++ b/src/plugins/qmldesigner/components/itemlibrary/itemlibrarytreeview.cpp @@ -124,7 +124,7 @@ void ItemLibraryTreeView::startDrag(Qt::DropActions /* supportedActions */) QDrag *drag = new QDrag(this); drag->setPixmap(QIcon(pixmap).pixmap(128, 128)); QMimeData *mimeData = new QMimeData; - mimeData->setData("application/vnd.bauhaus.libraryresource", fileInfo.absoluteFilePath().toUtf8()); + mimeData->setData(QLatin1String("application/vnd.bauhaus.libraryresource"), fileInfo.absoluteFilePath().toUtf8()); drag->setMimeData(mimeData); drag->exec(); } @@ -155,7 +155,7 @@ void ItemLibraryTreeView::activateItem( const QModelIndex & /*index*/) QFileInfo fileInfo = fileSystemModel->fileInfo(selectedIndexes().front()); QPixmap pixmap(fileInfo.absoluteFilePath()); if (!pixmap.isNull()) { - name = "image^" + fileInfo.absoluteFilePath(); + name = QLatin1String("image^") + fileInfo.absoluteFilePath(); emit itemActivated(name); } } diff --git a/src/plugins/qmldesigner/components/itemlibrary/itemlibrarywidget.cpp b/src/plugins/qmldesigner/components/itemlibrary/itemlibrarywidget.cpp index 863bb6e859..19ae6d497d 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/itemlibrarywidget.cpp +++ b/src/plugins/qmldesigner/components/itemlibrary/itemlibrarywidget.cpp @@ -144,8 +144,8 @@ ItemLibraryWidget::ItemLibraryWidget(QWidget *parent) : setSearchFilter(QString()); /* style sheets */ - setStyleSheet(QString::fromUtf8(Utils::FileReader::fetchQrc(":/qmldesigner/stylesheet.css"))); - m_resourcesView->setStyleSheet(QString::fromUtf8(Utils::FileReader::fetchQrc(":/qmldesigner/scrollbar.css"))); + setStyleSheet(QString::fromUtf8(Utils::FileReader::fetchQrc(QLatin1String(":/qmldesigner/stylesheet.css")))); + m_resourcesView->setStyleSheet(QString::fromUtf8(Utils::FileReader::fetchQrc(QLatin1String(":/qmldesigner/scrollbar.css")))); m_qmlSourceUpdateShortcut = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_F5), this); connect(m_qmlSourceUpdateShortcut, SIGNAL(activated()), this, SLOT(reloadQmlSource())); @@ -180,7 +180,7 @@ void ItemLibraryWidget::updateImports() foreach (const Import &import, m_model->imports()) if (import.isLibraryImport()) imports << import.url(); - if (imports.contains("com.nokia.meego", Qt::CaseInsensitive)) + if (imports.contains(QLatin1String("com.nokia.meego"), Qt::CaseInsensitive)) filter = Meego; } @@ -232,11 +232,11 @@ void ItemLibraryWidget::setSearchFilter(const QString &searchFilter) m_itemViewQuickWidget->update(); } else { QStringList nameFilterList; - if (searchFilter.contains('.')) { - nameFilterList.append(QString("*%1*").arg(searchFilter)); + if (searchFilter.contains(QLatin1Char('.'))) { + nameFilterList.append(QString(QStringLiteral("*%1*")).arg(searchFilter)); } else { foreach (const QByteArray &extension, QImageReader::supportedImageFormats()) { - nameFilterList.append(QString("*%1*.%2").arg(searchFilter, QString::fromUtf8(extension))); + nameFilterList.append(QString(QStringLiteral("*%1*.%2")).arg(searchFilter, QString::fromUtf8(extension))); } } @@ -267,9 +267,9 @@ void ItemLibraryWidget::emitImportChecked() foreach (const Import &import, m_model->imports()) { if (import.isLibraryImport()) { - if (import.url().contains(QString("meego"), Qt::CaseInsensitive)) + if (import.url().contains(QLatin1String("meego"), Qt::CaseInsensitive)) meegoImport = true; - if (import.url().contains(QString("Qt"), Qt::CaseInsensitive) || import.url().contains(QString("QtQuick"), Qt::CaseInsensitive)) + if (import.url().contains(QLatin1String("Qt"), Qt::CaseInsensitive) || import.url().contains(QLatin1String("QtQuick"), Qt::CaseInsensitive)) qtOnlyImport = true; } } diff --git a/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp b/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp index c87d606c64..86b68ea5d9 100644 --- a/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp +++ b/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp @@ -138,9 +138,9 @@ Qt::DropActions NavigatorTreeModel::supportedDragActions() const QStringList NavigatorTreeModel::mimeTypes() const { QStringList types; - types.append("application/vnd.modelnode.list"); - types.append("application/vnd.bauhaus.itemlibraryinfo"); - types.append("application/vnd.bauhaus.libraryresource"); + types.append(QLatin1String("application/vnd.modelnode.list")); + types.append(QLatin1String("application/vnd.bauhaus.itemlibraryinfo")); + types.append(QLatin1String("application/vnd.bauhaus.libraryresource")); return types; } @@ -170,14 +170,14 @@ QMimeData *NavigatorTreeModel::mimeData(const QModelIndexList &modelIndexList) c QByteArray encodedModelNodeData = encodeModelNodes(modelIndexList); - mimeData->setData("application/vnd.modelnode.list", encodedModelNodeData); + mimeData->setData(QLatin1String("application/vnd.modelnode.list"), encodedModelNodeData); return mimeData; } static QList<ModelNode> modelNodesFromMimeData(const QMimeData *mineData, AbstractView *view) { - QByteArray encodedModelNodeData = mineData->data("application/vnd.modelnode.list"); + QByteArray encodedModelNodeData = mineData->data(QLatin1String("application/vnd.modelnode.list")); QDataStream modelNodeStream(&encodedModelNodeData, QIODevice::ReadOnly); QList<ModelNode> modelNodeList; @@ -245,11 +245,11 @@ bool NavigatorTreeModel::dropMimeData(const QMimeData *mimeData, return true; if (dropModelIndex.model() == this) { - if (mimeData->hasFormat("application/vnd.bauhaus.itemlibraryinfo")) { + if (mimeData->hasFormat(QLatin1String("application/vnd.bauhaus.itemlibraryinfo"))) { handleItemLibraryItemDrop(mimeData, rowNumber, dropModelIndex); - } else if (mimeData->hasFormat("application/vnd.bauhaus.libraryresource")) { + } else if (mimeData->hasFormat(QLatin1String("application/vnd.bauhaus.libraryresource"))) { handleItemLibraryImageDrop(mimeData, rowNumber, dropModelIndex); - } else if (mimeData->hasFormat("application/vnd.modelnode.list")) { + } else if (mimeData->hasFormat(QLatin1String("application/vnd.modelnode.list"))) { handleInternalDrop(mimeData, rowNumber, dropModelIndex); } } @@ -765,7 +765,7 @@ void NavigatorTreeModel::handleItemLibraryItemDrop(const QMimeData *mimeData, in bool foundTarget = computeTarget(rowModelIndex, this, &targetProperty, &targetRowNumber); if (foundTarget) { - ItemLibraryEntry itemLibraryEntry = itemLibraryEntryFromData(mimeData->data("application/vnd.bauhaus.itemlibraryinfo")); + ItemLibraryEntry itemLibraryEntry = itemLibraryEntryFromData(mimeData->data(QLatin1String("application/vnd.bauhaus.itemlibraryinfo"))); QmlItemNode newQmlItemNode = QmlItemNode::createQmlItemNode(m_view, itemLibraryEntry, QPointF(), targetProperty); if (newQmlItemNode.isValid() && targetProperty.isNodeListProperty()) { diff --git a/src/plugins/qmldesigner/components/navigator/navigatorwidget.cpp b/src/plugins/qmldesigner/components/navigator/navigatorwidget.cpp index f42bcf4cbf..67f2321943 100644 --- a/src/plugins/qmldesigner/components/navigator/navigatorwidget.cpp +++ b/src/plugins/qmldesigner/components/navigator/navigatorwidget.cpp @@ -63,8 +63,8 @@ NavigatorWidget::NavigatorWidget(NavigatorView *view) : setWindowTitle(tr("Navigator", "Title of navigator view")); - setStyleSheet(QString::fromUtf8(Utils::FileReader::fetchQrc(":/qmldesigner/stylesheet.css"))); - m_treeView->setStyleSheet(QString::fromUtf8(Utils::FileReader::fetchQrc(":/qmldesigner/scrollbar.css"))); + setStyleSheet(QString::fromUtf8(Utils::FileReader::fetchQrc(QLatin1String(":/qmldesigner/stylesheet.css")))); + m_treeView->setStyleSheet(QString::fromUtf8(Utils::FileReader::fetchQrc(QLatin1String(":/qmldesigner/scrollbar.css")))); } void NavigatorWidget::setTreeModel(QAbstractItemModel* model) diff --git a/src/plugins/qmldesigner/components/propertyeditor/fileresourcesmodel.cpp b/src/plugins/qmldesigner/components/propertyeditor/fileresourcesmodel.cpp index 265264c012..f1b4f23e4a 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/fileresourcesmodel.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/fileresourcesmodel.cpp @@ -41,7 +41,7 @@ static QString s_lastBrowserPath; FileResourcesModel::FileResourcesModel(QObject *parent) : - QObject(parent), m_filter("(*.*)"), m_lock(false) + QObject(parent), m_filter(QLatin1String("(*.*)")), m_lock(false) { } @@ -168,7 +168,7 @@ void FileResourcesModel::setupModel() dir = QFileInfo(m_path.toLocalFile()).dir(); - QStringList filterList = m_filter.split(' '); + QStringList filterList = m_filter.split(QLatin1Char(' ')); QDirIterator it(dir.absolutePath(), filterList, QDir::Files, QDirIterator::Subdirectories); while (it.hasNext()) { diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp index b1c848a1c6..565c3f7614 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp @@ -93,7 +93,7 @@ PropertyEditorQmlBackend::PropertyEditorQmlBackend(PropertyEditorView *propertyE m_view(new Quick2PropertyEditorView), m_propertyEditorTransaction(new PropertyEditorTransaction(propertyEditor)), m_dummyPropertyEditorValue(new PropertyEditorValue()), m_contextObject(new PropertyEditorContextObject()) { - Q_ASSERT(QFileInfo::exists(":/images/button_normal.png")); + Q_ASSERT(QFileInfo(QLatin1String(":/images/button_normal.png")).exists()); m_view->engine()->setOutputWarningsToStandardError( !qgetenv("QTCREATOR_QTQUICKDESIGNER_PROPERTYEDITOR_SHOW_WARNINGS").isEmpty()); @@ -295,22 +295,22 @@ void PropertyEditorQmlBackend::setup(const QmlObjectNode &qmlObjectNode, const Q // anchors m_backendAnchorBinding.setup(qmlObjectNode.modelNode()); - context()->setContextProperty("anchorBackend", &m_backendAnchorBinding); + context()->setContextProperty(QLatin1String("anchorBackend"), &m_backendAnchorBinding); - context()->setContextProperty("transaction", m_propertyEditorTransaction.data()); + context()->setContextProperty(QLatin1String("transaction"), m_propertyEditorTransaction.data()); // model node m_backendModelNode.setup(qmlObjectNode.modelNode()); - context()->setContextProperty("modelNodeBackend", &m_backendModelNode); + context()->setContextProperty(QLatin1String("modelNodeBackend"), &m_backendModelNode); contextObject()->setSpecificsUrl(qmlSpecificsFile); contextObject()->setStateName(stateName); if (!qmlObjectNode.isValid()) return; - context()->setContextProperty("propertyCount", QVariant(qmlObjectNode.modelNode().properties().count())); + context()->setContextProperty(QLatin1String("propertyCount"), QVariant(qmlObjectNode.modelNode().properties().count())); contextObject()->setIsBaseState(qmlObjectNode.isInBaseState()); contextObject()->setSelectionChanged(false); @@ -359,9 +359,9 @@ void PropertyEditorQmlBackend::initialSetup(const TypeName &typeName, const QUrl QObject::connect(valueObject, SIGNAL(valueChanged(QString,QVariant)), &m_backendValuesPropertyMap, SIGNAL(valueChanged(QString,QVariant))); m_backendValuesPropertyMap.insert("id", QVariant::fromValue(valueObject)); - context()->setContextProperty("anchorBackend", &m_backendAnchorBinding); - context()->setContextProperty("modelNodeBackend", &m_backendModelNode); - context()->setContextProperty("transaction", m_propertyEditorTransaction.data()); + context()->setContextProperty(QLatin1String("anchorBackend"), &m_backendAnchorBinding); + context()->setContextProperty(QLatin1String("modelNodeBackend"), &m_backendModelNode); + context()->setContextProperty(QLatin1String("transaction"), m_propertyEditorTransaction.data()); contextObject()->setSpecificsUrl(qmlSpecificsFile); @@ -520,7 +520,7 @@ QUrl PropertyEditorQmlBackend::getQmlUrlForModelNode(const ModelNode &modelNode, } } } - return fileToUrl(QDir(propertyEditorResourcesPath()).filePath("QtQuick/emptyPane.qml")); + return fileToUrl(QDir(propertyEditorResourcesPath()).filePath(QLatin1String("QtQuick/emptyPane.qml"))); } QString PropertyEditorQmlBackend::locateQmlFile(const NodeMetaInfo &info, const QString &relativePath) diff --git a/src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp b/src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp index daf3adff31..662a361152 100644 --- a/src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp +++ b/src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp @@ -138,15 +138,15 @@ void StatesEditorView::addState() QString newStateName; int index = 1; while (true) { - newStateName = QString("State%1").arg(index++); + newStateName = QString(QStringLiteral("State%1")).arg(index++); if (!modelStateNames.contains(newStateName)) break; } try { if ((rootStateGroup().allStates().count() < 1) && //QtQuick import might be missing - (!model()->hasImport(Import::createLibraryImport("QtQuick", "1.0"), true, true))) - model()->changeImports(QList<Import>() << Import::createLibraryImport("QtQuick", "1.0"), QList<Import>()); + (!model()->hasImport(Import::createLibraryImport(QLatin1String("QtQuick"), QLatin1String("1.0")), true, true))) + model()->changeImports(QList<Import>() << Import::createLibraryImport(QLatin1String("QtQuick"), QLatin1String("1.0")), QList<Import>()); ModelNode newState = rootStateGroup().addState(newStateName); setCurrentState(newState); } catch (const RewritingException &e) { @@ -176,7 +176,7 @@ void StatesEditorView::duplicateCurrentState() QString newName = state.name(); // Strip out numbers at the end of the string - QRegExp regEx(QString("[0-9]+$")); + QRegExp regEx(QLatin1String("[0-9]+$")); int numberIndex = newName.indexOf(regEx); if ((numberIndex != -1) && (numberIndex+regEx.matchedLength()==newName.length())) newName = newName.left(numberIndex); diff --git a/src/plugins/qmldesigner/components/stateseditor/stateseditorwidget.cpp b/src/plugins/qmldesigner/components/stateseditor/stateseditorwidget.cpp index ebe66a1267..b99831f9e1 100644 --- a/src/plugins/qmldesigner/components/stateseditor/stateseditorwidget.cpp +++ b/src/plugins/qmldesigner/components/stateseditor/stateseditorwidget.cpp @@ -76,7 +76,7 @@ void StatesEditorWidget::setNodeInstanceView(NodeInstanceView *nodeInstanceView) void StatesEditorWidget::showAddNewStatesButton(bool showAddNewStatesButton) { - rootContext()->setContextProperty("canAddNewStates", showAddNewStatesButton); + rootContext()->setContextProperty(QLatin1String("canAddNewStates"), showAddNewStatesButton); } StatesEditorWidget::StatesEditorWidget(StatesEditorView *statesEditorView, StatesEditorModel *statesEditorModel) @@ -101,7 +101,7 @@ StatesEditorWidget::StatesEditorWidget(StatesEditorView *statesEditorView, State rootContext()->setContextProperty(QStringLiteral("highlightColor"), Utils::StyleHelper::notTooBrightHighlightColor()); - rootContext()->setContextProperty("canAddNewStates", true); + rootContext()->setContextProperty(QLatin1String("canAddNewStates"), true); setWindowTitle(tr("States", "Title of Editor widget")); |