Commit 4743217e authored by Marco Bubke's avatar Marco Bubke

QmlDesigner: Exchange QLatin1String with QStringLiteral

Change-Id: Iaefe0ea33ee17795cb402da33e4e7f0da747d4d5
Reviewed-by: default avatarTim Jenssen <tim.jenssen@digia.com>
parent c7b1ae1e
......@@ -249,7 +249,7 @@ bool selectionCanBeLayouted(const SelectionContext &context)
bool hasQtQuickLayoutImport(const SelectionContext &context)
{
if (context.view() && context.view()->model()) {
Import import = Import::createLibraryImport(QLatin1String("QtQuick.Layouts"), QLatin1String("1.0"));
Import import = Import::createLibraryImport(QStringLiteral("QtQuick.Layouts"), QStringLiteral("1.0"));
return context.view()->model()->hasImport(import, true, true);
}
......
......@@ -144,11 +144,11 @@ static ModelNode findTabViewModelNode(const ModelNode &currentModelNode)
void TabViewDesignerAction::addNewTab()
{
QString tabName = AddTabToTabViewDialog::create(QLatin1String("Tab"), Core::ICore::mainWindow());
QString tabName = AddTabToTabViewDialog::create(QStringLiteral("Tab"), Core::ICore::mainWindow());
if (!tabName.isEmpty()) {
QString directoryPath = QFileInfo(selectionContext().view()->model()->fileUrl().toLocalFile()).absolutePath();
QString newFilePath = directoryPath +QLatin1String("/") + tabName + QLatin1String(".qml");
QString newFilePath = directoryPath +QStringLiteral("/") + tabName + QStringLiteral(".qml");
if (QFileInfo(newFilePath).exists()) {
QMessageBox::warning(Core::ICore::mainWindow(), tr("Naming Error"), tr("Component already exists."));
......@@ -161,7 +161,7 @@ void TabViewDesignerAction::addNewTab()
ModelNode tabViewModelNode = findTabViewModelNode(selectionContext().currentSingleSelectedNode());
PropertyListType propertyList;
propertyList.append(QPair<PropertyName, QVariant>("source", QString(tabName + QLatin1String(".qml"))));
propertyList.append(QPair<PropertyName, QVariant>("source", QString(tabName + QStringLiteral(".qml"))));
propertyList.append(QPair<PropertyName, QVariant>("title", tabName));
ModelNode newTabModelNode = selectionContext().view()->createModelNode("QtQuick.Controls.Tab",
......
......@@ -38,7 +38,7 @@
#include <variantproperty.h>
namespace {
const QLatin1String lineBreak = QLatin1String("<br>");
const QString lineBreak = QStringLiteral("<br>");
bool isDebugViewEnabled()
{
......@@ -204,9 +204,9 @@ void DebugView::rootNodeTypeChanged(const QString &type, int majorVersion, int m
if (isDebugViewEnabled()) {
QString message;
message += type;
message += QLatin1String(" ");
message += QStringLiteral(" ");
message += QString::number(majorVersion);
message += QLatin1String(" ");
message += QStringLiteral(" ");
message += QString::number(minorVersion);
log(tr("Node id changed:"), message);
}
......@@ -263,7 +263,7 @@ void DebugView::rewriterEndTransaction()
WidgetInfo DebugView::widgetInfo()
{
return createWidgetInfo(m_debugViewWidget.data(), 0, QLatin1String("DebugView"), WidgetInfo::LeftPane, 0, tr("Debug View"));
return createWidgetInfo(m_debugViewWidget.data(), 0, QStringLiteral("DebugView"), WidgetInfo::LeftPane, 0, tr("Debug View"));
}
bool DebugView::hasWidget() const
......
......@@ -46,24 +46,24 @@ DebugViewWidget::DebugViewWidget(QWidget *parent) : QWidget(parent)
void DebugViewWidget::addLogMessage(const QString &topic, const QString &message, bool highlight)
{
if (highlight) {
m_ui.modelLog->appendHtml(QLatin1String("<b><font color=\"blue\">")
m_ui.modelLog->appendHtml(QStringLiteral("<b><font color=\"blue\">")
+ topic
+ QLatin1String("</b><br>")
+ QStringLiteral("</b><br>")
+ message);
} else {
m_ui.modelLog->appendHtml(QLatin1String("<b>")
m_ui.modelLog->appendHtml(QStringLiteral("<b>")
+ topic
+ QLatin1String("</b><br>")
+ QStringLiteral("</b><br>")
+ message);
}
}
void DebugViewWidget::addErrorMessage(const QString &topic, const QString &message)
{
m_ui.instanceErrorLog->appendHtml(QLatin1String("<b><font color=\"red\">")
m_ui.instanceErrorLog->appendHtml(QStringLiteral("<b><font color=\"red\">")
+ topic
+ QLatin1String("</font></b><br>")
+ QStringLiteral("</font></b><br>")
+ message
);
}
......@@ -71,15 +71,15 @@ void DebugViewWidget::addErrorMessage(const QString &topic, const QString &messa
void DebugViewWidget::addLogInstanceMessage(const QString &topic, const QString &message, bool highlight)
{
if (highlight) {
m_ui.instanceLog->appendHtml(QLatin1String("<b><font color=\"blue\">")
m_ui.instanceLog->appendHtml(QStringLiteral("<b><font color=\"blue\">")
+ topic
+ QLatin1String("</b><br>")
+ QStringLiteral("</b><br>")
+ message);
} else {
m_ui.instanceLog->appendHtml(QLatin1String("<b>")
m_ui.instanceLog->appendHtml(QStringLiteral("<b>")
+ topic
+ QLatin1String("</b><br>")
+ QStringLiteral("</b><br>")
+ message);
}
}
......
......@@ -49,7 +49,7 @@ FormEditorWidget::FormEditorWidget(FormEditorView *view)
: QWidget(),
m_formEditorView(view)
{
setStyleSheet(QLatin1String(Utils::FileReader::fetchQrc(":/qmldesigner/formeditorstylesheet.css")));
setStyleSheet(QString::fromUtf8(Utils::FileReader::fetchQrc(":/qmldesigner/formeditorstylesheet.css")));
QVBoxLayout *fillLayout = new QVBoxLayout(this);
fillLayout->setMargin(0);
......@@ -146,7 +146,7 @@ FormEditorWidget::FormEditorWidget(FormEditorView *view)
m_graphicsView = new FormEditorGraphicsView(this);
fillLayout->addWidget(m_graphicsView.data());
m_graphicsView.data()->setStyleSheet(QLatin1String(Utils::FileReader::fetchQrc(":/qmldesigner/scrollbar.css")));
m_graphicsView.data()->setStyleSheet(QString::fromUtf8(Utils::FileReader::fetchQrc(":/qmldesigner/scrollbar.css")));
}
void FormEditorWidget::changeTransformTool(bool checked)
......@@ -179,7 +179,7 @@ void FormEditorWidget::changeRootItemHeight(const QString &heighText)
void FormEditorWidget::resetNodeInstanceView()
{
m_formEditorView->setCurrentStateNode(m_formEditorView->rootModelNode());
m_formEditorView->emitCustomNotification(QLatin1String("reset QmlPuppet"));
m_formEditorView->emitCustomNotification(QStringLiteral("reset QmlPuppet"));
}
void FormEditorWidget::wheelEvent(QWheelEvent *event)
......
......@@ -36,7 +36,7 @@
ImportManagerComboBox::ImportManagerComboBox(QWidget *parent) :
QComboBox(parent)
{
setStyleSheet(QLatin1String(Utils::FileReader::fetchQrc(":/importmanager/importmanager.css")));
setStyleSheet(QString::fromUtf8(Utils::FileReader::fetchQrc(":/importmanager/importmanager.css")));
setToolTip(tr("Add new import"));
}
......
......@@ -178,12 +178,12 @@ QString DesignDocumentView::toText() const
QString imports;
foreach (const Import &import, model()->imports()) {
if (import.isFileImport())
imports += QLatin1String("import ") + QLatin1String("\"") + import.file() + QLatin1String("\"")+ QLatin1String(";\n");
imports += QStringLiteral("import ") + QStringLiteral("\"") + import.file() + QStringLiteral("\"")+ QStringLiteral(";\n");
else
imports += QLatin1String("import ") + import.url() + QLatin1String(" ") + import.version() + QLatin1String(";\n");
imports += QStringLiteral("import ") + import.url() + QStringLiteral(" ") + import.version() + QStringLiteral(";\n");
}
textEdit.setPlainText(imports + QLatin1String("Item {\n}\n"));
textEdit.setPlainText(imports + QStringLiteral("Item {\n}\n"));
NotIndentingTextEditModifier modifier(&textEdit);
QScopedPointer<RewriterView> rewriterView(new RewriterView(RewriterView::Amend, 0));
......@@ -208,7 +208,7 @@ void DesignDocumentView::fromText(QString text)
QPlainTextEdit textEdit;
QString imports;
foreach (const Import &import, model()->imports())
imports += QLatin1String("import ") + import.toString(true) + QLatin1Char(';') + QLatin1Char('\n');
imports += QStringLiteral("import ") + import.toString(true) + QLatin1Char(';') + QLatin1Char('\n');
textEdit.setPlainText(imports + text);
NotIndentingTextEditModifier modifier(&textEdit);
......
......@@ -276,7 +276,7 @@ QString ItemLibraryItemModel::itemName() const
QString ItemLibraryItemModel::itemLibraryIconPath() const
{
//Prepend image provider prefix
return QLatin1String("image://qmldesigner_itemlibrary/")+ m_iconPath;
return QStringLiteral("image://qmldesigner_itemlibrary/")+ m_iconPath;
}
QVariant ItemLibraryItemModel::sortingRole() const
......@@ -325,8 +325,8 @@ bool ItemLibrarySectionModel::sectionExpanded() const
QVariant ItemLibrarySectionModel::sortingRole() const
{
if (sectionName() == QLatin1String("QML Components")) //Qml Components always come first
return QVariant(QLatin1String("AA.this_comes_first"));
if (sectionName() == QStringLiteral("QML Components")) //Qml Components always come first
return QVariant(QStringLiteral("AA.this_comes_first"));
return sectionName();
}
......@@ -532,7 +532,7 @@ void ItemLibraryModel::update(ItemLibraryInfo *itemLibraryInfo, Model *model)
// delayed creation of (default) icons
if (entry.iconPath().isEmpty())
entry.setIconPath(QLatin1String(":/ItemLibrary/images/item-default-icon.png"));
entry.setIconPath(QStringLiteral(":/ItemLibrary/images/item-default-icon.png"));
if (entry.dragIcon().isNull())
entry.setDragIcon(createDragPixmap(getWidth(entry), getHeight(entry)));
......@@ -560,7 +560,7 @@ QMimeData *ItemLibraryModel::getMimeData(int libId)
QByteArray data;
QDataStream stream(&data, QIODevice::WriteOnly);
stream << m_itemInfos.value(libId);
mimeData->setData(QLatin1String("application/vnd.bauhaus.itemlibraryinfo"), data);
mimeData->setData(QStringLiteral("application/vnd.bauhaus.itemlibraryinfo"), data);
const QIcon icon = m_itemInfos.value(libId).dragIcon();
if (!icon.isNull()) {
......@@ -569,7 +569,7 @@ QMimeData *ItemLibraryModel::getMimeData(int libId)
mimeData->setImageData(icon.pixmap(sizes.front()).toImage());
}
mimeData->removeFormat(QLatin1String("text/plain"));
mimeData->removeFormat(QStringLiteral("text/plain"));
return mimeData;
}
......
......@@ -61,7 +61,7 @@ WidgetInfo ItemLibraryView::widgetInfo()
return createWidgetInfo(m_widget.data(),
new WidgetInfo::ToolBarWidgetDefaultFactory<ItemLibraryWidget>(m_widget.data()),
QLatin1String("Library"),
QStringLiteral("Library"),
WidgetInfo::LeftPane,
0);
}
......
......@@ -79,14 +79,14 @@ ItemLibraryWidget::ItemLibraryWidget(QWidget *parent) :
m_itemLibraryModel->setItemIconSize(m_itemIconSize);
QQmlContext *rootContext = m_itemsView->rootContext();
rootContext->setContextProperty(QLatin1String("itemLibraryModel"), m_itemLibraryModel.data());
rootContext->setContextProperty(QLatin1String("itemLibraryIconWidth"), m_itemIconSize.width());
rootContext->setContextProperty(QLatin1String("itemLibraryIconHeight"), m_itemIconSize.height());
rootContext->setContextProperty(QStringLiteral("itemLibraryModel"), m_itemLibraryModel.data());
rootContext->setContextProperty(QStringLiteral("itemLibraryIconWidth"), m_itemIconSize.width());
rootContext->setContextProperty(QStringLiteral("itemLibraryIconHeight"), m_itemIconSize.height());
QColor highlightColor = palette().highlight().color();
if (0.5*highlightColor.saturationF()+0.75-highlightColor.valueF() < 0)
highlightColor.setHsvF(highlightColor.hsvHueF(),0.1 + highlightColor.saturationF()*2.0, highlightColor.valueF());
m_itemsView->rootContext()->setContextProperty(QLatin1String("highlightColor"), highlightColor);
m_itemsView->rootContext()->setContextProperty(QStringLiteral("highlightColor"), highlightColor);
// loading the qml has to come after all needed context properties are set
m_itemsView->setSource(QUrl("qrc:/ItemLibrary/qml/ItemsView.qml"));
......@@ -104,7 +104,7 @@ ItemLibraryWidget::ItemLibraryWidget(QWidget *parent) :
m_resourcesView->setIconSize(m_resIconSize);
/* create image provider for loading item icons */
m_itemsView->engine()->addImageProvider(QLatin1String("qmldesigner_itemlibrary"), new Internal::ItemLibraryImageProvider);
m_itemsView->engine()->addImageProvider(QStringLiteral("qmldesigner_itemlibrary"), new Internal::ItemLibraryImageProvider);
/* other widgets */
QTabBar *tabBar = new QTabBar(this);
......@@ -116,14 +116,14 @@ ItemLibraryWidget::ItemLibraryWidget(QWidget *parent) :
connect(tabBar, SIGNAL(currentChanged(int)), this, SLOT(updateSearch()));
m_filterLineEdit = new Utils::FancyLineEdit(this);
m_filterLineEdit->setObjectName(QLatin1String("itemLibrarySearchInput"));
m_filterLineEdit->setObjectName(QStringLiteral("itemLibrarySearchInput"));
m_filterLineEdit->setPlaceholderText(tr("<Filter>", "Library search input hint text"));
m_filterLineEdit->setDragEnabled(false);
m_filterLineEdit->setMinimumWidth(75);
m_filterLineEdit->setTextMargins(0, 0, 20, 0);
m_filterLineEdit->setFiltering(true);
QWidget *lineEditFrame = new QWidget(this);
lineEditFrame->setObjectName(QLatin1String("itemLibrarySearchInputFrame"));
lineEditFrame->setObjectName(QStringLiteral("itemLibrarySearchInputFrame"));
QGridLayout *lineEditLayout = new QGridLayout(lineEditFrame);
lineEditLayout->setMargin(2);
lineEditLayout->setSpacing(0);
......@@ -139,7 +139,7 @@ ItemLibraryWidget::ItemLibraryWidget(QWidget *parent) :
m_stackedWidget->addWidget(m_resourcesView.data());
QWidget *spacer = new QWidget(this);
spacer->setObjectName(QLatin1String("itemLibrarySearchInputSpacer"));
spacer->setObjectName(QStringLiteral("itemLibrarySearchInputSpacer"));
spacer->setFixedHeight(4);
QGridLayout *layout = new QGridLayout(this);
......@@ -154,8 +154,8 @@ ItemLibraryWidget::ItemLibraryWidget(QWidget *parent) :
setSearchFilter(QString());
/* style sheets */
setStyleSheet(QLatin1String(Utils::FileReader::fetchQrc(":/qmldesigner/stylesheet.css")));
m_resourcesView->setStyleSheet(QLatin1String(Utils::FileReader::fetchQrc(":/qmldesigner/scrollbar.css")));
setStyleSheet(QString::fromUtf8(Utils::FileReader::fetchQrc(":/qmldesigner/stylesheet.css")));
m_resourcesView->setStyleSheet(QString::fromUtf8(Utils::FileReader::fetchQrc(":/qmldesigner/scrollbar.css")));
}
void ItemLibraryWidget::setItemLibraryInfo(ItemLibraryInfo *itemLibraryInfo)
......@@ -316,9 +316,9 @@ void ItemLibraryWidget::setImportFilter(FilterChangeFlag flag)
try {
block = true;
if (flag == QtBasic)
removeImport(QLatin1String("com.nokia.meego"));
removeImport(QStringLiteral("com.nokia.meego"));
else if (flag == Meego)
addImport(QLatin1String("com.nokia.meego"), QLatin1String("1.0"));
addImport(QStringLiteral("com.nokia.meego"), QStringLiteral("1.0"));
QApplication::restoreOverrideCursor();
block = false;
m_filterFlag = flag;
......
......@@ -121,12 +121,12 @@ static QIcon getIcon(const ModelNode &modelNode)
if (!itemLibraryEntryList.isEmpty())
return itemLibraryEntryList.first().icon();
else if (modelNode.metaInfo().isValid())
return QIcon(QLatin1String(":/ItemLibrary/images/item-default-icon.png"));
return QIcon(QStringLiteral(":/ItemLibrary/images/item-default-icon.png"));
else
return QIcon(QLatin1String(":/ItemLibrary/images/item-invalid-icon.png"));
return QIcon(QStringLiteral(":/ItemLibrary/images/item-invalid-icon.png"));
}
return QIcon(QLatin1String(":/ItemLibrary/images/item-invalid-icon.png"));
return QIcon(QStringLiteral(":/ItemLibrary/images/item-invalid-icon.png"));
}
static int drawIcon(QPainter *painter,
......
......@@ -113,7 +113,7 @@ WidgetInfo NavigatorView::widgetInfo()
{
return createWidgetInfo(m_widget.data(),
new WidgetInfo::ToolBarWidgetDefaultFactory<NavigatorWidget>(m_widget.data()),
QLatin1String("Navigator"),
QStringLiteral("Navigator"),
WidgetInfo::LeftPane,
0);
}
......
......@@ -62,9 +62,8 @@ NavigatorWidget::NavigatorWidget(NavigatorView *view) :
setWindowTitle(tr("Navigator", "Title of navigator view"));
setStyleSheet(QLatin1String(Utils::FileReader::fetchQrc(":/qmldesigner/stylesheet.css")));
m_treeView->setStyleSheet(
QLatin1String(Utils::FileReader::fetchQrc(":/qmldesigner/scrollbar.css")));
setStyleSheet(QString::fromUtf8(Utils::FileReader::fetchQrc(":/qmldesigner/stylesheet.css")));
m_treeView->setStyleSheet(QString::fromUtf8(Utils::FileReader::fetchQrc(":/qmldesigner/scrollbar.css")));
}
void NavigatorWidget::setTreeModel(QAbstractItemModel* model)
......
......@@ -44,7 +44,7 @@ QVariant DesignerPropertyMap::value(const QString &key) const
void DesignerPropertyMap::registerDeclarativeType(const QString &name)
{
qmlRegisterType<DesignerPropertyMap>("Bauhaus",1,0,name.toLatin1());
qmlRegisterType<DesignerPropertyMap>("Bauhaus",1,0,name.toUtf8());
}
} //QmlDesigner
......
......@@ -124,7 +124,7 @@ void FileResourcesModel::openFileDialog()
//If that one is not valid we try the path for the current file
if (path.isEmpty() && !m_fileName.isEmpty())
path = QFileInfo(modelPath + QLatin1String("/") + m_fileName.toString()).absoluteDir().absolutePath();
path = QFileInfo(modelPath + QStringLiteral("/") + m_fileName.toString()).absoluteDir().absolutePath();
//Next we try to fall back to the path any file browser was opened with
......
......@@ -107,7 +107,7 @@ QQmlComponent *PropertyEditorContextObject::specificQmlComponent()
m_qmlComponent = new QQmlComponent(m_qmlContext->engine(), this);
m_qmlComponent->setData(m_specificQmlData.toLatin1(), QUrl::fromLocalFile("specfics.qml"));
m_qmlComponent->setData(m_specificQmlData.toUtf8(), QUrl::fromLocalFile(QStringLiteral("specfics.qml")));
return m_qmlComponent;
}
......
......@@ -55,14 +55,14 @@ static QmlJS::SimpleReaderNode::Ptr s_templateConfiguration = QmlJS::SimpleReade
static inline QString propertyTemplatesPath()
{
return QmlDesigner::PropertyEditorQmlBackend::propertyEditorResourcesPath() + QLatin1String("/PropertyTemplates/");
return QmlDesigner::PropertyEditorQmlBackend::propertyEditorResourcesPath() + QStringLiteral("/PropertyTemplates/");
}
QmlJS::SimpleReaderNode::Ptr templateConfiguration()
{
if (!s_templateConfiguration) {
QmlJS::SimpleReader reader;
const QString fileName = propertyTemplatesPath() + QLatin1String("TemplateTypes.qml");
const QString fileName = propertyTemplatesPath() + QStringLiteral("TemplateTypes.qml");
s_templateConfiguration = reader.readFile(fileName);
if (!s_templateConfiguration)
......@@ -308,11 +308,11 @@ void PropertyEditorQmlBackend::initialSetup(const TypeName &typeName, const QUrl
contextObject()->setSpecificsUrl(qmlSpecificsFile);
contextObject()->setStateName(QLatin1String("basestate"));
contextObject()->setStateName(QStringLiteral("basestate"));
contextObject()->setIsBaseState(true);
contextObject()->setSpecificQmlData(QLatin1String(""));
contextObject()->setSpecificQmlData(QStringLiteral(""));
contextObject()->setGlobalBaseUrl(QUrl());
}
......@@ -328,12 +328,12 @@ QString PropertyEditorQmlBackend::templateGeneration(NodeMetaInfo type,
if (!templateConfiguration() || !templateConfiguration()->isValid())
return QString();
QStringList imports = variantToStringList(templateConfiguration()->property(QLatin1String("imports")));
QStringList imports = variantToStringList(templateConfiguration()->property(QStringLiteral("imports")));
QString qmlTemplate = imports.join(QLatin1String("\n")) + QLatin1Char('\n');
qmlTemplate += QLatin1String("Section {\n");
QString qmlTemplate = imports.join(QStringLiteral("\n")) + QLatin1Char('\n');
qmlTemplate += QStringLiteral("Section {\n");
qmlTemplate += QStringLiteral("caption: \"%1\"\n").arg(QString::fromUtf8(objectNode.modelNode().simplifiedTypeName()));
qmlTemplate += QLatin1String("SectionLayout {\n");
qmlTemplate += QStringLiteral("SectionLayout {\n");
QList<PropertyName> orderedList = type.propertyNames();
qSort(orderedList);
......@@ -350,13 +350,13 @@ QString PropertyEditorQmlBackend::templateGeneration(NodeMetaInfo type,
QString typeName = type.propertyTypeName(name);
//alias resolution only possible with instance
if (typeName == QLatin1String("alias") && objectNode.isValid())
if (typeName == QStringLiteral("alias") && objectNode.isValid())
typeName = objectNode.instanceType(name);
if (!superType.hasProperty(name) && type.propertyIsWritable(name) && !name.contains(".")) {
foreach (const QmlJS::SimpleReaderNode::Ptr &node, templateConfiguration()->children())
if (variantToStringList(node->property(QLatin1String("typeNames"))).contains(typeName)) {
const QString fileName = propertyTemplatesPath() + node->property(QLatin1String("sourceFile")).toString();
if (variantToStringList(node->property(QStringLiteral("typeNames"))).contains(typeName)) {
const QString fileName = propertyTemplatesPath() + node->property(QStringLiteral("sourceFile")).toString();
QFile file(fileName);
if (file.open(QIODevice::ReadOnly)) {
QString source = file.readAll();
......@@ -369,8 +369,8 @@ QString PropertyEditorQmlBackend::templateGeneration(NodeMetaInfo type,
}
}
}
qmlTemplate += QLatin1String("}\n"); //Section
qmlTemplate += QLatin1String("}\n"); //SectionLayout
qmlTemplate += QStringLiteral("}\n"); //Section
qmlTemplate += QStringLiteral("}\n"); //SectionLayout
if (emptyTemplate)
return QString();
......@@ -380,7 +380,7 @@ QString PropertyEditorQmlBackend::templateGeneration(NodeMetaInfo type,
QUrl PropertyEditorQmlBackend::getQmlFileUrl(const QString &relativeTypeName, const NodeMetaInfo &info)
{
return fileToUrl(locateQmlFile(info, fixTypeNameForPanes(relativeTypeName) + QLatin1String(".qml")));
return fileToUrl(locateQmlFile(info, fixTypeNameForPanes(relativeTypeName) + QStringLiteral(".qml")));
}
QString PropertyEditorQmlBackend::fixTypeNameForPanes(const QString &typeName)
......@@ -395,7 +395,7 @@ QString PropertyEditorQmlBackend::qmlFileName(const NodeMetaInfo &nodeInfo)
if (nodeInfo.typeName().split('.').last() == "QDeclarativeItem")
return "QtQuick/ItemPane.qml";
const QString fixedTypeName = fixTypeNameForPanes(nodeInfo.typeName());
return fixedTypeName + QLatin1String("Pane.qml");
return fixedTypeName + QStringLiteral("Pane.qml");
}
QUrl PropertyEditorQmlBackend::fileToUrl(const QString &filePath) {
......@@ -418,9 +418,9 @@ QUrl PropertyEditorQmlBackend::fileToUrl(const QString &filePath) {
QString PropertyEditorQmlBackend::fileFromUrl(const QUrl &url)
{
if (url.scheme() == QLatin1String("qrc")) {
if (url.scheme() == QStringLiteral("qrc")) {
const QString &path = url.path();
return QLatin1String(":") + path;
return QStringLiteral(":") + path;
}
return url.toLocalFile();
......@@ -456,16 +456,16 @@ QString PropertyEditorQmlBackend::locateQmlFile(const NodeMetaInfo &info, const
static QDir resourcesDir(QStringLiteral(":/propertyEditorQmlSources"));
QDir importDir(info.importDirectoryPath() + QLatin1String(Constants::QML_DESIGNER_SUBFOLDER));
const QString versionString = QLatin1String("_") + QString::number(info.majorVersion())
+ QLatin1String("_")
const QString versionString = QStringLiteral("_") + QString::number(info.majorVersion())
+ QStringLiteral("_")
+ QString::number(info.minorVersion());
QString relativePathWithoutEnding = relativePath;
relativePathWithoutEnding.chop(4);
const QString relativePathWithVersion = relativePathWithoutEnding + versionString + QLatin1String(".qml");
const QString relativePathWithVersion = relativePathWithoutEnding + versionString + QStringLiteral(".qml");
//Check for qml files with versions first
const QString withoutDirWithVersion = relativePathWithVersion.split(QLatin1String("/")).last();
const QString withoutDirWithVersion = relativePathWithVersion.split(QStringLiteral("/")).last();
if (importDir.exists(relativePathWithVersion))
return importDir.absoluteFilePath(relativePathWithVersion);
if (importDir.exists(withoutDirWithVersion)) //Since we are in a subfolder of the import we do not require the directory
......@@ -475,7 +475,7 @@ QString PropertyEditorQmlBackend::locateQmlFile(const NodeMetaInfo &info, const
if (resourcesDir.exists(relativePathWithVersion))
return resourcesDir.absoluteFilePath(relativePathWithVersion);
const QString withoutDir = relativePath.split(QLatin1String("/")).last();
const QString withoutDir = relativePath.split(QStringLiteral("/")).last();
if (importDir.exists(relativePath))
return importDir.absoluteFilePath(relativePath);
if (importDir.exists(withoutDir)) //Since we are in a subfolder of the import we do not require the directory
......
......@@ -101,7 +101,7 @@ static void fixAmbigousColorNames(const QmlDesigner::ModelNode &modelNode, const
color = QColor(color.name());
color.setAlpha(alpha);
*value = color;
} else if (value->toString() != QLatin1String("transparent")) {
} else if (value->toString() != QStringLiteral("transparent")) {
*value = QColor(value->toString()).name();
}
}
......@@ -113,7 +113,7 @@ static void fixUrl(const QmlDesigner::ModelNode &modelNode, const QmlDesigner::P
&& (modelNode.metaInfo().propertyTypeName(name) == "QUrl"
|| modelNode.metaInfo().propertyTypeName(name) == "url")) {
if (!value->isValid())
*value = QString(QLatin1String(""));
*value = QStringLiteral("");
}
}
......
......@@ -83,7 +83,7 @@ PropertyEditorView::PropertyEditorView(QWidget *parent) :
connect(m_updateShortcut, SIGNAL(activated()), this, SLOT(reloadQml()));
m_stackedWidget->setStyleSheet(
QLatin1String(Utils::FileReader::fetchQrc(":/qmldesigner/stylesheet.css")));
QString::fromUtf8(Utils::FileReader::fetchQrc(QStringLiteral(":/qmldesigner/stylesheet.css"))));
m_stackedWidget->setMinimumWidth(320);
m_stackedWidget->move(0, 0);
connect(m_stackedWidget, SIGNAL(resized()), this, SLOT(updateSize()));
......@@ -103,7 +103,7 @@ void PropertyEditorView::setupPane(const TypeName &typeName)
{
NodeMetaInfo metaInfo = model()->metaInfo(typeName);
QUrl qmlFile = PropertyEditorQmlBackend::getQmlFileUrl(QLatin1String("Qt/ItemPane"), metaInfo);
QUrl qmlFile = PropertyEditorQmlBackend::getQmlFileUrl(QStringLiteral("Qt/ItemPane"), metaInfo);
QUrl qmlSpecificsFile;
qmlSpecificsFile = PropertyEditorQmlBackend::getQmlFileUrl(typeName + "Specifics", metaInfo);
......@@ -373,7 +373,7 @@ void PropertyEditorView::setupQmlBackend()
foreach (const NodeMetaInfo &metaInfo, hierarchy) {
if (PropertyEditorQmlBackend::checkIfUrlExists(qmlSpecificsFile))
break;
qmlSpecificsFile = PropertyEditorQmlBackend::getQmlFileUrl(metaInfo.typeName() + QLatin1String("Specifics"), metaInfo);
qmlSpecificsFile = PropertyEditorQmlBackend::getQmlFileUrl(metaInfo.typeName() + QStringLiteral("Specifics"), metaInfo);
diffClassName = metaInfo.typeName();
}
}
......@@ -388,7 +388,7 @@ void PropertyEditorView::setupQmlBackend()
PropertyEditorQmlBackend *currentQmlBackend = m_qmlBackendHash.value(qmlFile.toString());
QString currentStateName = currentState().isBaseState() ? currentState().name() : QLatin1String("invalid state");
QString currentStateName = currentState().isBaseState() ? currentState().name() : QStringLiteral("invalid state");
if (!currentQmlBackend) {
currentQmlBackend = new PropertyEditorQmlBackend(this);
......@@ -593,7 +593,7 @@ bool PropertyEditorView::hasWidget() const
WidgetInfo PropertyEditorView::widgetInfo()
{
return createWidgetInfo(m_stackedWidget, 0, QLatin1String("Properties"), WidgetInfo::RightPane, 0);
return createWidgetInfo(m_stackedWidget, 0, QStringLiteral("Properties"), WidgetInfo::RightPane, 0);
}