diff options
author | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2011-09-27 16:24:07 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-09-27 16:27:44 +0200 |
commit | f9a30a4021a93e84a0589733dbbd55196faa6ac4 (patch) | |
tree | 53cfe732521c147e042dcdad6cf49bfa767fbb9a /src | |
parent | 085dcbab9c2baa77f649e96db78fe2950001a4ca (diff) | |
download | qttools-f9a30a4021a93e84a0589733dbbd55196faa6ac4.tar.gz |
Designer: Fix string conversion warnings/introduce QStringLiteral.
on this occasion.
Change-Id: Ib80dfdf8aae162b02500293a83e3bc12941f7406
Reviewed-on: http://codereview.qt-project.org/5637
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Diffstat (limited to 'src')
120 files changed, 1202 insertions, 1206 deletions
diff --git a/src/designer/src/components/buddyeditor/buddyeditor.cpp b/src/designer/src/components/buddyeditor/buddyeditor.cpp index ed6cc3e42..ac9eb55d8 100644 --- a/src/designer/src/components/buddyeditor/buddyeditor.cpp +++ b/src/designer/src/components/buddyeditor/buddyeditor.cpp @@ -72,7 +72,7 @@ static bool canBeBuddy(QWidget *w, QDesignerFormWindowInterface *form) QExtensionManager *ext = form->core()->extensionManager(); if (QDesignerPropertySheetExtension *sheet = qt_extension<QDesignerPropertySheetExtension*>(ext, w)) { - const int index = sheet->indexOf(QLatin1String("focusPolicy")); + const int index = sheet->indexOf(QStringLiteral("focusPolicy")); if (index != -1) { bool ok = false; const Qt::FocusPolicy q = static_cast<Qt::FocusPolicy>(qdesigner_internal::Utils::valueOf(sheet->property(index), &ok)); diff --git a/src/designer/src/components/buddyeditor/buddyeditor_plugin.cpp b/src/designer/src/components/buddyeditor/buddyeditor_plugin.cpp index 64e2a7241..46f86eed8 100644 --- a/src/designer/src/components/buddyeditor/buddyeditor_plugin.cpp +++ b/src/designer/src/components/buddyeditor/buddyeditor_plugin.cpp @@ -71,9 +71,9 @@ void BuddyEditorPlugin::initialize(QDesignerFormEditorInterface *core) Q_ASSERT(!isInitialized()); m_action = new QAction(tr("Edit Buddies"), this); - m_action->setObjectName(QLatin1String("__qt_edit_buddies_action")); - QIcon buddyIcon = QIcon::fromTheme("designer-edit-buddy", - QIcon(core->resourceLocation() + QLatin1String("/buddytool.png"))); + m_action->setObjectName(QStringLiteral("__qt_edit_buddies_action")); + QIcon buddyIcon = QIcon::fromTheme(QStringLiteral("designer-edit-buddy"), + QIcon(core->resourceLocation() + QStringLiteral("/buddytool.png"))); m_action->setIcon(buddyIcon); m_action->setEnabled(false); diff --git a/src/designer/src/components/formeditor/formeditor.cpp b/src/designer/src/components/formeditor/formeditor.cpp index c0ea0b0db..fa202a3fd 100644 --- a/src/designer/src/components/formeditor/formeditor.cpp +++ b/src/designer/src/components/formeditor/formeditor.cpp @@ -139,7 +139,7 @@ FormEditor::FormEditor(QObject *parent) QTreeViewPropertySheetFactory::registerExtension(mgr); QTableViewPropertySheetFactory::registerExtension(mgr); - const QString internalTaskMenuId = QLatin1String("QDesignerInternalTaskMenuExtension"); + const QString internalTaskMenuId = QStringLiteral("QDesignerInternalTaskMenuExtension"); QDesignerTaskMenuFactory::registerExtension(mgr, internalTaskMenuId); mgr->registerExtensions(new QDesignerMemberSheetFactory(mgr), diff --git a/src/designer/src/components/formeditor/formwindow.cpp b/src/designer/src/components/formeditor/formwindow.cpp index a651e7880..83d4c0051 100644 --- a/src/designer/src/components/formeditor/formwindow.cpp +++ b/src/designer/src/components/formeditor/formwindow.cpp @@ -481,11 +481,11 @@ void FormWindow::setMainContainer(QWidget *w) manageWidget(m_mainContainer); if (QDesignerPropertySheetExtension *sheet = qt_extension<QDesignerPropertySheetExtension*>(core()->extensionManager(), m_mainContainer)) { - sheet->setVisible(sheet->indexOf(QLatin1String("windowTitle")), true); - sheet->setVisible(sheet->indexOf(QLatin1String("windowIcon")), true); - sheet->setVisible(sheet->indexOf(QLatin1String("windowModality")), true); - sheet->setVisible(sheet->indexOf(QLatin1String("windowOpacity")), true); - sheet->setVisible(sheet->indexOf(QLatin1String("windowFilePath")), true); + sheet->setVisible(sheet->indexOf(QStringLiteral("windowTitle")), true); + sheet->setVisible(sheet->indexOf(QStringLiteral("windowIcon")), true); + sheet->setVisible(sheet->indexOf(QStringLiteral("windowModality")), true); + sheet->setVisible(sheet->indexOf(QStringLiteral("windowOpacity")), true); + sheet->setVisible(sheet->indexOf(QStringLiteral("windowFilePath")), true); // ### generalize } @@ -1020,125 +1020,125 @@ static QSet<QString> languageKeywords() static QSet<QString> keywords; if (keywords.isEmpty()) { // C++ keywords - keywords.insert(QLatin1String("asm")); - keywords.insert(QLatin1String("auto")); - keywords.insert(QLatin1String("bool")); - keywords.insert(QLatin1String("break")); - keywords.insert(QLatin1String("case")); - keywords.insert(QLatin1String("catch")); - keywords.insert(QLatin1String("char")); - keywords.insert(QLatin1String("class")); - keywords.insert(QLatin1String("const")); - keywords.insert(QLatin1String("const_cast")); - keywords.insert(QLatin1String("continue")); - keywords.insert(QLatin1String("default")); - keywords.insert(QLatin1String("delete")); - keywords.insert(QLatin1String("do")); - keywords.insert(QLatin1String("double")); - keywords.insert(QLatin1String("dynamic_cast")); - keywords.insert(QLatin1String("else")); - keywords.insert(QLatin1String("enum")); - keywords.insert(QLatin1String("explicit")); - keywords.insert(QLatin1String("export")); - keywords.insert(QLatin1String("extern")); - keywords.insert(QLatin1String("false")); - keywords.insert(QLatin1String("float")); - keywords.insert(QLatin1String("for")); - keywords.insert(QLatin1String("friend")); - keywords.insert(QLatin1String("goto")); - keywords.insert(QLatin1String("if")); - keywords.insert(QLatin1String("inline")); - keywords.insert(QLatin1String("int")); - keywords.insert(QLatin1String("long")); - keywords.insert(QLatin1String("mutable")); - keywords.insert(QLatin1String("namespace")); - keywords.insert(QLatin1String("new")); - keywords.insert(QLatin1String("NULL")); - keywords.insert(QLatin1String("operator")); - keywords.insert(QLatin1String("private")); - keywords.insert(QLatin1String("protected")); - keywords.insert(QLatin1String("public")); - keywords.insert(QLatin1String("register")); - keywords.insert(QLatin1String("reinterpret_cast")); - keywords.insert(QLatin1String("return")); - keywords.insert(QLatin1String("short")); - keywords.insert(QLatin1String("signed")); - keywords.insert(QLatin1String("sizeof")); - keywords.insert(QLatin1String("static")); - keywords.insert(QLatin1String("static_cast")); - keywords.insert(QLatin1String("struct")); - keywords.insert(QLatin1String("switch")); - keywords.insert(QLatin1String("template")); - keywords.insert(QLatin1String("this")); - keywords.insert(QLatin1String("throw")); - keywords.insert(QLatin1String("true")); - keywords.insert(QLatin1String("try")); - keywords.insert(QLatin1String("typedef")); - keywords.insert(QLatin1String("typeid")); - keywords.insert(QLatin1String("typename")); - keywords.insert(QLatin1String("union")); - keywords.insert(QLatin1String("unsigned")); - keywords.insert(QLatin1String("using")); - keywords.insert(QLatin1String("virtual")); - keywords.insert(QLatin1String("void")); - keywords.insert(QLatin1String("volatile")); - keywords.insert(QLatin1String("wchar_t")); - keywords.insert(QLatin1String("while")); + keywords.insert(QStringLiteral("asm")); + keywords.insert(QStringLiteral("auto")); + keywords.insert(QStringLiteral("bool")); + keywords.insert(QStringLiteral("break")); + keywords.insert(QStringLiteral("case")); + keywords.insert(QStringLiteral("catch")); + keywords.insert(QStringLiteral("char")); + keywords.insert(QStringLiteral("class")); + keywords.insert(QStringLiteral("const")); + keywords.insert(QStringLiteral("const_cast")); + keywords.insert(QStringLiteral("continue")); + keywords.insert(QStringLiteral("default")); + keywords.insert(QStringLiteral("delete")); + keywords.insert(QStringLiteral("do")); + keywords.insert(QStringLiteral("double")); + keywords.insert(QStringLiteral("dynamic_cast")); + keywords.insert(QStringLiteral("else")); + keywords.insert(QStringLiteral("enum")); + keywords.insert(QStringLiteral("explicit")); + keywords.insert(QStringLiteral("export")); + keywords.insert(QStringLiteral("extern")); + keywords.insert(QStringLiteral("false")); + keywords.insert(QStringLiteral("float")); + keywords.insert(QStringLiteral("for")); + keywords.insert(QStringLiteral("friend")); + keywords.insert(QStringLiteral("goto")); + keywords.insert(QStringLiteral("if")); + keywords.insert(QStringLiteral("inline")); + keywords.insert(QStringLiteral("int")); + keywords.insert(QStringLiteral("long")); + keywords.insert(QStringLiteral("mutable")); + keywords.insert(QStringLiteral("namespace")); + keywords.insert(QStringLiteral("new")); + keywords.insert(QStringLiteral("NULL")); + keywords.insert(QStringLiteral("operator")); + keywords.insert(QStringLiteral("private")); + keywords.insert(QStringLiteral("protected")); + keywords.insert(QStringLiteral("public")); + keywords.insert(QStringLiteral("register")); + keywords.insert(QStringLiteral("reinterpret_cast")); + keywords.insert(QStringLiteral("return")); + keywords.insert(QStringLiteral("short")); + keywords.insert(QStringLiteral("signed")); + keywords.insert(QStringLiteral("sizeof")); + keywords.insert(QStringLiteral("static")); + keywords.insert(QStringLiteral("static_cast")); + keywords.insert(QStringLiteral("struct")); + keywords.insert(QStringLiteral("switch")); + keywords.insert(QStringLiteral("template")); + keywords.insert(QStringLiteral("this")); + keywords.insert(QStringLiteral("throw")); + keywords.insert(QStringLiteral("true")); + keywords.insert(QStringLiteral("try")); + keywords.insert(QStringLiteral("typedef")); + keywords.insert(QStringLiteral("typeid")); + keywords.insert(QStringLiteral("typename")); + keywords.insert(QStringLiteral("union")); + keywords.insert(QStringLiteral("unsigned")); + keywords.insert(QStringLiteral("using")); + keywords.insert(QStringLiteral("virtual")); + keywords.insert(QStringLiteral("void")); + keywords.insert(QStringLiteral("volatile")); + keywords.insert(QStringLiteral("wchar_t")); + keywords.insert(QStringLiteral("while")); // java keywords - keywords.insert(QLatin1String("abstract")); - keywords.insert(QLatin1String("assert")); - keywords.insert(QLatin1String("boolean")); - keywords.insert(QLatin1String("break")); - keywords.insert(QLatin1String("byte")); - keywords.insert(QLatin1String("case")); - keywords.insert(QLatin1String("catch")); - keywords.insert(QLatin1String("char")); - keywords.insert(QLatin1String("class")); - keywords.insert(QLatin1String("const")); - keywords.insert(QLatin1String("continue")); - keywords.insert(QLatin1String("default")); - keywords.insert(QLatin1String("do")); - keywords.insert(QLatin1String("double")); - keywords.insert(QLatin1String("else")); - keywords.insert(QLatin1String("enum")); - keywords.insert(QLatin1String("extends")); - keywords.insert(QLatin1String("false")); - keywords.insert(QLatin1String("final")); - keywords.insert(QLatin1String("finality")); - keywords.insert(QLatin1String("float")); - keywords.insert(QLatin1String("for")); - keywords.insert(QLatin1String("goto")); - keywords.insert(QLatin1String("if")); - keywords.insert(QLatin1String("implements")); - keywords.insert(QLatin1String("import")); - keywords.insert(QLatin1String("instanceof")); - keywords.insert(QLatin1String("int")); - keywords.insert(QLatin1String("interface")); - keywords.insert(QLatin1String("long")); - keywords.insert(QLatin1String("native")); - keywords.insert(QLatin1String("new")); - keywords.insert(QLatin1String("null")); - keywords.insert(QLatin1String("package")); - keywords.insert(QLatin1String("private")); - keywords.insert(QLatin1String("protected")); - keywords.insert(QLatin1String("public")); - keywords.insert(QLatin1String("return")); - keywords.insert(QLatin1String("short")); - keywords.insert(QLatin1String("static")); - keywords.insert(QLatin1String("strictfp")); - keywords.insert(QLatin1String("super")); - keywords.insert(QLatin1String("switch")); - keywords.insert(QLatin1String("synchronized")); - keywords.insert(QLatin1String("this")); - keywords.insert(QLatin1String("throw")); - keywords.insert(QLatin1String("throws")); - keywords.insert(QLatin1String("transient")); - keywords.insert(QLatin1String("true")); - keywords.insert(QLatin1String("try")); - keywords.insert(QLatin1String("void")); - keywords.insert(QLatin1String("volatile")); - keywords.insert(QLatin1String("while")); + keywords.insert(QStringLiteral("abstract")); + keywords.insert(QStringLiteral("assert")); + keywords.insert(QStringLiteral("boolean")); + keywords.insert(QStringLiteral("break")); + keywords.insert(QStringLiteral("byte")); + keywords.insert(QStringLiteral("case")); + keywords.insert(QStringLiteral("catch")); + keywords.insert(QStringLiteral("char")); + keywords.insert(QStringLiteral("class")); + keywords.insert(QStringLiteral("const")); + keywords.insert(QStringLiteral("continue")); + keywords.insert(QStringLiteral("default")); + keywords.insert(QStringLiteral("do")); + keywords.insert(QStringLiteral("double")); + keywords.insert(QStringLiteral("else")); + keywords.insert(QStringLiteral("enum")); + keywords.insert(QStringLiteral("extends")); + keywords.insert(QStringLiteral("false")); + keywords.insert(QStringLiteral("final")); + keywords.insert(QStringLiteral("finality")); + keywords.insert(QStringLiteral("float")); + keywords.insert(QStringLiteral("for")); + keywords.insert(QStringLiteral("goto")); + keywords.insert(QStringLiteral("if")); + keywords.insert(QStringLiteral("implements")); + keywords.insert(QStringLiteral("import")); + keywords.insert(QStringLiteral("instanceof")); + keywords.insert(QStringLiteral("int")); + keywords.insert(QStringLiteral("interface")); + keywords.insert(QStringLiteral("long")); + keywords.insert(QStringLiteral("native")); + keywords.insert(QStringLiteral("new")); + keywords.insert(QStringLiteral("null")); + keywords.insert(QStringLiteral("package")); + keywords.insert(QStringLiteral("private")); + keywords.insert(QStringLiteral("protected")); + keywords.insert(QStringLiteral("public")); + keywords.insert(QStringLiteral("return")); + keywords.insert(QStringLiteral("short")); + keywords.insert(QStringLiteral("static")); + keywords.insert(QStringLiteral("strictfp")); + keywords.insert(QStringLiteral("super")); + keywords.insert(QStringLiteral("switch")); + keywords.insert(QStringLiteral("synchronized")); + keywords.insert(QStringLiteral("this")); + keywords.insert(QStringLiteral("throw")); + keywords.insert(QStringLiteral("throws")); + keywords.insert(QStringLiteral("transient")); + keywords.insert(QStringLiteral("true")); + keywords.insert(QStringLiteral("try")); + keywords.insert(QStringLiteral("void")); + keywords.insert(QStringLiteral("volatile")); + keywords.insert(QStringLiteral("while")); } return keywords; } @@ -1222,7 +1222,7 @@ void FormWindow::insertWidget(QWidget *w, const QRect &rect, QWidget *container, QRect r = rect; Q_ASSERT(r.isValid()); SetPropertyCommand *geom_cmd = new SetPropertyCommand(this); - geom_cmd->init(w, QLatin1String("geometry"), r); // ### use rc.size() + geom_cmd->init(w, QStringLiteral("geometry"), r); // ### use rc.size() if (w->parentWidget() != container) { ReparentWidgetCommand *cmd = new ReparentWidgetCommand(this); @@ -1278,7 +1278,7 @@ void FormWindow::resizeWidget(QWidget *widget, const QRect &geometry) QRect r = geometry; SetPropertyCommand *cmd = new SetPropertyCommand(this); - cmd->init(widget, QLatin1String("geometry"), r); + cmd->init(widget, QStringLiteral("geometry"), r); cmd->setText(tr("Resize")); m_undoStack.push(cmd); } @@ -1525,7 +1525,7 @@ void ArrowKeyPropertyCommand::init(QWidgetList &l, const ArrowKeyOperation &op) QObjectList ol; foreach(QWidget *w, l) ol.push_back(w); - SetPropertyCommand::init(ol, QLatin1String("geometry"), QVariant::fromValue(op)); + SetPropertyCommand::init(ol, QStringLiteral("geometry"), QVariant::fromValue(op)); setText(op.resize ? FormWindow::tr("Key Resize") : FormWindow::tr("Key Move")); } @@ -1752,7 +1752,7 @@ static inline DomUI *domUIFromClipboard(int *widgetCount, int *actionCount) QXmlStreamReader reader(clipboardText); DomUI *ui = 0; - const QString uiElement = QLatin1String("ui"); + const QString uiElement = QStringLiteral("ui"); while (!reader.atEnd()) { if (reader.readNext() == QXmlStreamReader::StartElement) { if (reader.name().compare(uiElement, Qt::CaseInsensitive) == 0 && !ui) { @@ -2351,7 +2351,7 @@ QPoint FormWindow::mapToForm(const QWidget *w, const QPoint &pos) const bool FormWindow::canBeBuddy(QWidget *w) const // ### rename me. { if (QDesignerPropertySheetExtension *sheet = qt_extension<QDesignerPropertySheetExtension*>(core()->extensionManager(), w)) { - const int index = sheet->indexOf(QLatin1String("focusPolicy")); + const int index = sheet->indexOf(QStringLiteral("focusPolicy")); if (index != -1) { bool ok = false; const Qt::FocusPolicy q = static_cast<Qt::FocusPolicy>(Utils::valueOf(sheet->property(index), &ok)); @@ -2809,7 +2809,7 @@ bool FormWindow::dropDockWidget(QDesignerDnDItemInterface *item, const QPoint &g QDesignerPropertySheetExtension *propertySheet = qobject_cast<QDesignerPropertySheetExtension*>(m_core->extensionManager()->extension(widget, Q_TYPEID(QDesignerPropertySheetExtension))); if (propertySheet) { - const QString dockWidgetAreaName = QLatin1String("dockWidgetArea"); + const QString dockWidgetAreaName = QStringLiteral("dockWidgetArea"); PropertySheetEnumValue e = qvariant_cast<PropertySheetEnumValue>(propertySheet->property(propertySheet->indexOf(dockWidgetAreaName))); e.value = area; QVariant v; diff --git a/src/designer/src/components/formeditor/formwindow_widgetstack.cpp b/src/designer/src/components/formeditor/formwindow_widgetstack.cpp index 40f9aae33..f41860539 100644 --- a/src/designer/src/components/formeditor/formwindow_widgetstack.cpp +++ b/src/designer/src/components/formeditor/formwindow_widgetstack.cpp @@ -68,7 +68,7 @@ FormWindowWidgetStack::FormWindowWidgetStack(QObject *parent) : // the form windows as it ignores the sizePolicy of // its child (for example, Fixed would cause undesired side effects). m_formContainerLayout->setMargin(0); - m_formContainer->setObjectName(QLatin1String("formContainer")); + m_formContainer->setObjectName(QStringLiteral("formContainer")); m_formContainer->setLayout(m_formContainerLayout); m_formContainerLayout->setStackingMode(QStackedLayout::StackAll); // System settings might have different background colors, autofill them diff --git a/src/designer/src/components/formeditor/formwindowmanager.cpp b/src/designer/src/components/formeditor/formwindowmanager.cpp index 3aef59ace..d324c9362 100644 --- a/src/designer/src/components/formeditor/formwindowmanager.cpp +++ b/src/designer/src/components/formeditor/formwindowmanager.cpp @@ -363,147 +363,147 @@ QWidget *FormWindowManager::findManagedWidget(FormWindow *fw, QWidget *w) void FormWindowManager::setupActions() { - m_actionCut = new QAction(createIconSet(QLatin1String("editcut.png")), tr("Cu&t"), this); - m_actionCut->setObjectName(QLatin1String("__qt_cut_action")); + m_actionCut = new QAction(createIconSet(QStringLiteral("editcut.png")), tr("Cu&t"), this); + m_actionCut->setObjectName(QStringLiteral("__qt_cut_action")); m_actionCut->setShortcut(QKeySequence::Cut); m_actionCut->setStatusTip(tr("Cuts the selected widgets and puts them on the clipboard")); - m_actionCut->setWhatsThis(whatsThisFrom(QLatin1String("Edit|Cut"))); + m_actionCut->setWhatsThis(whatsThisFrom(QStringLiteral("Edit|Cut"))); connect(m_actionCut, SIGNAL(triggered()), this, SLOT(slotActionCutActivated())); m_actionCut->setEnabled(false); - m_actionCopy = new QAction(createIconSet(QLatin1String("editcopy.png")), tr("&Copy"), this); - m_actionCopy->setObjectName(QLatin1String("__qt_copy_action")); + m_actionCopy = new QAction(createIconSet(QStringLiteral("editcopy.png")), tr("&Copy"), this); + m_actionCopy->setObjectName(QStringLiteral("__qt_copy_action")); m_actionCopy->setShortcut(QKeySequence::Copy); m_actionCopy->setStatusTip(tr("Copies the selected widgets to the clipboard")); - m_actionCopy->setWhatsThis(whatsThisFrom(QLatin1String("Edit|Copy"))); + m_actionCopy->setWhatsThis(whatsThisFrom(QStringLiteral("Edit|Copy"))); connect(m_actionCopy, SIGNAL(triggered()), this, SLOT(slotActionCopyActivated())); m_actionCopy->setEnabled(false); - m_actionPaste = new QAction(createIconSet(QLatin1String("editpaste.png")), tr("&Paste"), this); - m_actionPaste->setObjectName(QLatin1String("__qt_paste_action")); + m_actionPaste = new QAction(createIconSet(QStringLiteral("editpaste.png")), tr("&Paste"), this); + m_actionPaste->setObjectName(QStringLiteral("__qt_paste_action")); m_actionPaste->setShortcut(QKeySequence::Paste); m_actionPaste->setStatusTip(tr("Pastes the clipboard's contents")); - m_actionPaste->setWhatsThis(whatsThisFrom(QLatin1String("Edit|Paste"))); + m_actionPaste->setWhatsThis(whatsThisFrom(QStringLiteral("Edit|Paste"))); connect(m_actionPaste, SIGNAL(triggered()), this, SLOT(slotActionPasteActivated())); m_actionPaste->setEnabled(false); m_actionDelete = new QAction(tr("&Delete"), this); - m_actionDelete->setObjectName(QLatin1String("__qt_delete_action")); + m_actionDelete->setObjectName(QStringLiteral("__qt_delete_action")); m_actionDelete->setStatusTip(tr("Deletes the selected widgets")); - m_actionDelete->setWhatsThis(whatsThisFrom(QLatin1String("Edit|Delete"))); + m_actionDelete->setWhatsThis(whatsThisFrom(QStringLiteral("Edit|Delete"))); connect(m_actionDelete, SIGNAL(triggered()), this, SLOT(slotActionDeleteActivated())); m_actionDelete->setEnabled(false); m_actionSelectAll = new QAction(tr("Select &All"), this); - m_actionSelectAll->setObjectName(QLatin1String("__qt_select_all_action")); + m_actionSelectAll->setObjectName(QStringLiteral("__qt_select_all_action")); m_actionSelectAll->setShortcut(QKeySequence::SelectAll); m_actionSelectAll->setStatusTip(tr("Selects all widgets")); - m_actionSelectAll->setWhatsThis(whatsThisFrom(QLatin1String("Edit|Select All"))); + m_actionSelectAll->setWhatsThis(whatsThisFrom(QStringLiteral("Edit|Select All"))); connect(m_actionSelectAll, SIGNAL(triggered()), this, SLOT(slotActionSelectAllActivated())); m_actionSelectAll->setEnabled(false); - m_actionRaise = new QAction(createIconSet(QLatin1String("editraise.png")), tr("Bring to &Front"), this); - m_actionRaise->setObjectName(QLatin1String("__qt_raise_action")); + m_actionRaise = new QAction(createIconSet(QStringLiteral("editraise.png")), tr("Bring to &Front"), this); + m_actionRaise->setObjectName(QStringLiteral("__qt_raise_action")); m_actionRaise->setShortcut(Qt::CTRL + Qt::Key_L); m_actionRaise->setStatusTip(tr("Raises the selected widgets")); m_actionRaise->setWhatsThis(tr("Raises the selected widgets")); connect(m_actionRaise, SIGNAL(triggered()), this, SLOT(slotActionRaiseActivated())); m_actionRaise->setEnabled(false); - m_actionLower = new QAction(createIconSet(QLatin1String("editlower.png")), tr("Send to &Back"), this); - m_actionLower->setObjectName(QLatin1String("__qt_lower_action")); + m_actionLower = new QAction(createIconSet(QStringLiteral("editlower.png")), tr("Send to &Back"), this); + m_actionLower->setObjectName(QStringLiteral("__qt_lower_action")); m_actionLower->setShortcut(Qt::CTRL + Qt::Key_K); m_actionLower->setStatusTip(tr("Lowers the selected widgets")); m_actionLower->setWhatsThis(tr("Lowers the selected widgets")); connect(m_actionLower, SIGNAL(triggered()), this, SLOT(slotActionLowerActivated())); m_actionLower->setEnabled(false); - m_actionAdjustSize = new QAction(createIconSet(QLatin1String("adjustsize.png")), tr("Adjust &Size"), this); - m_actionAdjustSize->setObjectName(QLatin1String("__qt_adjust_size_action")); + m_actionAdjustSize = new QAction(createIconSet(QStringLiteral("adjustsize.png")), tr("Adjust &Size"), this); + m_actionAdjustSize->setObjectName(QStringLiteral("__qt_adjust_size_action")); m_actionAdjustSize->setShortcut(Qt::CTRL + Qt::Key_J); m_actionAdjustSize->setStatusTip(tr("Adjusts the size of the selected widget")); - m_actionAdjustSize->setWhatsThis(whatsThisFrom(QLatin1String("Layout|Adjust Size"))); + m_actionAdjustSize->setWhatsThis(whatsThisFrom(QStringLiteral("Layout|Adjust Size"))); connect(m_actionAdjustSize, SIGNAL(triggered()), this, SLOT(slotActionAdjustSizeActivated())); m_actionAdjustSize->setEnabled(false); - m_actionHorizontalLayout = new QAction(createIconSet(QLatin1String("edithlayout.png")), tr("Lay Out &Horizontally"), this); - m_actionHorizontalLayout->setObjectName(QLatin1String("__qt_horizontal_layout_action")); + m_actionHorizontalLayout = new QAction(createIconSet(QStringLiteral("edithlayout.png")), tr("Lay Out &Horizontally"), this); + m_actionHorizontalLayout->setObjectName(QStringLiteral("__qt_horizontal_layout_action")); m_actionHorizontalLayout->setShortcut(Qt::CTRL + Qt::Key_1); m_actionHorizontalLayout->setStatusTip(tr("Lays out the selected widgets horizontally")); - m_actionHorizontalLayout->setWhatsThis(whatsThisFrom(QLatin1String("Layout|Lay Out Horizontally"))); + m_actionHorizontalLayout->setWhatsThis(whatsThisFrom(QStringLiteral("Layout|Lay Out Horizontally"))); m_actionHorizontalLayout->setData(LayoutInfo::HBox); m_actionHorizontalLayout->setEnabled(false); connect(m_actionHorizontalLayout, SIGNAL(triggered()), this, SLOT(createLayout())); - m_actionVerticalLayout = new QAction(createIconSet(QLatin1String("editvlayout.png")), tr("Lay Out &Vertically"), this); - m_actionVerticalLayout->setObjectName(QLatin1String("__qt_vertical_layout_action")); + m_actionVerticalLayout = new QAction(createIconSet(QStringLiteral("editvlayout.png")), tr("Lay Out &Vertically"), this); + m_actionVerticalLayout->setObjectName(QStringLiteral("__qt_vertical_layout_action")); m_actionVerticalLayout->setShortcut(Qt::CTRL + Qt::Key_2); m_actionVerticalLayout->setStatusTip(tr("Lays out the selected widgets vertically")); - m_actionVerticalLayout->setWhatsThis(whatsThisFrom(QLatin1String("Layout|Lay Out Vertically"))); + m_actionVerticalLayout->setWhatsThis(whatsThisFrom(QStringLiteral("Layout|Lay Out Vertically"))); m_actionVerticalLayout->setData(LayoutInfo::VBox); m_actionVerticalLayout->setEnabled(false); connect(m_actionVerticalLayout, SIGNAL(triggered()), this, SLOT(createLayout())); - QIcon formIcon = QIcon::fromTheme("designer-form-layout", createIconSet(QLatin1String("editform.png"))); + QIcon formIcon = QIcon::fromTheme(QStringLiteral("designer-form-layout"), createIconSet(QStringLiteral("editform.png"))); m_actionFormLayout = new QAction(formIcon, tr("Lay Out in a &Form Layout"), this); - m_actionFormLayout->setObjectName(QLatin1String("__qt_form_layout_action")); + m_actionFormLayout->setObjectName(QStringLiteral("__qt_form_layout_action")); m_actionFormLayout->setShortcut(Qt::CTRL + Qt::Key_6); m_actionFormLayout->setStatusTip(tr("Lays out the selected widgets in a form layout")); - m_actionFormLayout->setWhatsThis(whatsThisFrom(QLatin1String("Layout|Lay Out in a Form"))); + m_actionFormLayout->setWhatsThis(whatsThisFrom(QStringLiteral("Layout|Lay Out in a Form"))); m_actionFormLayout->setData(LayoutInfo::Form); m_actionFormLayout->setEnabled(false); connect(m_actionFormLayout, SIGNAL(triggered()), this, SLOT(createLayout())); - m_actionGridLayout = new QAction(createIconSet(QLatin1String("editgrid.png")), tr("Lay Out in a &Grid"), this); - m_actionGridLayout->setObjectName(QLatin1String("__qt_grid_layout_action")); + m_actionGridLayout = new QAction(createIconSet(QStringLiteral("editgrid.png")), tr("Lay Out in a &Grid"), this); + m_actionGridLayout->setObjectName(QStringLiteral("__qt_grid_layout_action")); m_actionGridLayout->setShortcut(Qt::CTRL + Qt::Key_5); m_actionGridLayout->setStatusTip(tr("Lays out the selected widgets in a grid")); - m_actionGridLayout->setWhatsThis(whatsThisFrom(QLatin1String("Layout|Lay Out in a Grid"))); + m_actionGridLayout->setWhatsThis(whatsThisFrom(QStringLiteral("Layout|Lay Out in a Grid"))); m_actionGridLayout->setData(LayoutInfo::Grid); m_actionGridLayout->setEnabled(false); connect(m_actionGridLayout, SIGNAL(triggered()), this, SLOT(createLayout())); - m_actionSplitHorizontal = new QAction(createIconSet(QLatin1String("edithlayoutsplit.png")), + m_actionSplitHorizontal = new QAction(createIconSet(QStringLiteral("edithlayoutsplit.png")), tr("Lay Out Horizontally in S&plitter"), this); - m_actionSplitHorizontal->setObjectName(QLatin1String("__qt_split_horizontal_action")); + m_actionSplitHorizontal->setObjectName(QStringLiteral("__qt_split_horizontal_action")); m_actionSplitHorizontal->setShortcut(Qt::CTRL + Qt::Key_3); m_actionSplitHorizontal->setStatusTip(tr("Lays out the selected widgets horizontally in a splitter")); - m_actionSplitHorizontal->setWhatsThis(whatsThisFrom(QLatin1String("Layout|Lay Out Horizontally in Splitter"))); + m_actionSplitHorizontal->setWhatsThis(whatsThisFrom(QStringLiteral("Layout|Lay Out Horizontally in Splitter"))); m_actionSplitHorizontal->setData(LayoutInfo::HSplitter); m_actionSplitHorizontal->setEnabled(false); connect(m_actionSplitHorizontal, SIGNAL(triggered()), this, SLOT(createLayout())); - m_actionSplitVertical = new QAction(createIconSet(QLatin1String("editvlayoutsplit.png")), + m_actionSplitVertical = new QAction(createIconSet(QStringLiteral("editvlayoutsplit.png")), tr("Lay Out Vertically in Sp&litter"), this); - m_actionSplitVertical->setObjectName(QLatin1String("__qt_split_vertical_action")); + m_actionSplitVertical->setObjectName(QStringLiteral("__qt_split_vertical_action")); m_actionSplitVertical->setShortcut(Qt::CTRL + Qt::Key_4); m_actionSplitVertical->setStatusTip(tr("Lays out the selected widgets vertically in a splitter")); - m_actionSplitVertical->setWhatsThis(whatsThisFrom(QLatin1String("Layout|Lay Out Vertically in Splitter"))); + m_actionSplitVertical->setWhatsThis(whatsThisFrom(QStringLiteral("Layout|Lay Out Vertically in Splitter"))); connect(m_actionSplitVertical, SIGNAL(triggered()), this, SLOT(createLayout())); m_actionSplitVertical->setData(LayoutInfo::VSplitter); m_actionSplitVertical->setEnabled(false); - m_actionBreakLayout = new QAction(createIconSet(QLatin1String("editbreaklayout.png")), tr("&Break Layout"), this); - m_actionBreakLayout->setObjectName(QLatin1String("__qt_break_layout_action")); + m_actionBreakLayout = new QAction(createIconSet(QStringLiteral("editbreaklayout.png")), tr("&Break Layout"), this); + m_actionBreakLayout->setObjectName(QStringLiteral("__qt_break_layout_action")); m_actionBreakLayout->setShortcut(Qt::CTRL + Qt::Key_0); m_actionBreakLayout->setStatusTip(tr("Breaks the selected layout")); - m_actionBreakLayout->setWhatsThis(whatsThisFrom(QLatin1String("Layout|Break Layout"))); + m_actionBreakLayout->setWhatsThis(whatsThisFrom(QStringLiteral("Layout|Break Layout"))); connect(m_actionBreakLayout, SIGNAL(triggered()), this, SLOT(slotActionBreakLayoutActivated())); m_actionBreakLayout->setEnabled(false); m_actionSimplifyLayout = new QAction(tr("Si&mplify Grid Layout"), this); - m_actionSimplifyLayout->setObjectName(QLatin1String("__qt_simplify_layout_action")); + m_actionSimplifyLayout->setObjectName(QStringLiteral("__qt_simplify_layout_action")); m_actionSimplifyLayout->setStatusTip(tr("Removes empty columns and rows")); - m_actionSimplifyLayout->setWhatsThis(whatsThisFrom(QLatin1String("Layout|Simplify Layout"))); + m_actionSimplifyLayout->setWhatsThis(whatsThisFrom(QStringLiteral("Layout|Simplify Layout"))); connect(m_actionSimplifyLayout, SIGNAL(triggered()), this, SLOT(slotActionSimplifyLayoutActivated())); m_actionSimplifyLayout->setEnabled(false); m_actionDefaultPreview = new QAction(tr("&Preview..."), this); - m_actionDefaultPreview->setObjectName(QLatin1String("__qt_default_preview_action")); + m_actionDefaultPreview->setObjectName(QStringLiteral("__qt_default_preview_action")); m_actionDefaultPreview->setStatusTip(tr("Preview current form")); - m_actionDefaultPreview->setWhatsThis(whatsThisFrom(QLatin1String("Form|Preview"))); + m_actionDefaultPreview->setWhatsThis(whatsThisFrom(QStringLiteral("Form|Preview"))); connect(m_actionDefaultPreview, SIGNAL(triggered()), this, SLOT(showPreview())); @@ -512,13 +512,13 @@ void FormWindowManager::setupActions() m_actionUndo = m_undoGroup->createUndoAction(this); m_actionUndo->setEnabled(false); - m_actionUndo->setIcon(QIcon::fromTheme("edit-undo", createIconSet(QLatin1String("undo.png")))); + m_actionUndo->setIcon(QIcon::fromTheme(QStringLiteral("edit-undo"), createIconSet(QStringLiteral("undo.png")))); m_actionRedo = m_undoGroup->createRedoAction(this); m_actionRedo->setEnabled(false); - m_actionRedo->setIcon(QIcon::fromTheme("edit-redo", createIconSet(QLatin1String("redo.png")))); + m_actionRedo->setIcon(QIcon::fromTheme(QStringLiteral("edit-redo"), createIconSet(QStringLiteral("redo.png")))); m_actionShowFormWindowSettingsDialog = new QAction(tr("Form &Settings..."), this); - m_actionShowFormWindowSettingsDialog->setObjectName(QLatin1String("__qt_form_settings_action")); + m_actionShowFormWindowSettingsDialog->setObjectName(QStringLiteral("__qt_form_settings_action")); connect(m_actionShowFormWindowSettingsDialog, SIGNAL(triggered()), this, SLOT(slotActionShowFormWindowSettingsDialog())); m_actionShowFormWindowSettingsDialog->setEnabled(false); diff --git a/src/designer/src/components/formeditor/formwindowsettings.cpp b/src/designer/src/components/formeditor/formwindowsettings.cpp index a357c797e..4ef300b44 100644 --- a/src/designer/src/components/formeditor/formwindowsettings.cpp +++ b/src/designer/src/components/formeditor/formwindowsettings.cpp @@ -226,7 +226,7 @@ FormWindowData FormWindowSettings::data() const if (!hints.isEmpty()) { rc.includeHints = hints.split(QString(QLatin1Char('\n'))); // Purge out any lines consisting of blanks only - const QRegExp blankLine = QRegExp(QLatin1String("^\\s*$")); + const QRegExp blankLine = QRegExp(QStringLiteral("^\\s*$")); Q_ASSERT(blankLine.isValid()); for (QStringList::iterator it = rc.includeHints.begin(); it != rc.includeHints.end(); ) if (blankLine.exactMatch(*it)) { @@ -260,7 +260,7 @@ void FormWindowSettings::setData(const FormWindowData &data) if (data.includeHints.empty()) { m_ui->includeHintsTextEdit->clear(); } else { - m_ui->includeHintsTextEdit->setText(data.includeHints.join(QLatin1String("\n"))); + m_ui->includeHintsTextEdit->setText(data.includeHints.join(QStringLiteral("\n"))); } m_ui->gridPanel->setChecked(data.hasFormGrid); diff --git a/src/designer/src/components/formeditor/itemview_propertysheet.cpp b/src/designer/src/components/formeditor/itemview_propertysheet.cpp index 31838f39f..fb37b43bd 100644 --- a/src/designer/src/components/formeditor/itemview_propertysheet.cpp +++ b/src/designer/src/components/formeditor/itemview_propertysheet.cpp @@ -158,7 +158,7 @@ ItemViewPropertySheet::ItemViewPropertySheet(QTreeView *treeViewObject, QObject : QDesignerPropertySheet(treeViewObject, parent), d(new ItemViewPropertySheetPrivate(core(), treeViewObject->header(), 0)) { - initHeaderProperties(treeViewObject->header(), QLatin1String("header")); + initHeaderProperties(treeViewObject->header(), QStringLiteral("header")); } ItemViewPropertySheet::ItemViewPropertySheet(QTableView *tableViewObject, QObject *parent) @@ -167,8 +167,8 @@ ItemViewPropertySheet::ItemViewPropertySheet(QTableView *tableViewObject, QObjec tableViewObject->horizontalHeader(), tableViewObject->verticalHeader())) { - initHeaderProperties(tableViewObject->horizontalHeader(), QLatin1String("horizontalHeader")); - initHeaderProperties(tableViewObject->verticalHeader(), QLatin1String("verticalHeader")); + initHeaderProperties(tableViewObject->horizontalHeader(), QStringLiteral("horizontalHeader")); + initHeaderProperties(tableViewObject->verticalHeader(), QStringLiteral("verticalHeader")); } ItemViewPropertySheet::~ItemViewPropertySheet() diff --git a/src/designer/src/components/formeditor/layout_propertysheet.cpp b/src/designer/src/components/formeditor/layout_propertysheet.cpp index 44e2e122c..aeba0fcd8 100644 --- a/src/designer/src/components/formeditor/layout_propertysheet.cpp +++ b/src/designer/src/components/formeditor/layout_propertysheet.cpp @@ -107,7 +107,7 @@ namespace { static bool isIntegerList(const QString &s) { // Check for empty string or comma-separated list of integers - static const QRegExp re(QLatin1String("[0-9]+(,[0-9]+)+")); + static const QRegExp re(QStringLiteral("[0-9]+(,[0-9]+)+")); Q_ASSERT(re.isValid()); return s.isEmpty() || re.exactMatch(s); } @@ -192,7 +192,7 @@ namespace qdesigner_internal { LayoutPropertySheet::LayoutPropertySheet(QLayout *l, QObject *parent) : QDesignerPropertySheet(l, parent), m_layout(l) { - const QString layoutGroup = QLatin1String("Layout"); + const QString layoutGroup = QStringLiteral("Layout"); int pindex = createFakeProperty(QLatin1String(leftMargin), 0); setPropertyGroup(pindex, layoutGroup); diff --git a/src/designer/src/components/formeditor/line_propertysheet.cpp b/src/designer/src/components/formeditor/line_propertysheet.cpp index 0ba000683..6ddbe9eb5 100644 --- a/src/designer/src/components/formeditor/line_propertysheet.cpp +++ b/src/designer/src/components/formeditor/line_propertysheet.cpp @@ -68,7 +68,7 @@ bool LinePropertySheet::isVisible(int index) const { const QString name = propertyName(index); - if (name == QLatin1String("frameShape")) + if (name == QStringLiteral("frameShape")) return false; return QDesignerPropertySheet::isVisible(index); } diff --git a/src/designer/src/components/formeditor/previewactiongroup.cpp b/src/designer/src/components/formeditor/previewactiongroup.cpp index 85030b863..52cbd7655 100644 --- a/src/designer/src/components/formeditor/previewactiongroup.cpp +++ b/src/designer/src/components/formeditor/previewactiongroup.cpp @@ -63,9 +63,9 @@ PreviewActionGroup::PreviewActionGroup(QDesignerFormEditorInterface *core, QObje connect(this, SIGNAL(triggered(QAction*)), this, SLOT(slotTriggered(QAction*))); setExclusive(true); - const QString objNamePostfix = QLatin1String("_action"); + const QString objNamePostfix = QStringLiteral("_action"); // Create invisible actions for devices. Set index as action data. - QString objNamePrefix = QLatin1String("__qt_designer_device_"); + QString objNamePrefix = QStringLiteral("__qt_designer_device_"); for (int i = 0; i < MaxDeviceActions; i++) { QAction *a = new QAction(this); QString objName = objNamePrefix; @@ -78,7 +78,7 @@ PreviewActionGroup::PreviewActionGroup(QDesignerFormEditorInterface *core, QObje } // Create separator at index MaxDeviceActions QAction *sep = new QAction(this); - sep->setObjectName(QLatin1String("__qt_designer_deviceseparator")); + sep->setObjectName(QStringLiteral("__qt_designer_deviceseparator")); sep->setSeparator(true); sep->setVisible(false); addAction(sep); @@ -89,7 +89,7 @@ PreviewActionGroup::PreviewActionGroup(QDesignerFormEditorInterface *core, QObje const QStringList styles = QStyleFactory::keys(); const QStringList::const_iterator cend = styles.constEnd(); // Make sure ObjectName is unique in case toolbar solution is used. - objNamePrefix = QLatin1String("__qt_designer_style_"); + objNamePrefix = QStringLiteral("__qt_designer_style_"); // Create styles. Set style name string as action data. for (QStringList::const_iterator it = styles.constBegin(); it != cend ;++it) { QAction *a = new QAction(tr("%1 Style").arg(*it), this); diff --git a/src/designer/src/components/formeditor/qdesigner_resource.cpp b/src/designer/src/components/formeditor/qdesigner_resource.cpp index c52cdfd4d..c938274b4 100644 --- a/src/designer/src/components/formeditor/qdesigner_resource.cpp +++ b/src/designer/src/components/formeditor/qdesigner_resource.cpp @@ -364,7 +364,7 @@ QVariant QDesignerTextBuilder::loadText(const DomProperty *text) const } if (str->hasAttributeNotr()) { const QString notr = str->attributeNotr(); - const bool translatable = !(notr == QLatin1String("true") || notr == QLatin1String("yes")); + const bool translatable = !(notr == QStringLiteral("true") || notr == QStringLiteral("yes")); if (!translatable) strVal.setTranslatable(translatable); } @@ -399,7 +399,7 @@ DomProperty *QDesignerTextBuilder::saveText(const QVariant &value) const domStr->setAttributeExtraComment(property_extraComment); const bool property_translatable = str.translatable(); if (!property_translatable) - domStr->setAttributeNotr(QLatin1String("true")); + domStr->setAttributeNotr(QStringLiteral("true")); } else { domStr->setText(value.toString()); } @@ -425,15 +425,15 @@ QDesignerResource::QDesignerResource(FormWindow *formWindow) : setTextBuilder(new QDesignerTextBuilder()); // ### generalise - const QString designerWidget = QLatin1String("QDesignerWidget"); - const QString layoutWidget = QLatin1String("QLayoutWidget"); - const QString widget = QLatin1String("QWidget"); + const QString designerWidget = QStringLiteral("QDesignerWidget"); + const QString layoutWidget = QStringLiteral("QLayoutWidget"); + const QString widget = QStringLiteral("QWidget"); m_internal_to_qt.insert(layoutWidget, widget); m_internal_to_qt.insert(designerWidget, widget); - m_internal_to_qt.insert(QLatin1String("QDesignerDialog"), QLatin1String("QDialog")); - m_internal_to_qt.insert(QLatin1String("QDesignerMenuBar"), QLatin1String("QMenuBar")); - m_internal_to_qt.insert(QLatin1String("QDesignerMenu"), QLatin1String("QMenu")); - m_internal_to_qt.insert(QLatin1String("QDesignerDockWidget"), QLatin1String("QDockWidget")); + m_internal_to_qt.insert(QStringLiteral("QDesignerDialog"), QStringLiteral("QDialog")); + m_internal_to_qt.insert(QStringLiteral("QDesignerMenuBar"), QStringLiteral("QMenuBar")); + m_internal_to_qt.insert(QStringLiteral("QDesignerMenu"), QStringLiteral("QMenu")); + m_internal_to_qt.insert(QStringLiteral("QDesignerDockWidget"), QStringLiteral("QDockWidget")); // invert QHash<QString, QString>::const_iterator cend = m_internal_to_qt.constEnd(); @@ -465,7 +465,7 @@ void QDesignerResource::saveDom(DomUI *ui, QWidget *widget) QDesignerPropertySheetExtension *sheet = qt_extension<QDesignerPropertySheetExtension*>(core()->extensionManager(), widget); Q_ASSERT(sheet != 0); - const QVariant classVar = sheet->property(sheet->indexOf(QLatin1String("objectName"))); + const QVariant classVar = sheet->property(sheet->indexOf(QStringLiteral("objectName"))); QString classStr; if (classVar.canConvert(QVariant::String)) classStr = classVar.toString(); @@ -510,8 +510,8 @@ void QDesignerResource::saveDom(DomUI *ui, QWidget *widget) } if (!m_formWindow->includeHints().isEmpty()) { - const QString local = QLatin1String("local"); - const QString global = QLatin1String("global"); + const QString local = QStringLiteral("local"); + const QString global = QStringLiteral("global"); QList<DomInclude*> ui_includes; foreach (QString includeHint, m_formWindow->includeHints()) { if (includeHint.isEmpty()) @@ -645,7 +645,7 @@ QWidget *QDesignerResource::create(DomUI *ui, QWidget *parentWidget) } if (DomIncludes *includes = ui->elementIncludes()) { - const QString global = QLatin1String("global"); + const QString global = QStringLiteral("global"); QStringList includeHints; foreach (DomInclude *incl, includes->elementInclude()) { QString text = incl->text(); @@ -701,7 +701,7 @@ QWidget *QDesignerResource::create(DomUI *ui, QWidget *parentWidget) bool hasExplicitGeometry = false; const QList<DomProperty *> properties = ui->elementWidget()->elementProperty(); if (!properties.empty()) { - const QString geometry = QLatin1String("geometry"); + const QString geometry = QStringLiteral("geometry"); foreach (const DomProperty *p, properties) if (p->attributeName() == geometry) { hasExplicitGeometry = true; @@ -744,7 +744,7 @@ QWidget *QDesignerResource::create(DomUI *ui, QWidget *parentWidget) QWidget *QDesignerResource::create(DomWidget *ui_widget, QWidget *parentWidget) { const QString className = ui_widget->attributeClass(); - if (!m_isMainWidget && className == QLatin1String("QWidget") && ui_widget->elementLayout().size() && + if (!m_isMainWidget && className == QStringLiteral("QWidget") && ui_widget->elementLayout().size() && !ui_widget->hasAttributeNative()) { // ### check if elementLayout.size() == 1 @@ -752,7 +752,7 @@ QWidget *QDesignerResource::create(DomWidget *ui_widget, QWidget *parentWidget) if (container == 0) { // generate a QLayoutWidget iff the parent is not an QDesignerContainerExtension. - ui_widget->setAttributeClass(QLatin1String("QLayoutWidget")); + ui_widget->setAttributeClass(QStringLiteral("QLayoutWidget")); } } @@ -781,7 +781,7 @@ QWidget *QDesignerResource::create(DomWidget *ui_widget, QWidget *parentWidget) foreach (DomActionRef *ui_action_ref, actionRefs) { const QString name = ui_action_ref->attributeName(); - if (name == QLatin1String("separator")) { + if (name == QStringLiteral("separator")) { QAction *sep = new QAction(w); sep->setSeparator(true); w->addAction(sep); @@ -809,7 +809,7 @@ QWidget *QDesignerResource::create(DomWidget *ui_widget, QWidget *parentWidget) // store user-defined scripts if (MetaDataBase *metaDataBase = qobject_cast<MetaDataBase *>(core()->metaDataBase())) { - const QString designerSource = QLatin1String("designer"); + const QString designerSource = QStringLiteral("designer"); const DomScripts domScripts = ui_widget->elementScript(); if (!domScripts.empty()) { foreach (const DomScript *script, domScripts) { @@ -843,7 +843,7 @@ QLayoutItem *QDesignerResource::create(DomLayoutItem *ui_layoutItem, QLayout *la { if (ui_layoutItem->kind() == DomLayoutItem::Spacer) { const DomSpacer *domSpacer = ui_layoutItem->elementSpacer(); - Spacer *spacer = static_cast<Spacer*>(core()->widgetFactory()->createWidget(QLatin1String("Spacer"), parentWidget)); + Spacer *spacer = static_cast<Spacer*>(core()->widgetFactory()->createWidget(QStringLiteral("Spacer"), parentWidget)); if (domSpacer->hasAttributeName()) changeObjectName(spacer, domSpacer->attributeName()); core()->metaDataBase()->add(spacer); @@ -855,7 +855,7 @@ QLayoutItem *QDesignerResource::create(DomLayoutItem *ui_layoutItem, QLayout *la if (m_formWindow) { m_formWindow->manageWidget(spacer); if (QDesignerPropertySheetExtension *sheet = qt_extension<QDesignerPropertySheetExtension*>(core()->extensionManager(), spacer)) - sheet->setChanged(sheet->indexOf(QLatin1String("orientation")), true); + sheet->setChanged(sheet->indexOf(QStringLiteral("orientation")), true); } return new QWidgetItem(spacer); @@ -928,7 +928,7 @@ void QDesignerResource::applyProperties(QObject *o, const QList<DomProperty*> &p QDesignerDynamicPropertySheetExtension *dynamicSheet = qt_extension<QDesignerDynamicPropertySheetExtension*>(core()->extensionManager(), o); const bool dynamicPropertiesAllowed = dynamicSheet && dynamicSheet->dynamicPropertiesAllowed(); - const QString objectNameProperty = QLatin1String("objectName"); + const QString objectNameProperty = QStringLiteral("objectName"); const DomPropertyList::const_iterator cend = properties.constEnd(); for (DomPropertyList::const_iterator it = properties.constBegin(); it != cend; ++it) { const DomProperty *p = *it; @@ -948,7 +948,7 @@ void QDesignerResource::applyProperties(QObject *o, const QList<DomProperty*> &p keyVal.setComment(key->attributeExtraComment()); if (key->hasAttributeNotr()) { const QString notr = key->attributeNotr(); - const bool translatable = !(notr == QLatin1String("true") || notr == QLatin1String("yes")); + const bool translatable = !(notr == QStringLiteral("true") || notr == QStringLiteral("yes")); if (!translatable) keyVal.setTranslatable(translatable); } @@ -962,7 +962,7 @@ void QDesignerResource::applyProperties(QObject *o, const QList<DomProperty*> &p strVal.setComment(str->attributeExtraComment()); if (str->hasAttributeNotr()) { const QString notr = str->attributeNotr(); - const bool translatable = !(notr == QLatin1String("true") || notr == QLatin1String("yes")); + const bool translatable = !(notr == QStringLiteral("true") || notr == QStringLiteral("yes")); if (!translatable) strVal.setTranslatable(translatable); } @@ -1119,7 +1119,7 @@ DomWidget *QDesignerResource::createDom(QWidget *widget, DomWidget *ui_parentWid Q_ASSERT( w != 0 ); - if (!qobject_cast<QLayoutWidget*>(widget) && w->attributeClass() == QLatin1String("QWidget")) { + if (!qobject_cast<QLayoutWidget*>(widget) && w->attributeClass() == QStringLiteral("QWidget")) { w->setAttributeNative(true); } @@ -1137,7 +1137,7 @@ DomWidget *QDesignerResource::createDom(QWidget *widget, DomWidget *ui_parentWid QList<DomProperty*> prop_list = w->elementProperty(); foreach (DomProperty *prop, prop_list) { - if (prop->attributeName() == QLatin1String("geometry")) { + if (prop->attributeName() == QStringLiteral("geometry")) { if (DomRect *rect = prop->elementRect()) { rect->setElementX(widget->x()); rect->setElementY(widget->y()); @@ -1328,13 +1328,13 @@ DomWidget *QDesignerResource::saveWidget(QToolBar *toolBar, DomWidget *ui_parent QList<DomProperty*> attributes = ui_widget->elementAttribute(); DomProperty *attr = new DomProperty(); - attr->setAttributeName(QLatin1String("toolBarArea")); + attr->setAttributeName(QStringLiteral("toolBarArea")); attr->setElementEnum(QLatin1String(toolBarAreaMetaEnum().valueToKey(area))); attributes << attr; attr = new DomProperty(); - attr->setAttributeName(QLatin1String("toolBarBreak")); - attr->setElementBool(toolBarBreak ? QLatin1String("true") : QLatin1String("false")); + attr->setAttributeName(QStringLiteral("toolBarBreak")); + attr->setElementBool(toolBarBreak ? QStringLiteral("true") : QStringLiteral("false")); attributes << attr; ui_widget->setElementAttribute(attributes); } @@ -1348,7 +1348,7 @@ DomWidget *QDesignerResource::saveWidget(QDesignerDockWidget *dockWidget, DomWid if (QMainWindow *mainWindow = qobject_cast<QMainWindow*>(dockWidget->parentWidget())) { const Qt::DockWidgetArea area = mainWindow->dockWidgetArea(dockWidget); DomProperty *attr = new DomProperty(); - attr->setAttributeName(QLatin1String("dockWidgetArea")); + attr->setAttributeName(QStringLiteral("dockWidgetArea")); attr->setElementNumber(int(area)); ui_widget->setElementAttribute(ui_widget->elementAttribute() << attr); } @@ -1369,7 +1369,7 @@ static void saveStringProperty(DomProperty *property, const PropertySheetStringV str->setAttributeExtraComment(property_extraComment); const bool property_translatable = value.translatable(); if (!property_translatable) - str->setAttributeNotr(QLatin1String("true")); + str->setAttributeNotr(QStringLiteral("true")); property->setElementString(str); } @@ -1387,7 +1387,7 @@ static void saveKeySequenceProperty(DomProperty *property, const PropertySheetKe str->setAttributeExtraComment(property_extraComment); const bool property_translatable = value.translatable(); if (!property_translatable) - str->setAttributeNotr(QLatin1String("true")); + str->setAttributeNotr(QStringLiteral("true")); property->setElementString(str); } @@ -1414,21 +1414,21 @@ DomWidget *QDesignerResource::saveWidget(QTabWidget *widget, DomWidget *ui_paren // attribute `icon' widget->setCurrentIndex(i); QDesignerPropertySheetExtension *sheet = qt_extension<QDesignerPropertySheetExtension*>(core()->extensionManager(), widget); - PropertySheetIconValue icon = qvariant_cast<PropertySheetIconValue>(sheet->property(sheet->indexOf(QLatin1String("currentTabIcon")))); + PropertySheetIconValue icon = qvariant_cast<PropertySheetIconValue>(sheet->property(sheet->indexOf(QStringLiteral("currentTabIcon")))); DomProperty *p = resourceBuilder()->saveResource(workingDirectory(), QVariant::fromValue(icon)); if (p) { p->setAttributeName(strings.iconAttribute); ui_attribute_list.append(p); } // attribute `title' - p = textBuilder()->saveText(sheet->property(sheet->indexOf(QLatin1String("currentTabText")))); + p = textBuilder()->saveText(sheet->property(sheet->indexOf(QStringLiteral("currentTabText")))); if (p) { p->setAttributeName(strings.titleAttribute); ui_attribute_list.append(p); } // attribute `toolTip' - QVariant v = sheet->property(sheet->indexOf(QLatin1String("currentTabToolTip"))); + QVariant v = sheet->property(sheet->indexOf(QStringLiteral("currentTabToolTip"))); if (!qvariant_cast<PropertySheetStringValue>(v).value().isEmpty()) { p = textBuilder()->saveText(v); if (p) { @@ -1438,7 +1438,7 @@ DomWidget *QDesignerResource::saveWidget(QTabWidget *widget, DomWidget *ui_paren } // attribute `whatsThis' - v = sheet->property(sheet->indexOf(QLatin1String("currentTabWhatsThis"))); + v = sheet->property(sheet->indexOf(QStringLiteral("currentTabWhatsThis"))); if (!qvariant_cast<PropertySheetStringValue>(v).value().isEmpty()) { p = textBuilder()->saveText(v); if (p) { @@ -1484,20 +1484,20 @@ DomWidget *QDesignerResource::saveWidget(QToolBox *widget, DomWidget *ui_parentW // attribute `icon' widget->setCurrentIndex(i); QDesignerPropertySheetExtension *sheet = qt_extension<QDesignerPropertySheetExtension*>(core()->extensionManager(), widget); - PropertySheetIconValue icon = qvariant_cast<PropertySheetIconValue>(sheet->property(sheet->indexOf(QLatin1String("currentItemIcon")))); + PropertySheetIconValue icon = qvariant_cast<PropertySheetIconValue>(sheet->property(sheet->indexOf(QStringLiteral("currentItemIcon")))); DomProperty *p = resourceBuilder()->saveResource(workingDirectory(), QVariant::fromValue(icon)); if (p) { p->setAttributeName(strings.iconAttribute); ui_attribute_list.append(p); } - p = textBuilder()->saveText(sheet->property(sheet->indexOf(QLatin1String("currentItemText")))); + p = textBuilder()->saveText(sheet->property(sheet->indexOf(QStringLiteral("currentItemText")))); if (p) { p->setAttributeName(strings.labelAttribute); ui_attribute_list.append(p); } // attribute `toolTip' - QVariant v = sheet->property(sheet->indexOf(QLatin1String("currentItemToolTip"))); + QVariant v = sheet->property(sheet->indexOf(QStringLiteral("currentItemToolTip"))); if (!qvariant_cast<PropertySheetStringValue>(v).value().isEmpty()) { p = textBuilder()->saveText(v); if (p) { @@ -1528,7 +1528,7 @@ DomWidget *QDesignerResource::saveWidget(QWizardPage *wizardPage, DomWidget *ui_ if (pageIdIndex != -1 && sheet->isChanged(pageIdIndex)) { DomProperty *property = variantToDomProperty(this, wizardPage->metaObject(), pageIdPropertyName, sheet->property(pageIdIndex)); Q_ASSERT(property); - property->elementString()->setAttributeNotr(QLatin1String("true")); + property->elementString()->setAttributeNotr(QStringLiteral("true")); DomPropertyList attributes = ui_widget->elementAttribute(); attributes.push_back(property); ui_widget->setElementAttribute(attributes); @@ -1558,14 +1558,14 @@ bool QDesignerResource::checkProperty(QObject *obj, const QString &prop) const if (pindex != -1 && !(meta->property(pindex)->attributes(obj) & QDesignerMetaPropertyInterface::StoredAttribute)) return false; - if (prop == QLatin1String("objectName") || prop == QLatin1String("spacerName")) // ### don't store the property objectName + if (prop == QStringLiteral("objectName") || prop == QStringLiteral("spacerName")) // ### don't store the property objectName return false; QWidget *check_widget = 0; if (obj->isWidgetType()) check_widget = static_cast<QWidget*>(obj); - if (check_widget && prop == QLatin1String("geometry")) { + if (check_widget && prop == QStringLiteral("geometry")) { if (check_widget == m_formWindow->mainContainer()) return true; // Save although maincontainer is technically laid-out by embedding container if (m_selected && m_selected == check_widget) @@ -1636,19 +1636,19 @@ bool QDesignerResource::addItem(DomWidget *ui_widget, QWidget *widget, QWidget * QDesignerPropertySheetExtension *sheet = qt_extension<QDesignerPropertySheetExtension*>(core()->extensionManager(), parentWidget); if (DomProperty *picon = attributes.value(strings.iconAttribute)) { QVariant v = resourceBuilder()->loadResource(workingDirectory(), picon); - sheet->setProperty(sheet->indexOf(QLatin1String("currentTabIcon")), v); + sheet->setProperty(sheet->indexOf(QStringLiteral("currentTabIcon")), v); } if (DomProperty *ptext = attributes.value(strings.titleAttribute)) { QVariant v = textBuilder()->loadText(ptext); - sheet->setProperty(sheet->indexOf(QLatin1String("currentTabText")), v); + sheet->setProperty(sheet->indexOf(QStringLiteral("currentTabText")), v); } if (DomProperty *ptext = attributes.value(strings.toolTipAttribute)) { QVariant v = textBuilder()->loadText(ptext); - sheet->setProperty(sheet->indexOf(QLatin1String("currentTabToolTip")), v); + sheet->setProperty(sheet->indexOf(QStringLiteral("currentTabToolTip")), v); } if (DomProperty *ptext = attributes.value(strings.whatsThisAttribute)) { QVariant v = textBuilder()->loadText(ptext); - sheet->setProperty(sheet->indexOf(QLatin1String("currentTabWhatsThis")), v); + sheet->setProperty(sheet->indexOf(QStringLiteral("currentTabWhatsThis")), v); } tabWidget->setCurrentIndex(current); } else if (QToolBox *toolBox = qobject_cast<QToolBox*>(parentWidget)) { @@ -1663,15 +1663,15 @@ bool QDesignerResource::addItem(DomWidget *ui_widget, QWidget *widget, QWidget * QDesignerPropertySheetExtension *sheet = qt_extension<QDesignerPropertySheetExtension*>(core()->extensionManager(), parentWidget); if (DomProperty *picon = attributes.value(strings.iconAttribute)) { QVariant v = resourceBuilder()->loadResource(workingDirectory(), picon); - sheet->setProperty(sheet->indexOf(QLatin1String("currentItemIcon")), v); + sheet->setProperty(sheet->indexOf(QStringLiteral("currentItemIcon")), v); } if (DomProperty *ptext = attributes.value(strings.labelAttribute)) { QVariant v = textBuilder()->loadText(ptext); - sheet->setProperty(sheet->indexOf(QLatin1String("currentItemText")), v); + sheet->setProperty(sheet->indexOf(QStringLiteral("currentItemText")), v); } if (DomProperty *ptext = attributes.value(strings.toolTipAttribute)) { QVariant v = textBuilder()->loadText(ptext); - sheet->setProperty(sheet->indexOf(QLatin1String("currentItemToolTip")), v); + sheet->setProperty(sheet->indexOf(QStringLiteral("currentItemToolTip")), v); } toolBox->setCurrentIndex(current); } @@ -1801,7 +1801,7 @@ FormBuilderClipboard QDesignerResource::paste(QIODevice *dev, QWidget *widgetPar QXmlStreamReader reader(dev); bool uiInitialized = false; - const QString uiElement = QLatin1String("ui"); + const QString uiElement = QStringLiteral("ui"); while (!reader.atEnd()) { if (reader.readNext() == QXmlStreamReader::StartElement) { if (reader.name().compare(uiElement, Qt::CaseInsensitive)) { @@ -1850,7 +1850,7 @@ DomCustomWidgets *QDesignerResource::saveCustomWidgets() typedef QMap<int,DomCustomWidget*> OrderedDBIndexDomCustomWidgetMap; OrderedDBIndexDomCustomWidgetMap orderedMap; - const QString global = QLatin1String("global"); + const QString global = QStringLiteral("global"); foreach (QDesignerWidgetDataBaseItemInterface *item, m_usedCustomWidgets.keys()) { const QString name = item->name(); DomCustomWidget *custom_widget = new DomCustomWidget; @@ -1901,10 +1901,10 @@ bool QDesignerResource::canCompressMargins(QObject *object) const { if (QDesignerPropertySheetExtension *sheet = qt_extension<QDesignerPropertySheetExtension*>(core()->extensionManager(), object)) { if (qobject_cast<QLayout *>(object)) { - const int l = sheet->property(sheet->indexOf(QLatin1String("leftMargin"))).toInt(); - const int t = sheet->property(sheet->indexOf(QLatin1String("topMargin"))).toInt(); - const int r = sheet->property(sheet->indexOf(QLatin1String("rightMargin"))).toInt(); - const int b = sheet->property(sheet->indexOf(QLatin1String("bottomMargin"))).toInt(); + const int l = sheet->property(sheet->indexOf(QStringLiteral("leftMargin"))).toInt(); + const int t = sheet->property(sheet->indexOf(QStringLiteral("topMargin"))).toInt(); + const int r = sheet->property(sheet->indexOf(QStringLiteral("rightMargin"))).toInt(); + const int b = sheet->property(sheet->indexOf(QStringLiteral("bottomMargin"))).toInt(); if (l == t && l == r && l == b) return true; } @@ -1916,8 +1916,8 @@ bool QDesignerResource::canCompressSpacings(QObject *object) const { if (QDesignerPropertySheetExtension *sheet = qt_extension<QDesignerPropertySheetExtension*>(core()->extensionManager(), object)) { if (qobject_cast<QGridLayout *>(object)) { - const int h = sheet->property(sheet->indexOf(QLatin1String("horizontalSpacing"))).toInt(); - const int v = sheet->property(sheet->indexOf(QLatin1String("verticalSpacing"))).toInt(); + const int h = sheet->property(sheet->indexOf(QStringLiteral("horizontalSpacing"))).toInt(); + const int v = sheet->property(sheet->indexOf(QStringLiteral("verticalSpacing"))).toInt(); if (h == v) return true; } @@ -1941,18 +1941,18 @@ QList<DomProperty*> QDesignerResource::computeProperties(QObject *object) const QString propertyName = sheet->propertyName(index); // Suppress windowModality in legacy forms that have it set on child widgets - if (propertyName == QLatin1String("windowModality") && !sheet->isVisible(index)) + if (propertyName == QStringLiteral("windowModality") && !sheet->isVisible(index)) continue; const QVariant value = sheet->property(index); if (DomProperty *p = createProperty(object, propertyName, value)) { - if (compressMargins && (propertyName == QLatin1String("leftMargin") - || propertyName == QLatin1String("rightMargin") - || propertyName == QLatin1String("topMargin") - || propertyName == QLatin1String("bottomMargin"))) { + if (compressMargins && (propertyName == QStringLiteral("leftMargin") + || propertyName == QStringLiteral("rightMargin") + || propertyName == QStringLiteral("topMargin") + || propertyName == QStringLiteral("bottomMargin"))) { marginProperties.append(p); - } else if (compressSpacings && (propertyName == QLatin1String("horizontalSpacing") - || propertyName == QLatin1String("verticalSpacing"))) { + } else if (compressSpacings && (propertyName == QStringLiteral("horizontalSpacing") + || propertyName == QStringLiteral("verticalSpacing"))) { spacingProperties.append(p); } else { properties.append(p); @@ -1962,7 +1962,7 @@ QList<DomProperty*> QDesignerResource::computeProperties(QObject *object) if (compressMargins) { if (marginProperties.count() == 4) { // if we have 3 it means one is reset so we can't compress DomProperty *marginProperty = marginProperties.at(0); - marginProperty->setAttributeName(QLatin1String("margin")); + marginProperty->setAttributeName(QStringLiteral("margin")); properties.append(marginProperty); delete marginProperties.at(1); delete marginProperties.at(2); @@ -1974,7 +1974,7 @@ QList<DomProperty*> QDesignerResource::computeProperties(QObject *object) if (compressSpacings) { if (spacingProperties.count() == 2) { DomProperty *spacingProperty = spacingProperties.at(0); - spacingProperty->setAttributeName(QLatin1String("spacing")); + spacingProperty->setAttributeName(QStringLiteral("spacing")); properties.append(spacingProperty); delete spacingProperties.at(1); } else { diff --git a/src/designer/src/components/formeditor/qlayoutwidget_propertysheet.cpp b/src/designer/src/components/formeditor/qlayoutwidget_propertysheet.cpp index 0de0b2715..6075091bf 100644 --- a/src/designer/src/components/formeditor/qlayoutwidget_propertysheet.cpp +++ b/src/designer/src/components/formeditor/qlayoutwidget_propertysheet.cpp @@ -64,7 +64,7 @@ QLayoutWidgetPropertySheet::~QLayoutWidgetPropertySheet() bool QLayoutWidgetPropertySheet::isVisible(int index) const { - static const QString layoutPropertyGroup = QLatin1String("Layout"); + static const QString layoutPropertyGroup = QStringLiteral("Layout"); if (propertyGroup(index) == layoutPropertyGroup) return QDesignerPropertySheet::isVisible(index); return false; diff --git a/src/designer/src/components/formeditor/qmdiarea_container.cpp b/src/designer/src/components/formeditor/qmdiarea_container.cpp index bb83f9ce9..29c24867b 100644 --- a/src/designer/src/components/formeditor/qmdiarea_container.cpp +++ b/src/designer/src/components/formeditor/qmdiarea_container.cpp @@ -147,7 +147,7 @@ static const char *subWindowNameC = "activeSubWindowName"; QMdiAreaPropertySheet::QMdiAreaPropertySheet(QWidget *mdiArea, QObject *parent) : QDesignerPropertySheet(mdiArea, parent), - m_windowTitleProperty(QLatin1String("windowTitle")) + m_windowTitleProperty(QStringLiteral("windowTitle")) { createFakeProperty(QLatin1String(subWindowNameC), QString()); createFakeProperty(QLatin1String(subWindowTitleC), QString()); diff --git a/src/designer/src/components/formeditor/qwizard_container.cpp b/src/designer/src/components/formeditor/qwizard_container.cpp index facec786e..4bef65bba 100644 --- a/src/designer/src/components/formeditor/qwizard_container.cpp +++ b/src/designer/src/components/formeditor/qwizard_container.cpp @@ -211,7 +211,7 @@ bool QWizardPagePropertySheet::reset(int index) // ---------------- QWizardPropertySheet QWizardPropertySheet::QWizardPropertySheet(QWizard *object, QObject *parent) : QDesignerPropertySheet(object, parent), - m_startId(QLatin1String("startId")) + m_startId(QStringLiteral("startId")) { } diff --git a/src/designer/src/components/formeditor/spacer_propertysheet.cpp b/src/designer/src/components/formeditor/spacer_propertysheet.cpp index d46a5aaa9..0d79a9a8d 100644 --- a/src/designer/src/components/formeditor/spacer_propertysheet.cpp +++ b/src/designer/src/components/formeditor/spacer_propertysheet.cpp @@ -64,7 +64,7 @@ SpacerPropertySheet::~SpacerPropertySheet() bool SpacerPropertySheet::isVisible(int index) const { - static const QString spacerGroup = QLatin1String("Spacer"); + static const QString spacerGroup = QStringLiteral("Spacer"); return propertyGroup(index) == spacerGroup; } diff --git a/src/designer/src/components/formeditor/widgetselection.cpp b/src/designer/src/components/formeditor/widgetselection.cpp index 045fb414d..f7c4b197b 100644 --- a/src/designer/src/components/formeditor/widgetselection.cpp +++ b/src/designer/src/components/formeditor/widgetselection.cpp @@ -349,7 +349,7 @@ void WidgetHandle::mouseReleaseEvent(QMouseEvent *e) case WidgetSelection::UnlaidOut: if (m_geom != m_widget->geometry()) { SetPropertyCommand *cmd = new SetPropertyCommand(m_formWindow); - cmd->init(m_widget, QLatin1String("geometry"), m_widget->geometry()); + cmd->init(m_widget, QStringLiteral("geometry"), m_widget->geometry()); cmd->setOldValue(m_origGeom); m_formWindow->commandHistory()->push(cmd); m_formWindow->emitSelectionChanged(); diff --git a/src/designer/src/components/lib/qdesigner_components.cpp b/src/designer/src/components/lib/qdesigner_components.cpp index e6558b69b..abbce6536 100644 --- a/src/designer/src/components/lib/qdesigner_components.cpp +++ b/src/designer/src/components/lib/qdesigner_components.cpp @@ -171,8 +171,8 @@ static inline QString widgetBoxFileName(int qtVersion, const QDesignerLanguageEx QString rc; { const QChar dot = QLatin1Char('.'); QTextStream str(&rc); - str << QDir::homePath() << QDir::separator() << QLatin1String(".designer") << QDir::separator() - << QLatin1String("widgetbox"); + str << QDir::homePath() << QDir::separator() << QStringLiteral(".designer") << QDir::separator() + << QStringLiteral("widgetbox"); // The naming convention using the version was introduced with 4.4 const int major = qtMajorVersion(qtVersion); const int minor = qtMinorVersion(qtVersion); @@ -180,7 +180,7 @@ static inline QString widgetBoxFileName(int qtVersion, const QDesignerLanguageEx str << major << dot << minor; if (lang) str << dot << lang->uiExtension(); - str << QLatin1String(".xml"); + str << QStringLiteral(".xml"); } return rc; } @@ -202,7 +202,7 @@ QDesignerWidgetBoxInterface *QDesignerComponents::createWidgetBox(QDesignerFormE } } - widgetBox->setFileName(QLatin1String(":/trolltech/widgetbox/widgetbox.xml")); + widgetBox->setFileName(QStringLiteral(":/trolltech/widgetbox/widgetbox.xml")); widgetBox->load(); } while (false); @@ -257,7 +257,7 @@ QWidget *QDesignerComponents::createResourceEditor(QDesignerFormEditorInterface } QtResourceView *resourceView = new QtResourceView(core, parent); resourceView->setResourceModel(core->resourceModel()); - resourceView->setSettingsKey(QLatin1String("ResourceBrowser")); + resourceView->setSettingsKey(QStringLiteral("ResourceBrowser")); // Note for integrators: make sure you call createResourceEditor() after you instantiated your subclass of designer integration // (designer doesn't do that since by default editing resources is enabled) const QDesignerIntegrationInterface *integration = core->integration(); diff --git a/src/designer/src/components/objectinspector/objectinspectormodel.cpp b/src/designer/src/components/objectinspector/objectinspectormodel.cpp index 773160841..8da790921 100644 --- a/src/designer/src/components/objectinspector/objectinspectormodel.cpp +++ b/src/designer/src/components/objectinspector/objectinspectormodel.cpp @@ -126,7 +126,7 @@ namespace qdesigner_internal { }; ModelRecursionContext::ModelRecursionContext(QDesignerFormEditorInterface *c, const QString &sepName) : - designerPrefix(QLatin1String("QDesigner")), + designerPrefix(QStringLiteral("QDesigner")), separator(sepName), core(c), db(c->widgetDataBase()), @@ -363,13 +363,13 @@ namespace qdesigner_internal { setColumnCount(NumColumns); setHorizontalHeaderLabels(headers); // Icons - m_icons.layoutIcons[LayoutInfo::NoLayout] = createIconSet(QLatin1String("editbreaklayout.png")); - m_icons.layoutIcons[LayoutInfo::HSplitter] = createIconSet(QLatin1String("edithlayoutsplit.png")); - m_icons.layoutIcons[LayoutInfo::VSplitter] = createIconSet(QLatin1String("editvlayoutsplit.png")); - m_icons.layoutIcons[LayoutInfo::HBox] = createIconSet(QLatin1String("edithlayout.png")); - m_icons.layoutIcons[LayoutInfo::VBox] = createIconSet(QLatin1String("editvlayout.png")); - m_icons.layoutIcons[LayoutInfo::Grid] = createIconSet(QLatin1String("editgrid.png")); - m_icons.layoutIcons[LayoutInfo::Form] = createIconSet(QLatin1String("editform.png")); + m_icons.layoutIcons[LayoutInfo::NoLayout] = createIconSet(QStringLiteral("editbreaklayout.png")); + m_icons.layoutIcons[LayoutInfo::HSplitter] = createIconSet(QStringLiteral("edithlayoutsplit.png")); + m_icons.layoutIcons[LayoutInfo::VSplitter] = createIconSet(QStringLiteral("editvlayoutsplit.png")); + m_icons.layoutIcons[LayoutInfo::HBox] = createIconSet(QStringLiteral("edithlayout.png")); + m_icons.layoutIcons[LayoutInfo::VBox] = createIconSet(QStringLiteral("editvlayout.png")); + m_icons.layoutIcons[LayoutInfo::Grid] = createIconSet(QStringLiteral("editgrid.png")); + m_icons.layoutIcons[LayoutInfo::Form] = createIconSet(QStringLiteral("editform.png")); } void ObjectInspectorModel::clearItems() @@ -507,7 +507,7 @@ namespace qdesigner_internal { if (!object) return false; // Is this a layout widget? - const QString nameProperty = isQLayoutWidget(object) ? QLatin1String("layoutName") : QLatin1String("objectName"); + const QString nameProperty = isQLayoutWidget(object) ? QStringLiteral("layoutName") : QStringLiteral("objectName"); m_formWindow->commandHistory()->push(createTextPropertyCommand(nameProperty, value.toString(), object, m_formWindow)); return true; } diff --git a/src/designer/src/components/propertyeditor/brushpropertymanager.cpp b/src/designer/src/components/propertyeditor/brushpropertymanager.cpp index 85d302fae..7815a1eb6 100644 --- a/src/designer/src/components/propertyeditor/brushpropertymanager.cpp +++ b/src/designer/src/components/propertyeditor/brushpropertymanager.cpp @@ -162,8 +162,8 @@ void BrushPropertyManager::initializeProperty(QtVariantPropertyManager *vm, QtPr const int brushStyleCount = sizeof(brushStyles)/sizeof(const char *); for (int i = 0; i < brushStyleCount; i++) styles.push_back(QCoreApplication::translate("BrushPropertyManager", brushStyles[i])); - styleSubProperty->setAttribute(QLatin1String("enumNames"), styles); - styleSubProperty->setAttribute(QLatin1String("enumIcons"), QVariant::fromValue(brushStyleIcons())); + styleSubProperty->setAttribute(QStringLiteral("enumNames"), styles); + styleSubProperty->setAttribute(QStringLiteral("enumIcons"), QVariant::fromValue(brushStyleIcons())); m_brushPropertyToStyleSubProperty.insert(property, styleSubProperty); m_brushStyleSubPropertyToProperty.insert(styleSubProperty, property); // color diff --git a/src/designer/src/components/propertyeditor/designerpropertymanager.cpp b/src/designer/src/components/propertyeditor/designerpropertymanager.cpp index 8007eac8e..735c4410b 100644 --- a/src/designer/src/components/propertyeditor/designerpropertymanager.cpp +++ b/src/designer/src/components/propertyeditor/designerpropertymanager.cpp @@ -264,7 +264,7 @@ void TextEditor::buttonClicked() break; case ValidationURL: { QString oldPath = oldText; - if (oldPath.isEmpty() || oldPath.startsWith(QLatin1String("qrc:"))) + if (oldPath.isEmpty() || oldPath.startsWith(QStringLiteral("qrc:"))) resourceActionActivated(); else fileActionActivated(); @@ -282,7 +282,7 @@ void TextEditor::buttonClicked() void TextEditor::resourceActionActivated() { QString oldPath = m_editor->text(); - if (oldPath.startsWith(QLatin1String("qrc:"))) + if (oldPath.startsWith(QStringLiteral("qrc:"))) oldPath.remove(0, 4); // returns ':/file' QString newPath = IconSelector::choosePixmapResource(m_core, m_core->resourceModel(), oldPath, this); @@ -290,7 +290,7 @@ void TextEditor::resourceActionActivated() newPath.remove(0, 1); if (newPath.isEmpty() || newPath == oldPath) return; - const QString newText = QLatin1String("qrc:") + newPath; + const QString newText = QStringLiteral("qrc:") + newPath; m_editor->setText(newText); emit textChanged(newText); } @@ -298,7 +298,7 @@ void TextEditor::resourceActionActivated() void TextEditor::fileActionActivated() { QString oldPath = m_editor->text(); - if (oldPath.startsWith(QLatin1String("file:"))) + if (oldPath.startsWith(QStringLiteral("file:"))) oldPath = oldPath.mid(5); const QString newPath = m_core->dialogGui()->getOpenFileName(this, tr("Choose a File"), oldPath); if (newPath.isEmpty() || newPath == oldPath) @@ -410,8 +410,8 @@ PixmapEditor::PixmapEditor(QDesignerFormEditorInterface *core, QWidget *parent) m_resourceAction(new QAction(tr("Choose Resource..."), this)), m_fileAction(new QAction(tr("Choose File..."), this)), m_themeAction(new QAction(tr("Set Icon From Theme..."), this)), - m_copyAction(new QAction(createIconSet(QLatin1String("editcopy.png")), tr("Copy Path"), this)), - m_pasteAction(new QAction(createIconSet(QLatin1String("editpaste.png")), tr("Paste Path"), this)), + m_copyAction(new QAction(createIconSet(QStringLiteral("editcopy.png")), tr("Copy Path"), this)), + m_pasteAction(new QAction(createIconSet(QStringLiteral("editpaste.png")), tr("Paste Path"), this)), m_layout(new QHBoxLayout(this)), m_pixmapCache(0) { @@ -580,7 +580,7 @@ void PixmapEditor::copyActionActivated() void PixmapEditor::pasteActionActivated() { QClipboard *clipboard = QApplication::clipboard(); - QString subtype = QLatin1String("plain"); + QString subtype = QStringLiteral("plain"); QString text = clipboard->text(subtype); if (!text.isNull()) { QStringList list = text.split(QLatin1Char('\n')); @@ -602,7 +602,7 @@ void PixmapEditor::pasteActionActivated() void PixmapEditor::clipboardDataChanged() { QClipboard *clipboard = QApplication::clipboard(); - QString subtype = QLatin1String("plain"); + QString subtype = QStringLiteral("plain"); const QString text = clipboard->text(subtype); m_pasteAction->setEnabled(!text.isNull()); } @@ -642,7 +642,7 @@ ResetWidget::ResetWidget(QtProperty *property, QWidget *parent) : m_textLabel->setSizePolicy(QSizePolicy(QSizePolicy::Ignored, QSizePolicy::Fixed)); m_iconLabel->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); m_button->setToolButtonStyle(Qt::ToolButtonIconOnly); - m_button->setIcon(createIconSet(QLatin1String("resetproperty.png"))); + m_button->setIcon(createIconSet(QStringLiteral("resetproperty.png"))); m_button->setIconSize(QSize(8,8)); m_button->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::MinimumExpanding)); connect(m_button, SIGNAL(clicked()), this, SLOT(slotClicked())); @@ -1437,7 +1437,7 @@ QString DesignerPropertyManager::valueText(const QtProperty *property) const return QString::fromUtf8(m_byteArrayValues.value(const_cast<QtProperty *>(property))); } if (m_stringListValues.contains(const_cast<QtProperty *>(property))) { - return m_stringListValues.value(const_cast<QtProperty *>(property)).join(QLatin1String("; ")); + return m_stringListValues.value(const_cast<QtProperty *>(property)).join(QStringLiteral("; ")); } if (QtVariantPropertyManager::valueType(property) == QVariant::String || QtVariantPropertyManager::valueType(property) == designerStringTypeId()) { const QString str = (QtVariantPropertyManager::valueType(property) == QVariant::String) ? value(property).toString() : qvariant_cast<PropertySheetStringValue>(value(property)).value(); @@ -1983,7 +1983,7 @@ void DesignerPropertyManager::initializeProperty(QtProperty *property) QtVariantProperty *alignH = addProperty(enumTypeId(), tr("Horizontal")); QStringList namesH; namesH << indexHToString(0) << indexHToString(1) << indexHToString(2) << indexHToString(3); - alignH->setAttribute(QLatin1String("enumNames"), namesH); + alignH->setAttribute(QStringLiteral("enumNames"), namesH); alignH->setValue(alignToIndexH(align)); m_propertyToAlignH[property] = alignH; m_alignHToProperty[alignH] = property; @@ -1992,7 +1992,7 @@ void DesignerPropertyManager::initializeProperty(QtProperty *property) QtVariantProperty *alignV = addProperty(enumTypeId(), tr("Vertical")); QStringList namesV; namesV << indexVToString(0) << indexVToString(1) << indexVToString(2); - alignV->setAttribute(QLatin1String("enumNames"), namesV); + alignV->setAttribute(QStringLiteral("enumNames"), namesV); alignV->setValue(alignToIndexV(align)); m_propertyToAlignV[property] = alignV; m_alignVToProperty[alignV] = property; @@ -2070,7 +2070,7 @@ void DesignerPropertyManager::initializeProperty(QtProperty *property) QtVariantPropertyManager::initializeProperty(property); m_fontManager.postInitializeProperty(this, property, type, DesignerPropertyManager::enumTypeId()); if (type == QVariant::Double) - setAttribute(property, QLatin1String("decimals"), 6); + setAttribute(property, QStringLiteral("decimals"), 6); } void DesignerPropertyManager::createIconSubProperty(QtProperty *iconProperty, QIcon::Mode mode, QIcon::State state, const QString &subName) diff --git a/src/designer/src/components/propertyeditor/fontpropertymanager.cpp b/src/designer/src/components/propertyeditor/fontpropertymanager.cpp index 03b2f03de..11efb536c 100644 --- a/src/designer/src/components/propertyeditor/fontpropertymanager.cpp +++ b/src/designer/src/components/propertyeditor/fontpropertymanager.cpp @@ -125,7 +125,7 @@ namespace qdesigner_internal { QtVariantProperty *antialiasing = vm->addProperty(enumTypeId, QCoreApplication::translate("FontPropertyManager", "Antialiasing")); const QFont font = qvariant_cast<QFont>(vm->variantProperty(property)->value()); - antialiasing->setAttribute(QLatin1String("enumNames"), m_aliasingEnumNames); + antialiasing->setAttribute(QStringLiteral("enumNames"), m_aliasingEnumNames); antialiasing->setValue(antialiasingToIndex(font.styleStrategy())); property->addSubProperty(antialiasing); @@ -135,7 +135,7 @@ namespace qdesigner_internal { if (!m_familyMappings.empty()) { const PropertyToSubPropertiesMap::iterator it = m_propertyToFontSubProperties.find(m_createdFontProperty); QtVariantProperty *familyProperty = vm->variantProperty(it.value().front()); - const QString enumNamesAttribute = QLatin1String("enumNames"); + const QString enumNamesAttribute = QStringLiteral("enumNames"); QStringList plainFamilyNames = familyProperty->attributeValue(enumNamesAttribute).toStringList(); // Did someone load fonts or something? if (m_designerFamilyNames.size() != plainFamilyNames.size()) @@ -331,7 +331,7 @@ namespace qdesigner_internal { bool FontPropertyManager::readFamilyMapping(NameMap *rc, QString *errorMessage) { rc->clear(); - const QString fileName = QLatin1String(":/trolltech/propertyeditor/fontmapping.xml"); + const QString fileName = QStringLiteral(":/trolltech/propertyeditor/fontmapping.xml"); QFile file(fileName); if (!file.open(QIODevice::ReadOnly)) { *errorMessage = QString::fromUtf8("Unable to open %1: %2").arg(fileName, file.errorString()); diff --git a/src/designer/src/components/propertyeditor/newdynamicpropertydialog.cpp b/src/designer/src/components/propertyeditor/newdynamicpropertydialog.cpp index 5426b8514..9f88d0fef 100644 --- a/src/designer/src/components/propertyeditor/newdynamicpropertydialog.cpp +++ b/src/designer/src/components/propertyeditor/newdynamicpropertydialog.cpp @@ -61,34 +61,34 @@ NewDynamicPropertyDialog::NewDynamicPropertyDialog(QDesignerDialogGuiInterface * setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); - m_ui->m_comboBox->addItem(QLatin1String("String"), QVariant(QVariant::String)); - m_ui->m_comboBox->addItem(QLatin1String("StringList"), QVariant(QVariant::StringList)); - m_ui->m_comboBox->addItem(QLatin1String("Char"), QVariant(QVariant::Char)); - m_ui->m_comboBox->addItem(QLatin1String("ByteArray"), QVariant(QVariant::ByteArray)); - m_ui->m_comboBox->addItem(QLatin1String("Url"), QVariant(QVariant::Url)); - m_ui->m_comboBox->addItem(QLatin1String("Bool"), QVariant(QVariant::Bool)); - m_ui->m_comboBox->addItem(QLatin1String("Int"), QVariant(QVariant::Int)); - m_ui->m_comboBox->addItem(QLatin1String("UInt"), QVariant(QVariant::UInt)); - m_ui->m_comboBox->addItem(QLatin1String("LongLong"), QVariant(QVariant::LongLong)); - m_ui->m_comboBox->addItem(QLatin1String("ULongLong"), QVariant(QVariant::ULongLong)); - m_ui->m_comboBox->addItem(QLatin1String("Double"), QVariant(QVariant::Double)); - m_ui->m_comboBox->addItem(QLatin1String("Size"), QVariant(QVariant::Size)); - m_ui->m_comboBox->addItem(QLatin1String("SizeF"), QVariant(QVariant::SizeF)); - m_ui->m_comboBox->addItem(QLatin1String("Point"), QVariant(QVariant::Point)); - m_ui->m_comboBox->addItem(QLatin1String("PointF"), QVariant(QVariant::PointF)); - m_ui->m_comboBox->addItem(QLatin1String("Rect"), QVariant(QVariant::Rect)); - m_ui->m_comboBox->addItem(QLatin1String("RectF"), QVariant(QVariant::RectF)); - m_ui->m_comboBox->addItem(QLatin1String("Date"), QVariant(QVariant::Date)); - m_ui->m_comboBox->addItem(QLatin1String("Time"), QVariant(QVariant::Time)); - m_ui->m_comboBox->addItem(QLatin1String("DateTime"), QVariant(QVariant::DateTime)); - m_ui->m_comboBox->addItem(QLatin1String("Font"), QVariant(QVariant::Font)); - m_ui->m_comboBox->addItem(QLatin1String("Palette"), QVariant(QVariant::Palette)); - m_ui->m_comboBox->addItem(QLatin1String("Color"), QVariant(QVariant::Color)); - m_ui->m_comboBox->addItem(QLatin1String("Pixmap"), QVariant(QVariant::Pixmap)); - m_ui->m_comboBox->addItem(QLatin1String("Icon"), QVariant(QVariant::Icon)); - m_ui->m_comboBox->addItem(QLatin1String("Cursor"), QVariant(QVariant::Cursor)); - m_ui->m_comboBox->addItem(QLatin1String("SizePolicy"), QVariant(QVariant::SizePolicy)); - m_ui->m_comboBox->addItem(QLatin1String("KeySequence"), QVariant(QVariant::KeySequence)); + m_ui->m_comboBox->addItem(QStringLiteral("String"), QVariant(QVariant::String)); + m_ui->m_comboBox->addItem(QStringLiteral("StringList"), QVariant(QVariant::StringList)); + m_ui->m_comboBox->addItem(QStringLiteral("Char"), QVariant(QVariant::Char)); + m_ui->m_comboBox->addItem(QStringLiteral("ByteArray"), QVariant(QVariant::ByteArray)); + m_ui->m_comboBox->addItem(QStringLiteral("Url"), QVariant(QVariant::Url)); + m_ui->m_comboBox->addItem(QStringLiteral("Bool"), QVariant(QVariant::Bool)); + m_ui->m_comboBox->addItem(QStringLiteral("Int"), QVariant(QVariant::Int)); + m_ui->m_comboBox->addItem(QStringLiteral("UInt"), QVariant(QVariant::UInt)); + m_ui->m_comboBox->addItem(QStringLiteral("LongLong"), QVariant(QVariant::LongLong)); + m_ui->m_comboBox->addItem(QStringLiteral("ULongLong"), QVariant(QVariant::ULongLong)); + m_ui->m_comboBox->addItem(QStringLiteral("Double"), QVariant(QVariant::Double)); + m_ui->m_comboBox->addItem(QStringLiteral("Size"), QVariant(QVariant::Size)); + m_ui->m_comboBox->addItem(QStringLiteral("SizeF"), QVariant(QVariant::SizeF)); + m_ui->m_comboBox->addItem(QStringLiteral("Point"), QVariant(QVariant::Point)); + m_ui->m_comboBox->addItem(QStringLiteral("PointF"), QVariant(QVariant::PointF)); + m_ui->m_comboBox->addItem(QStringLiteral("Rect"), QVariant(QVariant::Rect)); + m_ui->m_comboBox->addItem(QStringLiteral("RectF"), QVariant(QVariant::RectF)); + m_ui->m_comboBox->addItem(QStringLiteral("Date"), QVariant(QVariant::Date)); + m_ui->m_comboBox->addItem(QStringLiteral("Time"), QVariant(QVariant::Time)); + m_ui->m_comboBox->addItem(QStringLiteral("DateTime"), QVariant(QVariant::DateTime)); + m_ui->m_comboBox->addItem(QStringLiteral("Font"), QVariant(QVariant::Font)); + m_ui->m_comboBox->addItem(QStringLiteral("Palette"), QVariant(QVariant::Palette)); + m_ui->m_comboBox->addItem(QStringLiteral("Color"), QVariant(QVariant::Color)); + m_ui->m_comboBox->addItem(QStringLiteral("Pixmap"), QVariant(QVariant::Pixmap)); + m_ui->m_comboBox->addItem(QStringLiteral("Icon"), QVariant(QVariant::Icon)); + m_ui->m_comboBox->addItem(QStringLiteral("Cursor"), QVariant(QVariant::Cursor)); + m_ui->m_comboBox->addItem(QStringLiteral("SizePolicy"), QVariant(QVariant::SizePolicy)); + m_ui->m_comboBox->addItem(QStringLiteral("KeySequence"), QVariant(QVariant::KeySequence)); m_ui->m_comboBox->setCurrentIndex(0); // String setOkButtonEnabled(false); @@ -145,7 +145,7 @@ bool NewDynamicPropertyDialog::validatePropertyName(const QString& name) information(tr("The current object already has a property named '%1'.\nPlease select another, unique one.").arg(name)); return false; } - if (!QDesignerPropertySheet::internalDynamicPropertiesEnabled() && name.startsWith(QLatin1String("_q_"))) { + if (!QDesignerPropertySheet::internalDynamicPropertiesEnabled() && name.startsWith(QStringLiteral("_q_"))) { information(tr("The '_q_' prefix is reserved for the Qt library.\nPlease select another name.")); return false; } diff --git a/src/designer/src/components/propertyeditor/paletteeditor.cpp b/src/designer/src/components/propertyeditor/paletteeditor.cpp index bd82c851b..ca6b4381e 100644 --- a/src/designer/src/components/propertyeditor/paletteeditor.cpp +++ b/src/designer/src/components/propertyeditor/paletteeditor.cpp @@ -468,7 +468,7 @@ RoleEditor::RoleEditor(QWidget *parent) : QToolButton *button = new QToolButton(this); button->setToolButtonStyle(Qt::ToolButtonIconOnly); - button->setIcon(createIconSet(QLatin1String("resetproperty.png"))); + button->setIcon(createIconSet(QStringLiteral("resetproperty.png"))); button->setIconSize(QSize(8,8)); button->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::MinimumExpanding)); layout->addWidget(button); diff --git a/src/designer/src/components/propertyeditor/propertyeditor.cpp b/src/designer/src/components/propertyeditor/propertyeditor.cpp index 0d9b9176f..e870ec85e 100644 --- a/src/designer/src/components/propertyeditor/propertyeditor.cpp +++ b/src/designer/src/components/propertyeditor/propertyeditor.cpp @@ -150,20 +150,20 @@ void ElidingLabel::paintEvent(QPaintEvent *) { // ----------- PropertyEditor::Strings PropertyEditor::Strings::Strings() : - m_fontProperty(QLatin1String("font")), - m_qLayoutWidget(QLatin1String("QLayoutWidget")), - m_designerPrefix(QLatin1String("QDesigner")), - m_layout(QLatin1String("Layout")), - m_validationModeAttribute(QLatin1String("validationMode")), - m_fontAttribute(QLatin1String("font")), - m_superPaletteAttribute(QLatin1String("superPalette")), - m_enumNamesAttribute(QLatin1String("enumNames")), - m_resettableAttribute(QLatin1String("resettable")), - m_flagsAttribute(QLatin1String("flags")) + m_fontProperty(QStringLiteral("font")), + m_qLayoutWidget(QStringLiteral("QLayoutWidget")), + m_designerPrefix(QStringLiteral("QDesigner")), + m_layout(QStringLiteral("Layout")), + m_validationModeAttribute(QStringLiteral("validationMode")), + m_fontAttribute(QStringLiteral("font")), + m_superPaletteAttribute(QStringLiteral("superPalette")), + m_enumNamesAttribute(QStringLiteral("enumNames")), + m_resettableAttribute(QStringLiteral("resettable")), + m_flagsAttribute(QStringLiteral("flags")) { - m_alignmentProperties.insert(QLatin1String("alignment")); - m_alignmentProperties.insert(QLatin1String("layoutLabelAlignment")); // QFormLayout - m_alignmentProperties.insert(QLatin1String("layoutFormAlignment")); + m_alignmentProperties.insert(QStringLiteral("alignment")); + m_alignmentProperties.insert(QStringLiteral("layoutLabelAlignment")); // QFormLayout + m_alignmentProperties.insert(QStringLiteral("layoutFormAlignment")); } // ----------- PropertyEditor @@ -229,10 +229,10 @@ PropertyEditor::PropertyEditor(QDesignerFormEditorInterface *core, QWidget *pare m_filterWidget(new FilterWidget(0, FilterWidget::LayoutAlignNone)), m_buttonIndex(-1), m_treeIndex(-1), - m_addDynamicAction(new QAction(createIconSet(QLatin1String("plus.png")), tr("Add Dynamic Property..."), this)), - m_removeDynamicAction(new QAction(createIconSet(QLatin1String("minus.png")), tr("Remove Dynamic Property"), this)), - m_sortingAction(new QAction(createIconSet(QLatin1String("sort.png")), tr("Sorting"), this)), - m_coloringAction(new QAction(createIconSet(QLatin1String("color.png")), tr("Color Groups"), this)), + m_addDynamicAction(new QAction(createIconSet(QStringLiteral("plus.png")), tr("Add Dynamic Property..."), this)), + m_removeDynamicAction(new QAction(createIconSet(QStringLiteral("minus.png")), tr("Remove Dynamic Property"), this)), + m_sortingAction(new QAction(createIconSet(QStringLiteral("sort.png")), tr("Sorting"), this)), + m_coloringAction(new QAction(createIconSet(QStringLiteral("color.png")), tr("Color Groups"), this)), m_treeAction(new QAction(tr("Tree View"), this)), m_buttonAction(new QAction(tr("Drop Down Button View"), this)), m_classLabel(new ElidingLabel), @@ -264,9 +264,9 @@ PropertyEditor::PropertyEditor(QDesignerFormEditorInterface *core, QWidget *pare QActionGroup *actionGroup = new QActionGroup(this); m_treeAction->setCheckable(true); - m_treeAction->setIcon(createIconSet(QLatin1String("widgets/listview.png"))); + m_treeAction->setIcon(createIconSet(QStringLiteral("widgets/listview.png"))); m_buttonAction->setCheckable(true); - m_buttonAction->setIcon(createIconSet(QLatin1String("dropdownbutton.png"))); + m_buttonAction->setIcon(createIconSet(QStringLiteral("dropdownbutton.png"))); actionGroup->addAction(m_treeAction); actionGroup->addAction(m_buttonAction); @@ -294,7 +294,7 @@ PropertyEditor::PropertyEditor(QDesignerFormEditorInterface *core, QWidget *pare connect(m_removeDynamicAction, SIGNAL(triggered()), this, SLOT(slotRemoveDynamicProperty())); // Configure QAction *configureAction = new QAction(tr("Configure Property Editor"), this); - configureAction->setIcon(createIconSet(QLatin1String("configure.png"))); + configureAction->setIcon(createIconSet(QStringLiteral("configure.png"))); QMenu *configureMenu = new QMenu(this); configureAction->setMenu(configureMenu); @@ -831,7 +831,7 @@ void PropertyEditor::updateToolBarLabel() QString classLabelText; if (!objectName.isEmpty()) - classLabelText += objectName + QLatin1String(" : "); + classLabelText += objectName + QStringLiteral(" : "); classLabelText += className; m_classLabel->setText(classLabelText); @@ -870,7 +870,7 @@ void PropertyEditor::updateBrowserValue(QtVariantProperty *property, const QVari m_updatingBrowser = true; property->setValue(v); if (sheet && sheet->isResourceProperty(index)) - property->setAttribute(QLatin1String("defaultResource"), sheet->defaultResourceProperty(index)); + property->setAttribute(QStringLiteral("defaultResource"), sheet->defaultResourceProperty(index)); m_updatingBrowser = false; } @@ -1116,11 +1116,11 @@ void PropertyEditor::setObject(QObject *object) updateBrowserValue(property, value); property->setModified(m_propertySheet->isChanged(i)); - if (propertyName == QLatin1String("geometry") && type == QVariant::Rect) { + if (propertyName == QStringLiteral("geometry") && type == QVariant::Rect) { QList<QtProperty *> subProperties = property->subProperties(); foreach (QtProperty *subProperty, subProperties) { const QString subPropertyName = subProperty->propertyName(); - if (subPropertyName == QLatin1String("X") || subPropertyName == QLatin1String("Y")) + if (subPropertyName == QStringLiteral("X") || subPropertyName == QStringLiteral("Y")) subProperty->setEnabled(!isMainContainer); } } diff --git a/src/designer/src/components/signalsloteditor/signalsloteditor.cpp b/src/designer/src/components/signalsloteditor/signalsloteditor.cpp index 364619199..b6caa4e4a 100644 --- a/src/designer/src/components/signalsloteditor/signalsloteditor.cpp +++ b/src/designer/src/components/signalsloteditor/signalsloteditor.cpp @@ -88,13 +88,13 @@ DomConnection *SignalSlotConnection::toUi() const QPoint tp = endPointPos(EndPoint::Target); DomConnectionHint *hint = new DomConnectionHint; - hint->setAttributeType(QLatin1String("sourcelabel")); + hint->setAttributeType(QStringLiteral("sourcelabel")); hint->setElementX(sp.x()); hint->setElementY(sp.y()); list.append(hint); hint = new DomConnectionHint; - hint->setAttributeType(QLatin1String("destinationlabel")); + hint->setAttributeType(QStringLiteral("destinationlabel")); hint->setElementX(tp.x()); hint->setElementY(tp.y()); list.append(hint); @@ -408,9 +408,9 @@ void SignalSlotEditor::fromUi(const DomConnections *connections, QWidget *parent foreach (DomConnectionHint *hint, list) { QString attr_type = hint->attributeType(); QPoint p = QPoint(hint->elementX(), hint->elementY()); - if (attr_type == QLatin1String("sourcelabel")) + if (attr_type == QStringLiteral("sourcelabel")) sp = p; - else if (attr_type == QLatin1String("destinationlabel")) + else if (attr_type == QStringLiteral("destinationlabel")) tp = p; } } @@ -428,13 +428,13 @@ void SignalSlotEditor::fromUi(const DomConnections *connections, QWidget *parent static bool skipWidget(const QWidget *w) { const QString name = QLatin1String(w->metaObject()->className()); - if (name == QLatin1String("QDesignerWidget")) + if (name == QStringLiteral("QDesignerWidget")) return true; - if (name == QLatin1String("QLayoutWidget")) + if (name == QStringLiteral("QLayoutWidget")) return true; - if (name == QLatin1String("qdesigner_internal::FormWindow")) + if (name == QStringLiteral("qdesigner_internal::FormWindow")) return true; - if (name == QLatin1String("Spacer")) + if (name == QStringLiteral("Spacer")) return true; return false; } diff --git a/src/designer/src/components/signalsloteditor/signalsloteditor_plugin.cpp b/src/designer/src/components/signalsloteditor/signalsloteditor_plugin.cpp index 7e82cb6f6..6208df5ba 100644 --- a/src/designer/src/components/signalsloteditor/signalsloteditor_plugin.cpp +++ b/src/designer/src/components/signalsloteditor/signalsloteditor_plugin.cpp @@ -70,10 +70,10 @@ void SignalSlotEditorPlugin::initialize(QDesignerFormEditorInterface *core) Q_ASSERT(!isInitialized()); m_action = new QAction(tr("Edit Signals/Slots"), this); - m_action->setObjectName(QLatin1String("__qt_edit_signals_slots_action")); + m_action->setObjectName(QStringLiteral("__qt_edit_signals_slots_action")); m_action->setShortcut(tr("F4")); - QIcon icon = QIcon::fromTheme("designer-edit-signals", - QIcon(core->resourceLocation() + QLatin1String("/signalslottool.png"))); + QIcon icon = QIcon::fromTheme(QStringLiteral("designer-edit-signals"), + QIcon(core->resourceLocation() + QStringLiteral("/signalslottool.png"))); m_action->setIcon(icon); m_action->setEnabled(false); diff --git a/src/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp b/src/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp index 0b4056d2f..08b6e1180 100644 --- a/src/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp +++ b/src/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp @@ -737,11 +737,11 @@ SignalSlotEditorWindow::SignalSlotEditorWindow(QDesignerFormEditorInterface *cor QToolBar *toolBar = new QToolBar; toolBar->setIconSize(QSize(22, 22)); - m_add_button->setIcon(createIconSet(QLatin1String("plus.png"))); + m_add_button->setIcon(createIconSet(QStringLiteral("plus.png"))); connect(m_add_button, SIGNAL(clicked()), this, SLOT(addConnection())); toolBar->addWidget(m_add_button); - m_remove_button->setIcon(createIconSet(QLatin1String("minus.png"))); + m_remove_button->setIcon(createIconSet(QStringLiteral("minus.png"))); connect(m_remove_button, SIGNAL(clicked()), this, SLOT(removeConnection())); toolBar->addWidget(m_remove_button); diff --git a/src/designer/src/components/tabordereditor/tabordereditor.cpp b/src/designer/src/components/tabordereditor/tabordereditor.cpp index 875953ae1..af40a9f79 100644 --- a/src/designer/src/components/tabordereditor/tabordereditor.cpp +++ b/src/designer/src/components/tabordereditor/tabordereditor.cpp @@ -204,7 +204,7 @@ bool TabOrderEditor::skipWidget(QWidget *w) const QExtensionManager *ext = formWindow()->core()->extensionManager(); if (const QDesignerPropertySheetExtension *sheet = qt_extension<QDesignerPropertySheetExtension*>(ext, w)) { - const int index = sheet->indexOf(QLatin1String("focusPolicy")); + const int index = sheet->indexOf(QStringLiteral("focusPolicy")); if (index != -1) { bool ok = false; Qt::FocusPolicy q = (Qt::FocusPolicy) Utils::valueOf(sheet->property(index), &ok); diff --git a/src/designer/src/components/tabordereditor/tabordereditor_plugin.cpp b/src/designer/src/components/tabordereditor/tabordereditor_plugin.cpp index 72ffb83dc..f3e72a5a8 100644 --- a/src/designer/src/components/tabordereditor/tabordereditor_plugin.cpp +++ b/src/designer/src/components/tabordereditor/tabordereditor_plugin.cpp @@ -71,9 +71,9 @@ void TabOrderEditorPlugin::initialize(QDesignerFormEditorInterface *core) Q_ASSERT(!isInitialized()); m_action = new QAction(tr("Edit Tab Order"), this); - m_action->setObjectName(QLatin1String("_qt_edit_tab_order_action")); - QIcon icon = QIcon::fromTheme("designer-edit-tabs", - QIcon(core->resourceLocation() + QLatin1String("/tabordertool.png"))); + m_action->setObjectName(QStringLiteral("_qt_edit_tab_order_action")); + QIcon icon = QIcon::fromTheme(QStringLiteral("designer-edit-tabs"), + QIcon(core->resourceLocation() + QStringLiteral("/tabordertool.png"))); m_action->setIcon(icon); m_action->setEnabled(false); diff --git a/src/designer/src/components/taskmenu/button_taskmenu.cpp b/src/designer/src/components/taskmenu/button_taskmenu.cpp index 8cfbdec39..4c8e4688d 100644 --- a/src/designer/src/components/taskmenu/button_taskmenu.cpp +++ b/src/designer/src/components/taskmenu/button_taskmenu.cpp @@ -176,7 +176,7 @@ QString ButtonGroupCommand::nameList(const ButtonList& bl) { QString rc; const QChar quote = QLatin1Char('\''); - const QString separator = QLatin1String(", "); + const QString separator = QStringLiteral(", "); const int size = bl.size(); for (int i = 0; i < size; i++) { if (i) @@ -228,7 +228,7 @@ bool CreateButtonGroupCommand::init(const ButtonList &bl) return false; QDesignerFormWindowInterface *fw = formWindow(); QButtonGroup *buttonGroup = new QButtonGroup(fw->mainContainer()); - buttonGroup->setObjectName(QLatin1String("buttonGroup")); + buttonGroup->setObjectName(QStringLiteral("buttonGroup")); fw->ensureUniqueObjectName(buttonGroup); initialize(bl, buttonGroup); return true; @@ -396,7 +396,7 @@ protected: }; ButtonTextTaskMenuInlineEditor::ButtonTextTaskMenuInlineEditor(QAbstractButton *button, QObject *parent) : - TaskMenuInlineEditor(button, ValidationMultiLine, QLatin1String("text"), parent) + TaskMenuInlineEditor(button, ValidationMultiLine, QStringLiteral("text"), parent) { } @@ -419,7 +419,7 @@ protected: }; LinkDescriptionTaskMenuInlineEditor::LinkDescriptionTaskMenuInlineEditor(QAbstractButton *button, QObject *parent) : - TaskMenuInlineEditor(button, ValidationMultiLine, QLatin1String("description"), parent) + TaskMenuInlineEditor(button, ValidationMultiLine, QStringLiteral("description"), parent) { } diff --git a/src/designer/src/components/taskmenu/containerwidget_taskmenu.cpp b/src/designer/src/components/taskmenu/containerwidget_taskmenu.cpp index 4165e2d69..475735c5c 100644 --- a/src/designer/src/components/taskmenu/containerwidget_taskmenu.cpp +++ b/src/designer/src/components/taskmenu/containerwidget_taskmenu.cpp @@ -317,7 +317,7 @@ ContainerWidgetTaskMenuFactory::ContainerWidgetTaskMenuFactory(QDesignerFormEdit QObject *ContainerWidgetTaskMenuFactory::createExtension(QObject *object, const QString &iid, QObject *parent) const { - if (iid != QLatin1String("QDesignerInternalTaskMenuExtension") || !object->isWidgetType()) + if (iid != QStringLiteral("QDesignerInternalTaskMenuExtension") || !object->isWidgetType()) return 0; QWidget *widget = qobject_cast<QWidget*>(object); diff --git a/src/designer/src/components/taskmenu/groupbox_taskmenu.cpp b/src/designer/src/components/taskmenu/groupbox_taskmenu.cpp index 4c9d31911..196ae0269 100644 --- a/src/designer/src/components/taskmenu/groupbox_taskmenu.cpp +++ b/src/designer/src/components/taskmenu/groupbox_taskmenu.cpp @@ -63,7 +63,7 @@ protected: }; GroupBoxTaskMenuInlineEditor::GroupBoxTaskMenuInlineEditor(QGroupBox *w, QObject *parent) : - TaskMenuInlineEditor(w, ValidationSingleLine, QLatin1String("title"), parent) + TaskMenuInlineEditor(w, ValidationSingleLine, QStringLiteral("title"), parent) { } diff --git a/src/designer/src/components/taskmenu/inplace_editor.cpp b/src/designer/src/components/taskmenu/inplace_editor.cpp index 6bc7af36f..04bfc85db 100644 --- a/src/designer/src/components/taskmenu/inplace_editor.cpp +++ b/src/designer/src/components/taskmenu/inplace_editor.cpp @@ -66,7 +66,7 @@ InPlaceEditor::InPlaceEditor(QWidget *widget, m_InPlaceWidgetHelper(this, widget, fw) { setAlignment(m_InPlaceWidgetHelper.alignment()); - setObjectName(QLatin1String("__qt__passive_m_editor")); + setObjectName(QStringLiteral("__qt__passive_m_editor")); setText(text); selectAll(); diff --git a/src/designer/src/components/taskmenu/itemlisteditor.cpp b/src/designer/src/components/taskmenu/itemlisteditor.cpp index f01f1154b..a4db4d2a7 100644 --- a/src/designer/src/components/taskmenu/itemlisteditor.cpp +++ b/src/designer/src/components/taskmenu/itemlisteditor.cpp @@ -66,7 +66,7 @@ public: const QString widthSampleString = QCoreApplication::translate("ItemPropertyBrowser", "XX Icon Selected off"); m_width = fontMetrics().width(widthSampleString); setSplitterPosition(m_width); - m_width += fontMetrics().width(QLatin1String("/this/is/some/random/path")); + m_width += fontMetrics().width(QStringLiteral("/this/is/some/random/path")); } virtual QSize sizeHint() const @@ -138,16 +138,16 @@ void AbstractItemEditor::setupProperties(PropertyDefinition *propList) QtVariantProperty *prop = m_propertyManager->addProperty(type, QLatin1String(propList[i].name)); Q_ASSERT(prop); if (role == Qt::ToolTipPropertyRole || role == Qt::WhatsThisPropertyRole) - prop->setAttribute(QLatin1String("validationMode"), ValidationRichText); + prop->setAttribute(QStringLiteral("validationMode"), ValidationRichText); else if (role == Qt::DisplayPropertyRole) - prop->setAttribute(QLatin1String("validationMode"), ValidationMultiLine); + prop->setAttribute(QStringLiteral("validationMode"), ValidationMultiLine); else if (role == Qt::StatusTipPropertyRole) - prop->setAttribute(QLatin1String("validationMode"), ValidationSingleLine); + prop->setAttribute(QStringLiteral("validationMode"), ValidationSingleLine); else if (role == ItemFlagsShadowRole) - prop->setAttribute(QLatin1String("flagNames"), c2qStringList(itemFlagNames)); + prop->setAttribute(QStringLiteral("flagNames"), c2qStringList(itemFlagNames)); else if (role == Qt::CheckStateRole) - prop->setAttribute(QLatin1String("enumNames"), c2qStringList(checkStateNames)); - prop->setAttribute(QLatin1String("resettable"), true); + prop->setAttribute(QStringLiteral("enumNames"), c2qStringList(checkStateNames)); + prop->setAttribute(QStringLiteral("resettable"), true); m_properties.append(prop); m_rootProperties.append(prop); m_propertyToRole.insert(prop, role); diff --git a/src/designer/src/components/taskmenu/lineedit_taskmenu.cpp b/src/designer/src/components/taskmenu/lineedit_taskmenu.cpp index efbadc38d..8068474f8 100644 --- a/src/designer/src/components/taskmenu/lineedit_taskmenu.cpp +++ b/src/designer/src/components/taskmenu/lineedit_taskmenu.cpp @@ -63,7 +63,7 @@ protected: }; LineEditTaskMenuInlineEditor::LineEditTaskMenuInlineEditor(QLineEdit *w, QObject *parent) : - TaskMenuInlineEditor(w, ValidationSingleLine, QLatin1String("text"), parent) + TaskMenuInlineEditor(w, ValidationSingleLine, QStringLiteral("text"), parent) { } diff --git a/src/designer/src/components/taskmenu/tablewidgeteditor.cpp b/src/designer/src/components/taskmenu/tablewidgeteditor.cpp index 6e218776f..6ed15710e 100644 --- a/src/designer/src/components/taskmenu/tablewidgeteditor.cpp +++ b/src/designer/src/components/taskmenu/tablewidgeteditor.cpp @@ -63,10 +63,10 @@ TableWidgetEditor::TableWidgetEditor(QDesignerFormWindowInterface *form, QDialog : AbstractItemEditor(form, 0), m_updatingBrowser(false) { m_columnEditor = new ItemListEditor(form, this); - m_columnEditor->setObjectName(QLatin1String("columnEditor")); + m_columnEditor->setObjectName(QStringLiteral("columnEditor")); m_columnEditor->setNewItemText(tr("New Column")); m_rowEditor = new ItemListEditor(form, this); - m_rowEditor->setObjectName(QLatin1String("rowEditor")); + m_rowEditor->setObjectName(QStringLiteral("rowEditor")); m_rowEditor->setNewItemText(tr("New Row")); ui.setupUi(dialog); diff --git a/src/designer/src/components/taskmenu/taskmenu_component.cpp b/src/designer/src/components/taskmenu/taskmenu_component.cpp index 583298636..d3c6cd95c 100644 --- a/src/designer/src/components/taskmenu/taskmenu_component.cpp +++ b/src/designer/src/components/taskmenu/taskmenu_component.cpp @@ -68,7 +68,7 @@ TaskMenuComponent::TaskMenuComponent(QDesignerFormEditorInterface *core, QObject Q_ASSERT(m_core != 0); QExtensionManager *mgr = core->extensionManager(); - const QString taskMenuId = QLatin1String("QDesignerInternalTaskMenuExtension"); + const QString taskMenuId = QStringLiteral("QDesignerInternalTaskMenuExtension"); ButtonTaskMenuFactory::registerExtension(mgr, taskMenuId); CommandLinkButtonTaskMenuFactory::registerExtension(mgr, taskMenuId); // Order! diff --git a/src/designer/src/components/taskmenu/textedit_taskmenu.cpp b/src/designer/src/components/taskmenu/textedit_taskmenu.cpp index ea4ab0cbb..30dd3c0a0 100644 --- a/src/designer/src/components/taskmenu/textedit_taskmenu.cpp +++ b/src/designer/src/components/taskmenu/textedit_taskmenu.cpp @@ -54,7 +54,7 @@ namespace qdesigner_internal { TextEditTaskMenu::TextEditTaskMenu(QTextEdit *textEdit, QObject *parent) : QDesignerTaskMenu(textEdit, parent), m_format(Qt::RichText), - m_property(QLatin1String("html")), + m_property(QStringLiteral("html")), m_windowTitle(tr("Edit HTML")), m_editTextAction(new QAction(tr("Change HTML..."), this)) { @@ -64,7 +64,7 @@ TextEditTaskMenu::TextEditTaskMenu(QTextEdit *textEdit, QObject *parent) : TextEditTaskMenu::TextEditTaskMenu(QPlainTextEdit *textEdit, QObject *parent) : QDesignerTaskMenu(textEdit, parent), m_format(Qt::PlainText), - m_property(QLatin1String("plainText")), + m_property(QStringLiteral("plainText")), m_windowTitle(tr("Edit Text")), m_editTextAction(new QAction(tr("Change Plain Text..."), this)) { diff --git a/src/designer/src/components/taskmenu/treewidgeteditor.cpp b/src/designer/src/components/taskmenu/treewidgeteditor.cpp index 9c400519d..4706b9b03 100644 --- a/src/designer/src/components/taskmenu/treewidgeteditor.cpp +++ b/src/designer/src/components/taskmenu/treewidgeteditor.cpp @@ -64,7 +64,7 @@ TreeWidgetEditor::TreeWidgetEditor(QDesignerFormWindowInterface *form, QDialog * : AbstractItemEditor(form, 0), m_updatingBrowser(false) { m_columnEditor = new ItemListEditor(form, this); - m_columnEditor->setObjectName(QLatin1String("columnEditor")); + m_columnEditor->setObjectName(QStringLiteral("columnEditor")); m_columnEditor->setNewItemText(tr("New Column")); ui.setupUi(dialog); diff --git a/src/designer/src/components/widgetbox/widgetbox_dnditem.cpp b/src/designer/src/components/widgetbox/widgetbox_dnditem.cpp index a6f43ebd8..eebd60e88 100644 --- a/src/designer/src/components/widgetbox/widgetbox_dnditem.cpp +++ b/src/designer/src/components/widgetbox/widgetbox_dnditem.cpp @@ -97,7 +97,7 @@ WidgetBoxResource::WidgetBoxResource(QDesignerFormEditorInterface *core) : QWidget *WidgetBoxResource::createWidget(const QString &widgetName, QWidget *parentWidget, const QString &name) { - if (widgetName == QLatin1String("Spacer")) { + if (widgetName == QStringLiteral("Spacer")) { Spacer *spacer = new Spacer(parentWidget); spacer->setObjectName(name); return spacer; @@ -138,7 +138,7 @@ void WidgetBoxResource::createCustomWidgets(DomCustomWidgets *dc) static QSize geometryProp(const DomWidget *dw) { const QList<DomProperty*> prop_list = dw->elementProperty(); - const QString geometry = QLatin1String("geometry"); + const QString geometry = QStringLiteral("geometry"); foreach (DomProperty *prop, prop_list) { if (prop->attributeName() != geometry) continue; diff --git a/src/designer/src/components/widgetbox/widgetboxcategorylistview.cpp b/src/designer/src/components/widgetbox/widgetboxcategorylistview.cpp index ab9968a6d..8fa28b3a0 100644 --- a/src/designer/src/components/widgetbox/widgetboxcategorylistview.cpp +++ b/src/designer/src/components/widgetbox/widgetboxcategorylistview.cpp @@ -157,7 +157,7 @@ private: WidgetBoxCategoryModel::WidgetBoxCategoryModel(QDesignerFormEditorInterface *core, QObject *parent) : QAbstractListModel(parent), - m_classNameRegExp(QLatin1String("<widget +class *= *\"([^\"]+)\"")), + m_classNameRegExp(QStringLiteral("<widget +class *= *\"([^\"]+)\"")), m_core(core), m_viewMode(QListView::ListMode) { @@ -217,7 +217,7 @@ void WidgetBoxCategoryModel::addWidget(const QDesignerWidgetBoxInterface::Widget { // build item. Filter on name + class name if it is different and not a layout. QString filter = widget.name(); - if (!filter.contains(QLatin1String("Layout")) && m_classNameRegExp.indexIn(widget.domXml()) != -1) { + if (!filter.contains(QStringLiteral("Layout")) && m_classNameRegExp.indexIn(widget.domXml()) != -1) { const QString className = m_classNameRegExp.cap(1); if (!filter.contains(className)) filter += className; @@ -359,7 +359,7 @@ QWidget *WidgetBoxCategoryEntryDelegate::createEditor(QWidget *parent, { QWidget *result = QItemDelegate::createEditor(parent, option, index); if (QLineEdit *line_edit = qobject_cast<QLineEdit*>(result)) { - const QRegExp re = QRegExp(QLatin1String("[_a-zA-Z][_a-zA-Z0-9]*")); + const QRegExp re = QRegExp(QStringLiteral("[_a-zA-Z][_a-zA-Z0-9]*")); Q_ASSERT(re.isValid()); line_edit->setValidator(new QRegExpValidator(re, line_edit)); } @@ -483,9 +483,9 @@ QString WidgetBoxCategoryListView::widgetDomXml(const QDesignerWidgetBoxInterfac if (domXml.isEmpty()) { domXml = QLatin1String(uiOpeningTagC); - domXml += QLatin1String("<widget class=\""); + domXml += QStringLiteral("<widget class=\""); domXml += widget.name(); - domXml += QLatin1String("\"/>"); + domXml += QStringLiteral("\"/>"); domXml += QLatin1String(uiClosingTagC); } return domXml; diff --git a/src/designer/src/components/widgetbox/widgetboxtreewidget.cpp b/src/designer/src/components/widgetbox/widgetboxtreewidget.cpp index 57f0d48c7..06ae25aa1 100644 --- a/src/designer/src/components/widgetbox/widgetboxtreewidget.cpp +++ b/src/designer/src/components/widgetbox/widgetboxtreewidget.cpp @@ -154,8 +154,8 @@ void WidgetBoxTreeWidget::saveExpandedState() const } QDesignerSettingsInterface *settings = m_core->settingsManager(); settings->beginGroup(QLatin1String(widgetBoxRootElementC)); - settings->setValue(QLatin1String("Closed categories"), closedCategories); - settings->setValue(QLatin1String("View mode"), m_iconMode); + settings->setValue(QStringLiteral("Closed categories"), closedCategories); + settings->setValue(QStringLiteral("View mode"), m_iconMode); settings->endGroup(); } @@ -163,9 +163,9 @@ void WidgetBoxTreeWidget::restoreExpandedState() { typedef QSet<QString> StringSet; QDesignerSettingsInterface *settings = m_core->settingsManager(); - m_iconMode = settings->value(QLatin1String("WidgetBox/View mode")).toBool(); + m_iconMode = settings->value(QStringLiteral("WidgetBox/View mode")).toBool(); updateViewMode(); - const StringSet closedCategories = settings->value(QLatin1String("WidgetBox/Closed categories"), QStringList()).toStringList().toSet(); + const StringSet closedCategories = settings->value(QStringLiteral("WidgetBox/Closed categories"), QStringList()).toStringList().toSet(); expandAll(); if (closedCategories.empty()) return; diff --git a/src/designer/src/designer/assistantclient.cpp b/src/designer/src/designer/assistantclient.cpp index a1d4a0764..80658079f 100644 --- a/src/designer/src/designer/assistantclient.cpp +++ b/src/designer/src/designer/assistantclient.cpp @@ -71,21 +71,21 @@ AssistantClient::~AssistantClient() bool AssistantClient::showPage(const QString &path, QString *errorMessage) { - QString cmd = QLatin1String("SetSource "); + QString cmd = QStringLiteral("SetSource "); cmd += path; return sendCommand(cmd, errorMessage); } bool AssistantClient::activateIdentifier(const QString &identifier, QString *errorMessage) { - QString cmd = QLatin1String("ActivateIdentifier "); + QString cmd = QStringLiteral("ActivateIdentifier "); cmd += identifier; return sendCommand(cmd, errorMessage); } bool AssistantClient::activateKeyword(const QString &keyword, QString *errorMessage) { - QString cmd = QLatin1String("ActivateKeyword "); + QString cmd = QStringLiteral("ActivateKeyword "); cmd += keyword; return sendCommand(cmd, errorMessage); } @@ -114,13 +114,13 @@ QString AssistantClient::binary() { QString app = QLibraryInfo::location(QLibraryInfo::BinariesPath) + QDir::separator(); #if !defined(Q_OS_MAC) - app += QLatin1String("assistant"); + app += QStringLiteral("assistant"); #else - app += QLatin1String("Assistant.app/Contents/MacOS/Assistant"); + app += QStringLiteral("Assistant.app/Contents/MacOS/Assistant"); #endif #if defined(Q_OS_WIN) - app += QLatin1String(".exe"); + app += QStringLiteral(".exe"); #endif return app; @@ -142,7 +142,7 @@ bool AssistantClient::ensureRunning(QString *errorMessage) if (debugAssistantClient) qDebug() << "Running " << app; // run - QStringList args(QLatin1String("-enableRemoteControl")); + QStringList args(QStringLiteral("-enableRemoteControl")); m_process->start(app, args); if (!m_process->waitForStarted()) { *errorMessage = QCoreApplication::translate("AssistantClient", "Unable to launch assistant (%1).").arg(app); @@ -156,20 +156,20 @@ QString AssistantClient::documentUrl(const QString &prefix, int qtVersion) if (qtVersion == 0) qtVersion = QT_VERSION; QString rc; - QTextStream(&rc) << QLatin1String("qthelp://com.trolltech.") << prefix << QLatin1Char('.') + QTextStream(&rc) << QStringLiteral("qthelp://com.trolltech.") << prefix << QLatin1Char('.') << (qtVersion >> 16) << ((qtVersion >> 8) & 0xFF) << (qtVersion & 0xFF) - << QLatin1String("/qdoc/"); + << QStringLiteral("/qdoc/"); return rc; } QString AssistantClient::designerManualUrl(int qtVersion) { - return documentUrl(QLatin1String("designer"), qtVersion); + return documentUrl(QStringLiteral("designer"), qtVersion); } QString AssistantClient::qtReferenceManualUrl(int qtVersion) { - return documentUrl(QLatin1String("qt"), qtVersion); + return documentUrl(QStringLiteral("qt"), qtVersion); } QT_END_NAMESPACE diff --git a/src/designer/src/designer/mainwindow.cpp b/src/designer/src/designer/mainwindow.cpp index 771e633eb..cde1e7685 100644 --- a/src/designer/src/designer/mainwindow.cpp +++ b/src/designer/src/designer/mainwindow.cpp @@ -118,16 +118,16 @@ QList<QToolBar *> MainWindowBase::createToolBars(const QDesignerActions *action QList<QToolBar *> rc; if (singleToolBar) { //: Not currently used (main tool bar) - QToolBar *main = createToolBar(tr("Main"), QLatin1String("mainToolBar"), actions->fileActions()->actions()); + QToolBar *main = createToolBar(tr("Main"), QStringLiteral("mainToolBar"), actions->fileActions()->actions()); addActionsToToolBar(actions->editActions()->actions(), main); addActionsToToolBar(actions->toolActions()->actions(), main); addActionsToToolBar(actions->formActions()->actions(), main); rc.push_back(main); } else { - rc.push_back(createToolBar(tr("File"), QLatin1String("fileToolBar"), actions->fileActions()->actions())); - rc.push_back(createToolBar(tr("Edit"), QLatin1String("editToolBar"), actions->editActions()->actions())); - rc.push_back(createToolBar(tr("Tools"), QLatin1String("toolsToolBar"), actions->toolActions()->actions())); - rc.push_back(createToolBar(tr("Form"), QLatin1String("formToolBar"), actions->formActions()->actions())); + rc.push_back(createToolBar(tr("File"), QStringLiteral("fileToolBar"), actions->fileActions()->actions())); + rc.push_back(createToolBar(tr("Edit"), QStringLiteral("editToolBar"), actions->editActions()->actions())); + rc.push_back(createToolBar(tr("Tools"), QStringLiteral("toolsToolBar"), actions->toolActions()->actions())); + rc.push_back(createToolBar(tr("Form"), QStringLiteral("formToolBar"), actions->formActions()->actions())); } return rc; } @@ -227,7 +227,7 @@ ToolBarManager::ToolBarManager(QMainWindow *configureableMainWindow, m_toolbars(toolbars) { m_configureAction->setMenuRole(QAction::NoRole); - m_configureAction->setObjectName(QLatin1String("__qt_configure_tool_bars_action")); + m_configureAction->setObjectName(QStringLiteral("__qt_configure_tool_bars_action")); connect(m_configureAction, SIGNAL(triggered()), this, SLOT(configureToolBars())); m_manager->setMainWindow(configureableMainWindow); @@ -318,7 +318,7 @@ DockedMainWindow::DockedMainWindow(QDesignerWorkbench *wb, const QList<QDesignerToolWindow*> &toolWindows) : m_toolBarManager(0) { - setObjectName(QLatin1String("MDIWindow")); + setObjectName(QStringLiteral("MDIWindow")); setWindowTitle(mainWindowTitle()); const QList<QToolBar *> toolbars = createToolBars(wb->actionManager(), false); @@ -379,7 +379,7 @@ DockedMainWindow::DockWidgetList DockedMainWindow::addToolWindows(const Designer DockWidgetList rc; foreach (QDesignerToolWindow *tw, tls) { QDockWidget *dockWidget = new QDockWidget; - dockWidget->setObjectName(tw->objectName() + QLatin1String("_dock")); + dockWidget->setObjectName(tw->objectName() + QStringLiteral("_dock")); dockWidget->setWindowTitle(tw->windowTitle()); addDockWidget(tw->dockWidgetAreaHint(), dockWidget); dockWidget->setWidget(tw); diff --git a/src/designer/src/designer/newform.cpp b/src/designer/src/designer/newform.cpp index 1b04f6aa8..27b07523b 100644 --- a/src/designer/src/designer/newform.cpp +++ b/src/designer/src/designer/newform.cpp @@ -142,7 +142,7 @@ void NewForm::recentFileChosen() QAction *action = qobject_cast<QAction *>(sender()); if (!action) return; - if (action->objectName() == QLatin1String("__qt_action_clear_menu_")) + if (action->objectName() == QStringLiteral("__qt_action_clear_menu_")) return; close(); } @@ -198,7 +198,7 @@ bool NewForm::openTemplate(QString *ptrToErrorMessage) QString tempPattern = QDir::tempPath(); if (!tempPattern.endsWith(QDir::separator())) // platform-dependant tempPattern += QDir::separator(); - tempPattern += QLatin1String("XXXXXX.ui"); + tempPattern += QStringLiteral("XXXXXX.ui"); QTemporaryFile tempFormFile(tempPattern); tempFormFile.setAutoRemove(true); diff --git a/src/designer/src/designer/qdesigner.cpp b/src/designer/src/designer/qdesigner.cpp index 66af42b12..282dcaac3 100644 --- a/src/designer/src/designer/qdesigner.cpp +++ b/src/designer/src/designer/qdesigner.cpp @@ -89,12 +89,12 @@ QDesigner::QDesigner(int &argc, char **argv) m_client(0), m_workbench(0), m_suppressNewFormShow(false) { - setOrganizationName(QLatin1String("Trolltech")); + setOrganizationName(QStringLiteral("Trolltech")); setApplicationName(QLatin1String(designerApplicationName)); QDesignerComponents::initializeResources(); #ifndef Q_WS_MAC - setWindowIcon(QIcon(QLatin1String(":/trolltech/designer/images/designer.png"))); + setWindowIcon(QIcon(QStringLiteral(":/trolltech/designer/images/designer.png"))); #endif initialize(); } @@ -172,13 +172,13 @@ bool QDesigner::parseCommandLineArgs(QStringList &fileNames, QString &resourceDi break; } // Options - if (argument == QLatin1String("-server")) { + if (argument == QStringLiteral("-server")) { m_server = new QDesignerServer(); printf("%d\n", m_server->serverPort()); fflush(stdout); break; } - if (argument == QLatin1String("-client")) { + if (argument == QStringLiteral("-client")) { bool ok = true; if (++it == acend) { qWarning("** WARNING The option -client requires an argument"); @@ -193,7 +193,7 @@ bool QDesigner::parseCommandLineArgs(QStringList &fileNames, QString &resourceDi } break; } - if (argument == QLatin1String("-resourcedir")) { + if (argument == QStringLiteral("-resourcedir")) { if (++it == acend) { qWarning("** WARNING The option -resourcedir requires an argument"); return false; @@ -201,7 +201,7 @@ bool QDesigner::parseCommandLineArgs(QStringList &fileNames, QString &resourceDi resourceDir = QFile::decodeName(it->toLocal8Bit()); break; } - if (argument == QLatin1String("-enableinternaldynamicproperties")) { + if (argument == QStringLiteral("-enableinternaldynamicproperties")) { QDesignerPropertySheet::setInternalDynamicPropertiesEnabled(true); break; } @@ -223,17 +223,17 @@ void QDesigner::initialize() QTranslator *qtTranslator = new QTranslator(this); const QString localSysName = QLocale::system().name(); - QString translatorFileName = QLatin1String("designer_"); + QString translatorFileName = QStringLiteral("designer_"); translatorFileName += localSysName; translator->load(translatorFileName, resourceDir); - translatorFileName = QLatin1String("qt_"); + translatorFileName = QStringLiteral("qt_"); translatorFileName += localSysName; qtTranslator->load(translatorFileName, resourceDir); installTranslator(translator); installTranslator(qtTranslator); - if (QLibraryInfo::licensedProducts() == QLatin1String("Console")) { + if (QLibraryInfo::licensedProducts() == QStringLiteral("Console")) { QMessageBox::information(0, tr("Qt Designer"), tr("This application cannot be used for the Console edition of Qt")); QMetaObject::invokeMethod(this, "quit", Qt::QueuedConnection); diff --git a/src/designer/src/designer/qdesigner_actions.cpp b/src/designer/src/designer/qdesigner_actions.cpp index 464569682..1bd06a6e3 100644 --- a/src/designer/src/designer/qdesigner_actions.cpp +++ b/src/designer/src/designer/qdesigner_actions.cpp @@ -177,9 +177,9 @@ QDesignerActions::QDesignerActions(QDesignerWorkbench *workbench) m_helpActions(0), m_styleActions(0), m_editWidgetsAction(new QAction(tr("Edit Widgets"), this)), - m_newFormAction(new QAction(qdesigner_internal::createIconSet(QLatin1String("filenew.png")), tr("&New..."), this)), - m_openFormAction(new QAction(qdesigner_internal::createIconSet(QLatin1String("fileopen.png")), tr("&Open..."), this)), - m_saveFormAction(new QAction(qdesigner_internal::createIconSet(QLatin1String("filesave.png")), tr("&Save"), this)), + m_newFormAction(new QAction(qdesigner_internal::createIconSet(QStringLiteral("filenew.png")), tr("&New..."), this)), + m_openFormAction(new QAction(qdesigner_internal::createIconSet(QStringLiteral("fileopen.png")), tr("&Open..."), this)), + m_saveFormAction(new QAction(qdesigner_internal::createIconSet(QStringLiteral("filesave.png")), tr("&Save"), this)), m_saveFormAsAction(new QAction(tr("Save &As..."), this)), m_saveAllFormsAction(new QAction(tr("Save A&ll"), this)), m_saveFormAsTemplateAction(new QAction(tr("Save As &Template..."), this)), @@ -220,20 +220,20 @@ QDesignerActions::QDesignerActions(QDesignerWorkbench *workbench) connect(ifwm, SIGNAL(formWindowSettingsChanged(QDesignerFormWindowInterface*)), this, SLOT(formWindowSettingsChanged(QDesignerFormWindowInterface*))); - m_editWidgetsAction->setObjectName(QLatin1String("__qt_edit_widgets_action")); - m_newFormAction->setObjectName(QLatin1String("__qt_new_form_action")); - m_openFormAction->setObjectName(QLatin1String("__qt_open_form_action")); - m_saveFormAction->setObjectName(QLatin1String("__qt_save_form_action")); - m_saveFormAsAction->setObjectName(QLatin1String("__qt_save_form_as_action")); - m_saveAllFormsAction->setObjectName(QLatin1String("__qt_save_all_forms_action")); - m_saveFormAsTemplateAction->setObjectName(QLatin1String("__qt_save_form_as_template_action")); - m_closeFormAction->setObjectName(QLatin1String("__qt_close_form_action")); - m_quitAction->setObjectName(QLatin1String("__qt_quit_action")); - m_previewFormAction->setObjectName(QLatin1String("__qt_preview_form_action")); - m_viewCodeAction->setObjectName(QLatin1String("__qt_preview_code_action")); - m_minimizeAction->setObjectName(QLatin1String("__qt_minimize_action")); - m_bringAllToFrontAction->setObjectName(QLatin1String("__qt_bring_all_to_front_action")); - m_preferencesAction->setObjectName(QLatin1String("__qt_preferences_action")); + m_editWidgetsAction->setObjectName(QStringLiteral("__qt_edit_widgets_action")); + m_newFormAction->setObjectName(QStringLiteral("__qt_new_form_action")); + m_openFormAction->setObjectName(QStringLiteral("__qt_open_form_action")); + m_saveFormAction->setObjectName(QStringLiteral("__qt_save_form_action")); + m_saveFormAsAction->setObjectName(QStringLiteral("__qt_save_form_as_action")); + m_saveAllFormsAction->setObjectName(QStringLiteral("__qt_save_all_forms_action")); + m_saveFormAsTemplateAction->setObjectName(QStringLiteral("__qt_save_form_as_template_action")); + m_closeFormAction->setObjectName(QStringLiteral("__qt_close_form_action")); + m_quitAction->setObjectName(QStringLiteral("__qt_quit_action")); + m_previewFormAction->setObjectName(QStringLiteral("__qt_preview_form_action")); + m_viewCodeAction->setObjectName(QStringLiteral("__qt_preview_code_action")); + m_minimizeAction->setObjectName(QStringLiteral("__qt_minimize_action")); + m_bringAllToFrontAction->setObjectName(QStringLiteral("__qt_bring_all_to_front_action")); + m_preferencesAction->setObjectName(QStringLiteral("__qt_preferences_action")); m_helpActions = createHelpActions(); @@ -281,10 +281,10 @@ QDesignerActions::QDesignerActions(QDesignerWorkbench *workbench) m_printPreviewAction->setShortcut(QKeySequence::Print); connect(m_printPreviewAction, SIGNAL(triggered()), this, SLOT(printPreviewImage())); m_fileActions->addAction(m_printPreviewAction); - m_printPreviewAction->setObjectName(QLatin1String("__qt_print_action")); + m_printPreviewAction->setObjectName(QStringLiteral("__qt_print_action")); connect(m_savePreviewImageAction, SIGNAL(triggered()), this, SLOT(savePreviewImage())); - m_savePreviewImageAction->setObjectName(QLatin1String("__qt_saveimage_action")); + m_savePreviewImageAction->setObjectName(QStringLiteral("__qt_saveimage_action")); m_fileActions->addAction(m_savePreviewImageAction); m_fileActions->addAction(createSeparator(this)); @@ -304,12 +304,12 @@ QDesignerActions::QDesignerActions(QDesignerWorkbench *workbench) // edit actions // QAction *undoAction = formWindowManager->action(QDesignerFormWindowManagerInterface::UndoAction); - undoAction->setObjectName(QLatin1String("__qt_undo_action")); + undoAction->setObjectName(QStringLiteral("__qt_undo_action")); undoAction->setShortcut(QKeySequence::Undo); m_editActions->addAction(undoAction); QAction *redoAction = formWindowManager->action(QDesignerFormWindowManagerInterface::RedoAction); - redoAction->setObjectName(QLatin1String("__qt_redo_action")); + redoAction->setObjectName(QStringLiteral("__qt_redo_action")); redoAction->setShortcut(QKeySequence::Redo); m_editActions->addAction(redoAction); @@ -341,7 +341,7 @@ QDesignerActions::QDesignerActions(QDesignerWorkbench *workbench) shortcuts.append(QKeySequence(Qt::Key_Escape)); #endif m_editWidgetsAction->setShortcuts(shortcuts); - QIcon fallback(m_core->resourceLocation() + QLatin1String("/widgettool.png")); + QIcon fallback(m_core->resourceLocation() + QStringLiteral("/widgettool.png")); m_editWidgetsAction->setIcon(QIcon::fromTheme("designer-edit-widget", fallback)); connect(m_editWidgetsAction, SIGNAL(triggered()), this, SLOT(editWidgetsSlot())); m_editWidgetsAction->setChecked(true); @@ -445,41 +445,41 @@ QActionGroup *QDesignerActions::createHelpActions() #ifndef QT_JAMBI_BUILD QAction *mainHelpAction = new QAction(tr("Qt Designer &Help"), this); - mainHelpAction->setObjectName(QLatin1String("__qt_designer_help_action")); + mainHelpAction->setObjectName(QStringLiteral("__qt_designer_help_action")); connect(mainHelpAction, SIGNAL(triggered()), this, SLOT(showDesignerHelp())); mainHelpAction->setShortcut(Qt::CTRL + Qt::Key_Question); helpActions->addAction(mainHelpAction); helpActions->addAction(createSeparator(this)); QAction *widgetHelp = new QAction(tr("Current Widget Help"), this); - widgetHelp->setObjectName(QLatin1String("__qt_current_widget_help_action")); + widgetHelp->setObjectName(QStringLiteral("__qt_current_widget_help_action")); widgetHelp->setShortcut(Qt::Key_F1); connect(widgetHelp, SIGNAL(triggered()), this, SLOT(showWidgetSpecificHelp())); helpActions->addAction(widgetHelp); helpActions->addAction(createSeparator(this)); QAction *whatsNewAction = new QAction(tr("What's New in Qt Designer?"), this); - whatsNewAction->setObjectName(QLatin1String("__qt_whats_new_in_qt_designer_action")); + whatsNewAction->setObjectName(QStringLiteral("__qt_whats_new_in_qt_designer_action")); connect(whatsNewAction, SIGNAL(triggered()), this, SLOT(showWhatsNew())); helpActions->addAction(whatsNewAction); #endif helpActions->addAction(createSeparator(this)); QAction *aboutPluginsAction = new QAction(tr("About Plugins"), this); - aboutPluginsAction->setObjectName(QLatin1String("__qt_about_plugins_action")); + aboutPluginsAction->setObjectName(QStringLiteral("__qt_about_plugins_action")); aboutPluginsAction->setMenuRole(QAction::ApplicationSpecificRole); connect(aboutPluginsAction, SIGNAL(triggered()), m_core->formWindowManager(), SLOT(showPluginDialog())); helpActions->addAction(aboutPluginsAction); QAction *aboutDesignerAction = new QAction(tr("About Qt Designer"), this); aboutDesignerAction->setMenuRole(QAction::AboutRole); - aboutDesignerAction->setObjectName(QLatin1String("__qt_about_designer_action")); + aboutDesignerAction->setObjectName(QStringLiteral("__qt_about_designer_action")); connect(aboutDesignerAction, SIGNAL(triggered()), this, SLOT(aboutDesigner())); helpActions->addAction(aboutDesignerAction); QAction *aboutQtAction = new QAction(tr("About Qt"), this); aboutQtAction->setMenuRole(QAction::AboutQtRole); - aboutQtAction->setObjectName(QLatin1String("__qt_about_qt_action")); + aboutQtAction->setObjectName(QStringLiteral("__qt_about_qt_action")); connect(aboutQtAction, SIGNAL(triggered()), qApp, SLOT(aboutQt())); helpActions->addAction(aboutQtAction); return helpActions; @@ -498,7 +498,7 @@ QString QDesignerActions::uiExtension() const = qt_extension<QDesignerLanguageExtension *>(m_core->extensionManager(), m_core); if (lang) return lang->uiExtension(); - return QLatin1String("ui"); + return QStringLiteral("ui"); } QAction *QDesignerActions::createRecentFilesMenu() @@ -516,7 +516,7 @@ QAction *QDesignerActions::createRecentFilesMenu() updateRecentFileActions(); menu->addSeparator(); act = new QAction(QIcon::fromTheme("edit-clear"), tr("Clear &Menu"), this); - act->setObjectName(QLatin1String("__qt_action_clear_menu_")); + act->setObjectName(QStringLiteral("__qt_action_clear_menu_")); connect(act, SIGNAL(triggered()), this, SLOT(clearRecentFiles())); m_recentFilesActions->addAction(act); menu->addAction(act); @@ -632,7 +632,7 @@ bool QDesignerActions::saveFormAs(QDesignerFormWindowInterface *fw) dir = QDir::current().absolutePath(); } while (false); dir += QDir::separator(); - dir += QLatin1String("untitled."); + dir += QStringLiteral("untitled."); dir += extension; } @@ -657,7 +657,7 @@ void QDesignerActions::saveAllForms() QString fileNames; QDesignerFormWindowManagerInterface *formWindowManager = core()->formWindowManager(); if (const int totalWindows = formWindowManager->formWindowCount()) { - const QString separator = QLatin1String(", "); + const QString separator = QStringLiteral(", "); for (int i = 0; i < totalWindows; ++i) { QDesignerFormWindowInterface *fw = formWindowManager->formWindow(i); if (fw && fw->isDirty()) { @@ -824,7 +824,7 @@ bool QDesignerActions::readInForm(const QString &fileName) static QString createBackup(const QString &fileName) { - const QString suffix = QLatin1String(".bak"); + const QString suffix = QStringLiteral(".bak"); QString backupFile = fileName + suffix; QFileInfo fi(backupFile); int i = 0; @@ -856,13 +856,13 @@ bool QDesignerActions::writeOutForm(QDesignerFormWindowInterface *fw, const QStr if (check) { const QStringList problems = fw->checkContents(); if (!problems.isEmpty()) - QMessageBox::information(fw->window(), tr("Qt Designer"), problems.join(QLatin1String("<br>"))); + QMessageBox::information(fw->window(), tr("Qt Designer"), problems.join(QStringLiteral("<br>"))); } QString contents = fw->contents(); if (qdesigner_internal::FormWindowBase *fwb = qobject_cast<qdesigner_internal::FormWindowBase *>(fw)) { if (fwb->lineTerminatorMode() == qdesigner_internal::FormWindowBase::CRLFLineTerminator) - contents.replace(QLatin1Char('\n'), QLatin1String("\r\n")); + contents.replace(QLatin1Char('\n'), QStringLiteral("\r\n")); } const QByteArray utf8Array = contents.toUtf8(); m_workbench->updateBackup(fw); @@ -892,7 +892,7 @@ bool QDesignerActions::writeOutForm(QDesignerFormWindowInterface *fw, const QStr QString extension = uiExtension(); const QString fileName = QFileDialog::getSaveFileName(fw, tr("Save Form As"), QDir::current().absolutePath(), - QLatin1String("*.") + extension); + QStringLiteral("*.") + extension); if (fileName.isEmpty()) { removeBackup(backupFile); return false; @@ -1050,14 +1050,14 @@ QAction *QDesignerActions::minimizeAction() const void QDesignerActions::showDesignerHelp() { QString url = AssistantClient::designerManualUrl(); - url += QLatin1String("designer-manual.html"); + url += QStringLiteral("designer-manual.html"); showHelp(url); } void QDesignerActions::showWhatsNew() { QString url = AssistantClient::qtReferenceManualUrl(); - url += QLatin1String("qt4-designer.html"); + url += QStringLiteral("qt4-designer.html"); showHelp(url); } @@ -1080,9 +1080,9 @@ void QDesignerActions::aboutDesigner() VersionDialog mb(core()->topLevel()); mb.setWindowTitle(tr("About Qt Designer")); if (mb.exec()) { - QMessageBox messageBox(QMessageBox::Information, QLatin1String("Easter Egg"), - QLatin1String("Easter Egg"), QMessageBox::Ok, core()->topLevel()); - messageBox.setInformativeText(QLatin1String("The Easter Egg has been removed.")); + QMessageBox messageBox(QMessageBox::Information, QStringLiteral("Easter Egg"), + QStringLiteral("Easter Egg"), QMessageBox::Ok, core()->topLevel()); + messageBox.setInformativeText(QStringLiteral("The Easter Egg has been removed.")); messageBox.exec(); } } @@ -1132,7 +1132,7 @@ void QDesignerActions::backupForms() QString formBackupName; QTextStream(&formBackupName) << m_backupPath << QDir::separator() - << QLatin1String("backup") << i << QLatin1String(".bak"); + << QStringLiteral("backup") << i << QStringLiteral(".bak"); QString fwn = QDir::convertSeparators(fwi->fileName()); if (fwn.isEmpty()) @@ -1145,7 +1145,7 @@ void QDesignerActions::backupForms() QString contents = fixResourceFileBackupPath(fwi, backupDir); if (qdesigner_internal::FormWindowBase *fwb = qobject_cast<qdesigner_internal::FormWindowBase *>(fwi)) { if (fwb->lineTerminatorMode() == qdesigner_internal::FormWindowBase::CRLFLineTerminator) - contents.replace(QLatin1Char('\n'), QLatin1String("\r\n")); + contents.replace(QLatin1Char('\n'), QStringLiteral("\r\n")); } const QByteArray utf8Array = contents.toUtf8(); if (file.write(utf8Array, utf8Array.size()) != utf8Array.size()) { @@ -1183,11 +1183,11 @@ void QDesignerActions::backupForms() QString QDesignerActions::fixResourceFileBackupPath(QDesignerFormWindowInterface *fwi, const QDir& backupDir) { const QString content = fwi->contents(); - QDomDocument domDoc(QLatin1String("backup")); + QDomDocument domDoc(QStringLiteral("backup")); if(!domDoc.setContent(content)) return content; - const QDomNodeList list = domDoc.elementsByTagName(QLatin1String("resources")); + const QDomNodeList list = domDoc.elementsByTagName(QStringLiteral("resources")); if (list.isEmpty()) return content; @@ -1195,14 +1195,14 @@ QString QDesignerActions::fixResourceFileBackupPath(QDesignerFormWindowInterface const QDomNode node = list.at(i); if (!node.isNull()) { const QDomElement element = node.toElement(); - if(!element.isNull() && element.tagName() == QLatin1String("resources")) { + if(!element.isNull() && element.tagName() == QStringLiteral("resources")) { QDomNode childNode = element.firstChild(); while (!childNode.isNull()) { QDomElement childElement = childNode.toElement(); - if(!childElement.isNull() && childElement.tagName() == QLatin1String("include")) { - const QString attr = childElement.attribute(QLatin1String("location")); + if(!childElement.isNull() && childElement.tagName() == QStringLiteral("include")) { + const QString attr = childElement.attribute(QStringLiteral("location")); const QString path = fwi->absoluteDir().absoluteFilePath(attr); - childElement.setAttribute(QLatin1String("location"), backupDir.relativeFilePath(path)); + childElement.setAttribute(QStringLiteral("location"), backupDir.relativeFilePath(path)); } childNode = childNode.nextSibling(); } @@ -1262,14 +1262,14 @@ bool QDesignerActions::ensureBackupDirectories() { // create names m_backupPath = QDir::homePath(); m_backupPath += QDir::separator(); - m_backupPath += QLatin1String(".designer"); + m_backupPath += QStringLiteral(".designer"); m_backupPath += QDir::separator(); - m_backupPath += QLatin1String("backup"); + m_backupPath += QStringLiteral("backup"); m_backupPath = QDir::convertSeparators(m_backupPath ); m_backupTmpPath = m_backupPath; m_backupTmpPath += QDir::separator(); - m_backupTmpPath += QLatin1String("tmp"); + m_backupTmpPath += QStringLiteral("tmp"); m_backupTmpPath = QDir::convertSeparators(m_backupTmpPath); } diff --git a/src/designer/src/designer/qdesigner_formwindow.cpp b/src/designer/src/designer/qdesigner_formwindow.cpp index 5434afd6e..3f72a17f9 100644 --- a/src/designer/src/designer/qdesigner_formwindow.cpp +++ b/src/designer/src/designer/qdesigner_formwindow.cpp @@ -110,7 +110,7 @@ void QDesignerFormWindow::changeEvent(QEvent *e) { switch (e->type()) { case QEvent::WindowTitleChange: - m_action->setText(windowTitle().remove(QLatin1String("[*]"))); + m_action->setText(windowTitle().remove(QStringLiteral("[*]"))); break; case QEvent::WindowIconChange: m_action->setIcon(windowIcon()); @@ -174,7 +174,7 @@ int QDesignerFormWindow::getNumberOfUntitledWindows() const // Find the number of untitled windows excluding ourselves. // Do not fall for 'untitled.ui', match with modified place holder. // This will cause some problems with i18n, but for now I need the string to be "static" - QRegExp rx(QLatin1String("untitled( (\\d+))?\\[\\*\\]")); + QRegExp rx(QStringLiteral("untitled( (\\d+))?\\[\\*\\]")); for (int i = 0; i < totalWindows; ++i) { QDesignerFormWindow *fw = m_workbench->formWindow(i); if (fw != this) { @@ -203,7 +203,7 @@ void QDesignerFormWindow::updateWindowTitle(const QString &fileName) QString fileNameTitle; if (fileName.isEmpty()) { - fileNameTitle = QLatin1String("untitled"); + fileNameTitle = QStringLiteral("untitled"); if (const int maxUntitled = getNumberOfUntitledWindows()) { fileNameTitle += QLatin1Char(' '); fileNameTitle += QString::number(maxUntitled + 1); @@ -278,7 +278,7 @@ void QDesignerFormWindow::geometryChanged() QObject *object = core->propertyEditor()->object(); if (object == 0 || !object->isWidgetType()) return; - static const QString geometryProperty = QLatin1String("geometry"); + static const QString geometryProperty = QStringLiteral("geometry"); const QDesignerPropertySheetExtension *sheet = qt_extension<QDesignerPropertySheetExtension*>(core->extensionManager(), object); const int geometryIndex = sheet->indexOf(geometryProperty); if (geometryIndex == -1) diff --git a/src/designer/src/designer/qdesigner_settings.cpp b/src/designer/src/designer/qdesigner_settings.cpp index 2a688488c..69a7e25d4 100644 --- a/src/designer/src/designer/qdesigner_settings.cpp +++ b/src/designer/src/designer/qdesigner_settings.cpp @@ -101,8 +101,8 @@ void QDesignerSettings::saveGeometryFor(const QWidget *w) if (debugSettings) qDebug() << Q_FUNC_INFO << w << "visible=" << visible; s->beginGroup(w->objectName()); - s->setValue(QLatin1String("visible"), visible); - s->setValue(QLatin1String("geometry"), w->saveGeometry()); + s->setValue(QStringLiteral("visible"), visible); + s->setValue(QStringLiteral("geometry"), w->saveGeometry()); s->endGroup(); } @@ -110,8 +110,8 @@ void QDesignerSettings::restoreGeometry(QWidget *w, QRect fallBack) const { Q_ASSERT(w && !w->objectName().isEmpty()); const QString key = w->objectName(); - const QByteArray ba(settings()->value(key + QLatin1String("/geometry")).toByteArray()); - const bool visible = settings()->value(key + QLatin1String("/visible"), true).toBool(); + const QByteArray ba(settings()->value(key + QStringLiteral("/geometry")).toByteArray()); + const bool visible = settings()->value(key + QStringLiteral("/visible"), true).toBool(); if (debugSettings) qDebug() << Q_FUNC_INFO << w << fallBack << "visible=" << visible; @@ -210,8 +210,8 @@ QMap<QString, QString> QDesignerSettings::backup() const void QDesignerSettings::setUiMode(UIMode mode) { QDesignerSettingsInterface *s = settings(); - s->beginGroup(QLatin1String("UI")); - s->setValue(QLatin1String("currentMode"), mode); + s->beginGroup(QStringLiteral("UI")); + s->setValue(QStringLiteral("currentMode"), mode); s->endGroup(); } @@ -222,17 +222,17 @@ UIMode QDesignerSettings::uiMode() const #else const UIMode defaultMode = DockedMode; #endif - UIMode uiMode = static_cast<UIMode>(value(QLatin1String("UI/currentMode"), defaultMode).toInt()); + UIMode uiMode = static_cast<UIMode>(value(QStringLiteral("UI/currentMode"), defaultMode).toInt()); return uiMode; } void QDesignerSettings::setToolWindowFont(const ToolWindowFontSettings &fontSettings) { QDesignerSettingsInterface *s = settings(); - s->beginGroup(QLatin1String("UI")); - s->setValue(QLatin1String("font"), fontSettings.m_font); - s->setValue(QLatin1String("useFont"), fontSettings.m_useFont); - s->setValue(QLatin1String("writingSystem"), fontSettings.m_writingSystem); + s->beginGroup(QStringLiteral("UI")); + s->setValue(QStringLiteral("font"), fontSettings.m_font); + s->setValue(QStringLiteral("useFont"), fontSettings.m_useFont); + s->setValue(QStringLiteral("writingSystem"), fontSettings.m_writingSystem); s->endGroup(); } @@ -240,11 +240,11 @@ ToolWindowFontSettings QDesignerSettings::toolWindowFont() const { ToolWindowFontSettings fontSettings; fontSettings.m_writingSystem = - static_cast<QFontDatabase::WritingSystem>(value(QLatin1String("UI/writingSystem"), + static_cast<QFontDatabase::WritingSystem>(value(QStringLiteral("UI/writingSystem"), QFontDatabase::Any).toInt()); - fontSettings.m_font = qvariant_cast<QFont>(value(QLatin1String("UI/font"))); + fontSettings.m_font = qvariant_cast<QFont>(value(QStringLiteral("UI/font"))); fontSettings.m_useFont = - settings()->value(QLatin1String("UI/useFont"), QVariant(false)).toBool(); + settings()->value(QStringLiteral("UI/useFont"), QVariant(false)).toBool(); return fontSettings; } diff --git a/src/designer/src/designer/qdesigner_toolwindow.cpp b/src/designer/src/designer/qdesigner_toolwindow.cpp index 723411463..6a9d72374 100644 --- a/src/designer/src/designer/qdesigner_toolwindow.cpp +++ b/src/designer/src/designer/qdesigner_toolwindow.cpp @@ -186,9 +186,9 @@ protected: PropertyEditorToolWindow::PropertyEditorToolWindow(QDesignerWorkbench *workbench) : QDesignerToolWindow(workbench, createPropertyEditor(workbench->core()), - QLatin1String("qt_designer_propertyeditor"), + QStringLiteral("qt_designer_propertyeditor"), QDesignerToolWindow::tr("Property Editor"), - QLatin1String("__qt_property_editor_action"), + QStringLiteral("__qt_property_editor_action"), Qt::RightDockWidgetArea) { action()->setShortcut(Qt::CTRL + Qt::Key_I); @@ -240,9 +240,9 @@ public: ActionEditorToolWindow::ActionEditorToolWindow(QDesignerWorkbench *workbench) : QDesignerToolWindow(workbench, createActionEditor(workbench->core()), - QLatin1String("qt_designer_actioneditor"), + QStringLiteral("qt_designer_actioneditor"), QDesignerToolWindow::tr("Action Editor"), - QLatin1String("__qt_action_editor_tool_action"), + QStringLiteral("__qt_action_editor_tool_action"), Qt::RightDockWidgetArea) { } @@ -282,9 +282,9 @@ public: ObjectInspectorToolWindow::ObjectInspectorToolWindow(QDesignerWorkbench *workbench) : QDesignerToolWindow(workbench, createObjectInspector(workbench->core()), - QLatin1String("qt_designer_objectinspector"), + QStringLiteral("qt_designer_objectinspector"), QDesignerToolWindow::tr("Object Inspector"), - QLatin1String("__qt_object_inspector_tool_action"), + QStringLiteral("__qt_object_inspector_tool_action"), Qt::RightDockWidgetArea) { } @@ -317,9 +317,9 @@ public: ResourceEditorToolWindow::ResourceEditorToolWindow(QDesignerWorkbench *workbench) : QDesignerToolWindow(workbench, QDesignerComponents::createResourceEditor(workbench->core(), 0), - QLatin1String("qt_designer_resourceeditor"), + QStringLiteral("qt_designer_resourceeditor"), QDesignerToolWindow::tr("Resource Browser"), - QLatin1String("__qt_resource_editor_tool_action"), + QStringLiteral("__qt_resource_editor_tool_action"), Qt::RightDockWidgetArea) { } @@ -351,9 +351,9 @@ public: SignalSlotEditorToolWindow::SignalSlotEditorToolWindow(QDesignerWorkbench *workbench) : QDesignerToolWindow(workbench, QDesignerComponents::createSignalSlotEditor(workbench->core(), 0), - QLatin1String("qt_designer_signalsloteditor"), + QStringLiteral("qt_designer_signalsloteditor"), QDesignerToolWindow::tr("Signal/Slot Editor"), - QLatin1String("__qt_signal_slot_editor_tool_action"), + QStringLiteral("__qt_signal_slot_editor_tool_action"), Qt::RightDockWidgetArea) { } @@ -392,9 +392,9 @@ public: WidgetBoxToolWindow::WidgetBoxToolWindow(QDesignerWorkbench *workbench) : QDesignerToolWindow(workbench, createWidgetBox(workbench->core()), - QLatin1String("qt_designer_widgetbox"), + QStringLiteral("qt_designer_widgetbox"), QDesignerToolWindow::tr("Widget Box"), - QLatin1String("__qt_widget_box_tool_action"), + QStringLiteral("__qt_widget_box_tool_action"), Qt::LeftDockWidgetArea) { } diff --git a/src/designer/src/designer/qdesigner_workbench.cpp b/src/designer/src/designer/qdesigner_workbench.cpp index 08ad0ee6d..52b0cdc3f 100644 --- a/src/designer/src/designer/qdesigner_workbench.cpp +++ b/src/designer/src/designer/qdesigner_workbench.cpp @@ -822,7 +822,7 @@ bool QDesignerWorkbench::readInBackup() if (answer == QMessageBox::No) return false; - const QString modifiedPlaceHolder = QLatin1String("[*]"); + const QString modifiedPlaceHolder = QStringLiteral("[*]"); QMapIterator<QString, QString> it(backupFileMap); while(it.hasNext()) { it.next(); diff --git a/src/designer/src/designer/saveformastemplate.cpp b/src/designer/src/designer/saveformastemplate.cpp index 500a956a1..f5bcc2edb 100644 --- a/src/designer/src/designer/saveformastemplate.cpp +++ b/src/designer/src/designer/saveformastemplate.cpp @@ -86,7 +86,7 @@ void SaveFormAsTemplate::accept() templateFileName += QLatin1Char('/'); const QString name = ui.templateNameEdit->text(); templateFileName += name; - const QString extension = QLatin1String(".ui"); + const QString extension = QStringLiteral(".ui"); if (!templateFileName.endsWith(extension)) templateFileName.append(extension); QFile file(templateFileName); diff --git a/src/designer/src/designer/versiondialog.cpp b/src/designer/src/designer/versiondialog.cpp index efa603078..2b3a0e7ce 100644 --- a/src/designer/src/designer/versiondialog.cpp +++ b/src/designer/src/designer/versiondialog.cpp @@ -77,7 +77,7 @@ private: VersionLabel::VersionLabel(QWidget *parent) : QLabel(parent), secondStage(false), m_pushed(false) { - setPixmap(QPixmap(QLatin1String(":/trolltech/designer/images/designer.png"))); + setPixmap(QPixmap(QStringLiteral(":/trolltech/designer/images/designer.png"))); hitPoints.append(QPoint(56, 25)); hitPoints.append(QPoint(29, 55)); hitPoints.append(QPoint(56, 87)); diff --git a/src/designer/src/lib/sdk/abstractformeditor.cpp b/src/designer/src/lib/sdk/abstractformeditor.cpp index 5df5be40a..ca41fd5e3 100644 --- a/src/designer/src/lib/sdk/abstractformeditor.cpp +++ b/src/designer/src/lib/sdk/abstractformeditor.cpp @@ -560,9 +560,9 @@ void QDesignerFormEditorInterface::setIntrospection(QDesignerIntrospectionInterf QString QDesignerFormEditorInterface::resourceLocation() const { #ifdef Q_WS_MAC - return QLatin1String(":/trolltech/formeditor/images/mac"); + return QStringLiteral(":/trolltech/formeditor/images/mac"); #else - return QLatin1String(":/trolltech/formeditor/images/win"); + return QStringLiteral(":/trolltech/formeditor/images/win"); #endif } diff --git a/src/designer/src/lib/sdk/abstractintegration.cpp b/src/designer/src/lib/sdk/abstractintegration.cpp index e5dbe137c..fa58cd7bb 100644 --- a/src/designer/src/lib/sdk/abstractintegration.cpp +++ b/src/designer/src/lib/sdk/abstractintegration.cpp @@ -335,7 +335,7 @@ public: QDesignerIntegrationPrivate::QDesignerIntegrationPrivate(QDesignerIntegration *qq) : q(qq), - headerSuffix(QLatin1String(".h")), + headerSuffix(QStringLiteral(".h")), headerLowercase(true), m_features(QDesignerIntegrationInterface::DefaultFeature), m_resourceFileWatcherBehaviour(QDesignerIntegrationInterface::PromptToReloadResourceFile), @@ -374,17 +374,17 @@ void QDesignerIntegrationPrivate::initialize() QString designerFolder = QDir::homePath(); designerFolder += QDir::separator(); - designerFolder += QLatin1String(".designer"); + designerFolder += QStringLiteral(".designer"); m_gradientsPath = designerFolder; m_gradientsPath += QDir::separator(); - m_gradientsPath += QLatin1String("gradients.xml"); + m_gradientsPath += QStringLiteral("gradients.xml"); QFile f(m_gradientsPath); if (f.open(QIODevice::ReadOnly)) { QtGradientUtils::restoreState(m_gradientManager, QString::fromAscii(f.readAll())); f.close(); } else { - QFile defaultGradients(QLatin1String(":/trolltech/designer/defaultgradients.xml")); + QFile defaultGradients(QStringLiteral(":/trolltech/designer/defaultgradients.xml")); if (defaultGradients.open(QIODevice::ReadOnly)) { QtGradientUtils::restoreState(m_gradientManager, QString::fromAscii(defaultGradients.readAll())); defaultGradients.close(); @@ -599,12 +599,12 @@ void QDesignerIntegrationPrivate::updateCustomWidgetPlugins() static QString fixHelpClassName(const QString &className) { // ### generalize using the Widget Data Base - if (className == QLatin1String("Line")) - return QLatin1String("QFrame"); - if (className == QLatin1String("Spacer")) - return QLatin1String("QSpacerItem"); - if (className == QLatin1String("QLayoutWidget")) - return QLatin1String("QLayout"); + if (className == QStringLiteral("Line")) + return QStringLiteral("QFrame"); + if (className == QStringLiteral("Spacer")) + return QStringLiteral("QSpacerItem"); + if (className == QStringLiteral("QLayoutWidget")) + return QStringLiteral("QLayout"); return className; } @@ -638,7 +638,7 @@ QString QDesignerIntegrationPrivate::contextHelpId() const } QString helpId = fixHelpClassName(className); if (!currentPropertyName.isEmpty()) { - helpId += QLatin1String("::"); + helpId += QStringLiteral("::"); helpId += currentPropertyName; } return helpId; diff --git a/src/designer/src/lib/shared/actioneditor.cpp b/src/designer/src/lib/shared/actioneditor.cpp index 2707631d9..41741328c 100644 --- a/src/designer/src/lib/shared/actioneditor.cpp +++ b/src/designer/src/lib/shared/actioneditor.cpp @@ -146,7 +146,7 @@ ActionEditor::ActionEditor(QDesignerFormEditorInterface *core, QWidget *parent, toolbar->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum); l->addWidget(toolbar); // edit actions - QIcon documentNewIcon = QIcon::fromTheme(QLatin1String("document-new"), createIconSet(QLatin1String("filenew.png"))); + QIcon documentNewIcon = QIcon::fromTheme(QStringLiteral("document-new"), createIconSet(QStringLiteral("filenew.png"))); m_actionNew->setIcon(documentNewIcon); m_actionNew->setEnabled(false); connect(m_actionNew, SIGNAL(triggered()), this, SLOT(slotNewAction())); @@ -156,17 +156,17 @@ ActionEditor::ActionEditor(QDesignerFormEditorInterface *core, QWidget *parent, m_actionCut->setEnabled(false); connect(m_actionCut, SIGNAL(triggered()), this, SLOT(slotCut())); - QIcon editCutIcon = QIcon::fromTheme(QLatin1String("edit-cut"), createIconSet(QLatin1String("editcut.png"))); + QIcon editCutIcon = QIcon::fromTheme(QStringLiteral("edit-cut"), createIconSet(QStringLiteral("editcut.png"))); m_actionCut->setIcon(editCutIcon); m_actionCopy->setEnabled(false); connect(m_actionCopy, SIGNAL(triggered()), this, SLOT(slotCopy())); - QIcon editCopyIcon = QIcon::fromTheme(QLatin1String("edit-copy"), createIconSet(QLatin1String("editcopy.png"))); + QIcon editCopyIcon = QIcon::fromTheme(QStringLiteral("edit-copy"), createIconSet(QStringLiteral("editcopy.png"))); m_actionCopy->setIcon(editCopyIcon); toolbar->addAction(m_actionCopy); connect(m_actionPaste, SIGNAL(triggered()), this, SLOT(slotPaste())); - QIcon editPasteIcon = QIcon::fromTheme(QLatin1String("edit-paste"), createIconSet(QLatin1String("editpaste.png"))); + QIcon editPasteIcon = QIcon::fromTheme(QStringLiteral("edit-paste"), createIconSet(QStringLiteral("editpaste.png"))); m_actionPaste->setIcon(editPasteIcon); toolbar->addAction(m_actionPaste); @@ -175,7 +175,7 @@ ActionEditor::ActionEditor(QDesignerFormEditorInterface *core, QWidget *parent, connect(m_actionNavigateToSlot, SIGNAL(triggered()), this, SLOT(navigateToSlotCurrentAction())); - QIcon editDeleteIcon = QIcon::fromTheme(QLatin1String("edit-delete"), createIconSet(QLatin1String("editdelete.png"))); + QIcon editDeleteIcon = QIcon::fromTheme(QStringLiteral("edit-delete"), createIconSet(QStringLiteral("editdelete.png"))); m_actionDelete->setIcon(editDeleteIcon); m_actionDelete->setEnabled(false); connect(m_actionDelete, SIGNAL(triggered()), this, SLOT(slotDelete())); @@ -247,7 +247,7 @@ QToolButton *ActionEditor::createConfigureMenuButton(const QString &t, QMenu **p { QToolButton *configureButton = new QToolButton; QAction *configureAction = new QAction(t, configureButton); - QIcon configureIcon = QIcon::fromTheme(QLatin1String("document-properties"), createIconSet(QLatin1String("configure.png"))); + QIcon configureIcon = QIcon::fromTheme(QStringLiteral("document-properties"), createIconSet(QStringLiteral("configure.png"))); configureAction->setIcon(configureIcon); QMenu *configureMenu = new QMenu; configureAction->setMenu(configureMenu); @@ -564,7 +564,7 @@ void ActionEditor::editAction(QAction *action) QDesignerFormWindowInterface *fw = formWindow(); QUndoStack *undoStack = fw->commandHistory(); if (severalChanges) - fw->beginCommand(QLatin1String("Edit action")); + fw->beginCommand(QStringLiteral("Edit action")); if (changeMask & ActionData::NameChanged) undoStack->push(createTextPropertyCommand(QLatin1String(objectNamePropertyC), newActionData.name, action, fw)); @@ -597,7 +597,7 @@ void ActionEditor::editCurrentAction() void ActionEditor::navigateToSlotCurrentAction() { if (QAction *a = m_actionView->currentAction()) - QDesignerTaskMenu::navigateToSlot(m_core, a, QLatin1String("triggered()")); + QDesignerTaskMenu::navigateToSlot(m_core, a, QStringLiteral("triggered()")); } void ActionEditor::deleteActions(QDesignerFormWindowInterface *fw, const ActionList &actions) @@ -659,8 +659,8 @@ QString ActionEditor::actionTextToName(const QString &text, const QString &prefi name[0] = name.at(0).toUpper(); name.prepend(prefix); const QString underscore = QString(QLatin1Char('_')); - name.replace(QRegExp(QString(QLatin1String("[^a-zA-Z_0-9]"))), underscore); - name.replace(QRegExp(QLatin1String("__*")), underscore); + name.replace(QRegExp(QString(QStringLiteral("[^a-zA-Z_0-9]"))), underscore); + name.replace(QRegExp(QStringLiteral("__*")), underscore); if (name.endsWith(underscore.at(0))) name.truncate(name.size() - 1); diff --git a/src/designer/src/lib/shared/actionrepository.cpp b/src/designer/src/lib/shared/actionrepository.cpp index 46c1d7d50..977d57ddb 100644 --- a/src/designer/src/lib/shared/actionrepository.cpp +++ b/src/designer/src/lib/shared/actionrepository.cpp @@ -173,7 +173,7 @@ PropertySheetKeySequenceValue ActionModel::actionShortCut(QDesignerFormEditorInt PropertySheetKeySequenceValue ActionModel::actionShortCut(const QDesignerPropertySheetExtension *sheet) { - const int index = sheet->indexOf(QLatin1String("shortcut")); + const int index = sheet->indexOf(QStringLiteral("shortcut")); if (index == -1) return PropertySheetKeySequenceValue(); return qvariant_cast<PropertySheetKeySequenceValue>(sheet->property(index)); @@ -209,7 +209,7 @@ void ActionModel::setItems(QDesignerFormEditorInterface *core, QAction *action, item->setCheckState(used ? Qt::Checked : Qt::Unchecked); if (used) { QString usedToolTip; - const QString separator = QLatin1String(", "); + const QString separator = QStringLiteral(", "); const int count = associatedDesignerWidgets.size(); for (int i = 0; i < count; i++) { if (i) diff --git a/src/designer/src/lib/shared/codedialog.cpp b/src/designer/src/lib/shared/codedialog.cpp index fe1cfda5f..f972962a7 100644 --- a/src/designer/src/lib/shared/codedialog.cpp +++ b/src/designer/src/lib/shared/codedialog.cpp @@ -91,11 +91,11 @@ CodeDialog::CodeDialog(QWidget *parent) : // Edit tool bar QToolBar *toolBar = new QToolBar; - const QIcon saveIcon = createIconSet(QLatin1String("filesave.png")); + const QIcon saveIcon = createIconSet(QStringLiteral("filesave.png")); QAction *saveAction = toolBar->addAction(saveIcon, tr("Save...")); connect(saveAction, SIGNAL(triggered()), this, SLOT(slotSaveAs())); - const QIcon copyIcon = createIconSet(QLatin1String("editcopy.png")); + const QIcon copyIcon = createIconSet(QStringLiteral("editcopy.png")); QAction *copyAction = toolBar->addAction(copyIcon, tr("Copy All")); connect(copyAction, SIGNAL(triggered()), this, SLOT(copyAll())); @@ -166,11 +166,11 @@ bool CodeDialog::generateCode(const QDesignerFormWindowInterface *fw, tempPattern += QDir::separator(); const QString fileName = fw->fileName(); if (fileName.isEmpty()) { - tempPattern += QLatin1String("designer"); + tempPattern += QStringLiteral("designer"); } else { tempPattern += QFileInfo(fileName).baseName(); } - tempPattern += QLatin1String("XXXXXX.ui"); + tempPattern += QStringLiteral("XXXXXX.ui"); // Write to temp file QTemporaryFile tempFormFile(tempPattern); @@ -218,7 +218,7 @@ void CodeDialog::slotSaveAs() const QString uiFile = formFileName(); if (!uiFile.isEmpty()) { - filter = QLatin1String("ui_"); + filter = QStringLiteral("ui_"); filter += QFileInfo(uiFile).baseName(); filter += QLatin1Char('.'); filter += headerSuffix; diff --git a/src/designer/src/lib/shared/filterwidget.cpp b/src/designer/src/lib/shared/filterwidget.cpp index ac168b726..60290ffdd 100644 --- a/src/designer/src/lib/shared/filterwidget.cpp +++ b/src/designer/src/lib/shared/filterwidget.cpp @@ -191,9 +191,9 @@ FilterWidget::FilterWidget(QWidget *parent, LayoutMode lm) : // If these icons are not avaiable we use the freedesktop standard name before // falling back to a bundled resource QIcon icon = QIcon::fromTheme(layoutDirection() == Qt::LeftToRight ? - QLatin1String("edit-clear-locationbar-rtl") : - QLatin1String("edit-clear-locationbar-ltr"), - QIcon::fromTheme(QLatin1String("edit-clear"), createIconSet(QLatin1String("cleartext.png")))); + QStringLiteral("edit-clear-locationbar-rtl") : + QStringLiteral("edit-clear-locationbar-ltr"), + QIcon::fromTheme(QStringLiteral("edit-clear"), createIconSet(QStringLiteral("cleartext.png")))); m_button->setIcon(icon); m_button->setToolTip(tr("Clear text")); diff --git a/src/designer/src/lib/shared/formlayoutmenu.cpp b/src/designer/src/lib/shared/formlayoutmenu.cpp index 3cc63161f..0d5661d9f 100644 --- a/src/designer/src/lib/shared/formlayoutmenu.cpp +++ b/src/designer/src/lib/shared/formlayoutmenu.cpp @@ -141,7 +141,7 @@ private: FormLayoutRowDialog::FormLayoutRowDialog(QDesignerFormEditorInterface *core, QWidget *parent) : QDialog(parent), - m_buddyMarkerRegexp(QLatin1String("\\&[^&]")), + m_buddyMarkerRegexp(QStringLiteral("\\&[^&]")), m_labelNameEdited(false), m_fieldNameEdited(false), m_buddyClicked(false) @@ -153,7 +153,7 @@ FormLayoutRowDialog::FormLayoutRowDialog(QDesignerFormEditorInterface *core, m_ui.setupUi(this); connect(m_ui.labelTextLineEdit, SIGNAL(textEdited(QString)), this, SLOT(labelTextEdited(QString))); - QRegExpValidator *nameValidator = new QRegExpValidator(QRegExp(QLatin1String("^[a-zA-Z0-9_]+$")), this); + QRegExpValidator *nameValidator = new QRegExpValidator(QRegExp(QStringLiteral("^[a-zA-Z0-9_]+$")), this); Q_ASSERT(nameValidator->regExp().isValid()); m_ui.labelNameLineEdit->setValidator(nameValidator); @@ -253,7 +253,7 @@ void FormLayoutRowDialog::labelTextEdited(const QString &text) // "namespace::QLineEdit"->"LineEdit" static inline QString postFixFromClassName(QString className) { - const int index = className.lastIndexOf(QLatin1String("::")); + const int index = className.lastIndexOf(QStringLiteral("::")); if (index != -1) className.remove(0, index + 2); if (className.size() > 2) @@ -336,7 +336,7 @@ void FormLayoutRowDialog::updateObjectNames(bool updateLabel, bool updateField) const QString prefix = prefixFromLabel(labelText()); // Set names if (doUpdateLabel) - m_ui.labelNameLineEdit->setText(prefix + QLatin1String("Label")); + m_ui.labelNameLineEdit->setText(prefix + QStringLiteral("Label")); if (doUpdateField) m_ui.fieldNameLineEdit->setText(prefix + postFixFromClassName(fieldClass())); } @@ -426,16 +426,16 @@ static QPair<QWidget *,QWidget *> QDesignerFormEditorInterface *core = formWindow->core(); QDesignerWidgetFactoryInterface *wf = core->widgetFactory(); - QPair<QWidget *,QWidget *> rc = QPair<QWidget *,QWidget *>(wf->createWidget(QLatin1String("QLabel"), parent), + QPair<QWidget *,QWidget *> rc = QPair<QWidget *,QWidget *>(wf->createWidget(QStringLiteral("QLabel"), parent), wf->createWidget(row.fieldClassName, parent)); // Set up properties of the label - const QString objectNameProperty = QLatin1String("objectName"); + const QString objectNameProperty = QStringLiteral("objectName"); QDesignerPropertySheetExtension *labelSheet = qt_extension<QDesignerPropertySheetExtension*>(core->extensionManager(), rc.first); int nameIndex = labelSheet->indexOf(objectNameProperty); labelSheet->setProperty(nameIndex, QVariant::fromValue(PropertySheetStringValue(row.labelName))); labelSheet->setChanged(nameIndex, true); formWindow->ensureUniqueObjectName(rc.first); - const int textIndex = labelSheet->indexOf(QLatin1String("text")); + const int textIndex = labelSheet->indexOf(QStringLiteral("text")); labelSheet->setProperty(textIndex, QVariant::fromValue(PropertySheetStringValue(row.labelText))); labelSheet->setChanged(textIndex, true); // Set up properties of the control diff --git a/src/designer/src/lib/shared/formwindowbase.cpp b/src/designer/src/lib/shared/formwindowbase.cpp index 1a78f799f..8dcaa9f79 100644 --- a/src/designer/src/lib/shared/formwindowbase.cpp +++ b/src/designer/src/lib/shared/formwindowbase.cpp @@ -185,11 +185,11 @@ void FormWindowBase::reloadProperties() while (itIndex.hasNext()) { const int index = itIndex.next().key(); const QVariant newValue = sheet->property(index); - if (qobject_cast<QLabel *>(sheet->object()) && sheet->propertyName(index) == QLatin1String("text")) { + if (qobject_cast<QLabel *>(sheet->object()) && sheet->propertyName(index) == QStringLiteral("text")) { const PropertySheetStringValue newString = qvariant_cast<PropertySheetStringValue>(newValue); // optimize a bit, reset only if the text value might contain a reference to qt resources // (however reloading of icons other than taken from resources might not work here) - if (newString.value().contains(QLatin1String(":/"))) { + if (newString.value().contains(QStringLiteral(":/"))) { const QVariant resetValue = QVariant::fromValue(PropertySheetStringValue()); sheet->setProperty(index, resetValue); } @@ -199,7 +199,7 @@ void FormWindowBase::reloadProperties() if (QTabWidget *tabWidget = qobject_cast<QTabWidget *>(sheet->object())) { const int count = tabWidget->count(); const int current = tabWidget->currentIndex(); - const QString currentTabIcon = QLatin1String("currentTabIcon"); + const QString currentTabIcon = QStringLiteral("currentTabIcon"); for (int i = 0; i < count; i++) { tabWidget->setCurrentIndex(i); const int index = sheet->indexOf(currentTabIcon); @@ -209,7 +209,7 @@ void FormWindowBase::reloadProperties() } else if (QToolBox *toolBox = qobject_cast<QToolBox *>(sheet->object())) { const int count = toolBox->count(); const int current = toolBox->currentIndex(); - const QString currentItemIcon = QLatin1String("currentItemIcon"); + const QString currentItemIcon = QStringLiteral("currentItemIcon"); for (int i = 0; i < count; i++) { toolBox->setCurrentIndex(i); const int index = sheet->indexOf(currentItemIcon); @@ -423,7 +423,7 @@ QMenu *FormWindowBase::createExtensionTaskMenu(QDesignerFormWindowInterface *fw, QExtensionManager *em = fw->core()->extensionManager(); if (const QDesignerTaskMenuExtension *extTaskMenu = qt_extension<QDesignerTaskMenuExtension*>(em, o)) actions += extTaskMenu->taskActions(); - if (const QDesignerTaskMenuExtension *intTaskMenu = qobject_cast<QDesignerTaskMenuExtension *>(em->extension(o, QLatin1String("QDesignerInternalTaskMenuExtension")))) { + if (const QDesignerTaskMenuExtension *intTaskMenu = qobject_cast<QDesignerTaskMenuExtension *>(em->extension(o, QStringLiteral("QDesignerInternalTaskMenuExtension")))) { if (!actions.empty()) { QAction *a = new QAction(fw); a->setSeparator(true); diff --git a/src/designer/src/lib/shared/htmlhighlighter.cpp b/src/designer/src/lib/shared/htmlhighlighter.cpp index bb8bf3816..4d7b59467 100644 --- a/src/designer/src/lib/shared/htmlhighlighter.cpp +++ b/src/designer/src/lib/shared/htmlhighlighter.cpp @@ -93,9 +93,9 @@ void HtmlHighlighter::highlightBlock(const QString &text) static const QLatin1Char apos = QLatin1Char('\''); static const QLatin1Char semicolon = QLatin1Char(';'); static const QLatin1Char equals = QLatin1Char('='); - static const QLatin1String startComment = QLatin1String("<!--"); - static const QLatin1String endComment = QLatin1String("-->"); - static const QLatin1String endElement = QLatin1String("/>"); + static const QLatin1String startComment = QStringLiteral("<!--"); + static const QLatin1String endComment = QStringLiteral("-->"); + static const QLatin1String endElement = QStringLiteral("/>"); int state = previousBlockState(); int len = text.length(); diff --git a/src/designer/src/lib/shared/iconloader.cpp b/src/designer/src/lib/shared/iconloader.cpp index c8f5881f6..009c0064a 100644 --- a/src/designer/src/lib/shared/iconloader.cpp +++ b/src/designer/src/lib/shared/iconloader.cpp @@ -70,7 +70,7 @@ QDESIGNER_SHARED_EXPORT QIcon createIconSet(const QString &name) QDESIGNER_SHARED_EXPORT QIcon emptyIcon() { - return QIcon(QLatin1String(":/trolltech/formeditor/images/emptyicon.png")); + return QIcon(QStringLiteral(":/trolltech/formeditor/images/emptyicon.png")); } } // namespace qdesigner_internal diff --git a/src/designer/src/lib/shared/iconselector.cpp b/src/designer/src/lib/shared/iconselector.cpp index a5d15874e..6680cb72b 100644 --- a/src/designer/src/lib/shared/iconselector.cpp +++ b/src/designer/src/lib/shared/iconselector.cpp @@ -359,17 +359,17 @@ static QString imageFilter() { QString filter = QApplication::translate("IconSelector", "All Pixmaps ("); const QList<QByteArray> supportedImageFormats = QImageReader::supportedImageFormats(); - const QString jpeg = QLatin1String("JPEG"); + const QString jpeg = QStringLiteral("JPEG"); const int count = supportedImageFormats.count(); for (int i = 0; i< count; ++i) { if (i) filter += QLatin1Char(' '); - filter += QLatin1String("*."); + filter += QStringLiteral("*."); const QString outputFormat = QString::fromUtf8(supportedImageFormats.at(i)); if (outputFormat != jpeg) filter += outputFormat.toLower(); else - filter += QLatin1String("jpg *.jpeg"); + filter += QStringLiteral("jpg *.jpeg"); } filter += QLatin1Char(')'); return filter; @@ -596,7 +596,7 @@ IconThemeEditor::IconThemeEditor(QWidget *parent, bool wantResetButton) : if (wantResetButton) { QToolButton *themeResetButton = new QToolButton; - themeResetButton->setIcon(createIconSet(QLatin1String("resetproperty.png"))); + themeResetButton->setIcon(createIconSet(QStringLiteral("resetproperty.png"))); connect(themeResetButton, SIGNAL(clicked()), this, SLOT(reset())); mainHLayout->addWidget(themeResetButton); } diff --git a/src/designer/src/lib/shared/layout.cpp b/src/designer/src/lib/shared/layout.cpp index 5b2218de0..db1ae011a 100644 --- a/src/designer/src/lib/shared/layout.cpp +++ b/src/designer/src/lib/shared/layout.cpp @@ -237,10 +237,10 @@ bool Layout::prepareLayout(bool &needMove, bool &needReparent) if (m_layoutBase == 0) { const bool useSplitter = m_layoutType == LayoutInfo::HSplitter || m_layoutType == LayoutInfo::VSplitter; - const QString baseWidgetClassName = useSplitter ? QLatin1String("QSplitter") : QLatin1String("QLayoutWidget"); + const QString baseWidgetClassName = useSplitter ? QStringLiteral("QSplitter") : QStringLiteral("QLayoutWidget"); m_layoutBase = widgetFactory->createWidget(baseWidgetClassName, widgetFactory->containerOfWidget(m_parentWidget)); if (useSplitter) { - m_layoutBase->setObjectName(QLatin1String("splitter")); + m_layoutBase->setObjectName(QStringLiteral("splitter")); m_formWindow->ensureUniqueObjectName(m_layoutBase); } } else { @@ -447,11 +447,11 @@ static QString suggestLayoutName(const char *className) { // Legacy if (!qstrcmp(className, "QHBoxLayout")) - return QLatin1String("horizontalLayout"); + return QStringLiteral("horizontalLayout"); if (!qstrcmp(className, "QVBoxLayout")) - return QLatin1String("verticalLayout"); + return QStringLiteral("verticalLayout"); if (!qstrcmp(className, "QGridLayout")) - return QLatin1String("gridLayout"); + return QStringLiteral("gridLayout"); return qtify(QString::fromUtf8(className)); } @@ -465,10 +465,10 @@ QLayout *Layout::createLayout(int type) // QLayoutWidget QDesignerPropertySheetExtension *sheet = qt_extension<QDesignerPropertySheetExtension*>(m_formWindow->core()->extensionManager(), layout); if (sheet && qobject_cast<QLayoutWidget*>(m_layoutBase)) { - sheet->setProperty(sheet->indexOf(QLatin1String("leftMargin")), 0); - sheet->setProperty(sheet->indexOf(QLatin1String("topMargin")), 0); - sheet->setProperty(sheet->indexOf(QLatin1String("rightMargin")), 0); - sheet->setProperty(sheet->indexOf(QLatin1String("bottomMargin")), 0); + sheet->setProperty(sheet->indexOf(QStringLiteral("leftMargin")), 0); + sheet->setProperty(sheet->indexOf(QStringLiteral("topMargin")), 0); + sheet->setProperty(sheet->indexOf(QStringLiteral("rightMargin")), 0); + sheet->setProperty(sheet->indexOf(QStringLiteral("bottomMargin")), 0); } return layout; } diff --git a/src/designer/src/lib/shared/layoutinfo.cpp b/src/designer/src/lib/shared/layoutinfo.cpp index d97c17abc..63d8f590b 100644 --- a/src/designer/src/lib/shared/layoutinfo.cpp +++ b/src/designer/src/lib/shared/layoutinfo.cpp @@ -79,10 +79,10 @@ static const QHash<QString, LayoutInfo::Type> &layoutNameTypeMap() { static QHash<QString, LayoutInfo::Type> nameTypeMap; if (nameTypeMap.empty()) { - nameTypeMap.insert(QLatin1String("QVBoxLayout"), LayoutInfo::VBox); - nameTypeMap.insert(QLatin1String("QHBoxLayout"), LayoutInfo::HBox); - nameTypeMap.insert(QLatin1String("QGridLayout"), LayoutInfo::Grid); - nameTypeMap.insert(QLatin1String("QFormLayout"), LayoutInfo::Form); + nameTypeMap.insert(QStringLiteral("QVBoxLayout"), LayoutInfo::VBox); + nameTypeMap.insert(QStringLiteral("QHBoxLayout"), LayoutInfo::HBox); + nameTypeMap.insert(QStringLiteral("QGridLayout"), LayoutInfo::Grid); + nameTypeMap.insert(QStringLiteral("QFormLayout"), LayoutInfo::Form); } return nameTypeMap; } diff --git a/src/designer/src/lib/shared/morphmenu.cpp b/src/designer/src/lib/shared/morphmenu.cpp index ef52939c9..7d4ee197d 100644 --- a/src/designer/src/lib/shared/morphmenu.cpp +++ b/src/designer/src/lib/shared/morphmenu.cpp @@ -171,29 +171,29 @@ static QStringList classesOfCategory(MorphCategory cat) case MorphSimpleContainer: // Do not generally allow to morph into a layout. // This can be risky in case of container pages,etc. - l << QLatin1String("QWidget") << QLatin1String("QFrame") << QLatin1String("QGroupBox"); + l << QStringLiteral("QWidget") << QStringLiteral("QFrame") << QStringLiteral("QGroupBox"); break; case MorphPageContainer: - l << QLatin1String("QTabWidget") << QLatin1String("QStackedWidget") << QLatin1String("QToolBox"); + l << QStringLiteral("QTabWidget") << QStringLiteral("QStackedWidget") << QStringLiteral("QToolBox"); break; case MorphItemView: - l << QLatin1String("QListView") << QLatin1String("QListWidget") - << QLatin1String("QTreeView") << QLatin1String("QTreeWidget") - << QLatin1String("QTableView") << QLatin1String("QTableWidget") - << QLatin1String("QColumnView"); + l << QStringLiteral("QListView") << QStringLiteral("QListWidget") + << QStringLiteral("QTreeView") << QStringLiteral("QTreeWidget") + << QStringLiteral("QTableView") << QStringLiteral("QTableWidget") + << QStringLiteral("QColumnView"); break; case MorphButton: - l << QLatin1String("QCheckBox") << QLatin1String("QRadioButton") - << QLatin1String("QPushButton") << QLatin1String("QToolButton") - << QLatin1String("QCommandLinkButton"); + l << QStringLiteral("QCheckBox") << QStringLiteral("QRadioButton") + << QStringLiteral("QPushButton") << QStringLiteral("QToolButton") + << QStringLiteral("QCommandLinkButton"); break; case MorphSpinBox: - l << QLatin1String("QDateTimeEdit") << QLatin1String("QDateEdit") - << QLatin1String("QTimeEdit") - << QLatin1String("QSpinBox") << QLatin1String("QDoubleSpinBox"); + l << QStringLiteral("QDateTimeEdit") << QStringLiteral("QDateEdit") + << QStringLiteral("QTimeEdit") + << QStringLiteral("QSpinBox") << QStringLiteral("QDoubleSpinBox"); break; case MorphTextEdit: - l << QLatin1String("QTextEdit") << QLatin1String("QPlainTextEdit") << QLatin1String("QTextBrowser"); + l << QStringLiteral("QTextEdit") << QStringLiteral("QPlainTextEdit") << QStringLiteral("QTextBrowser"); break; } } @@ -317,7 +317,7 @@ bool MorphWidgetCommand::addMorphMacro(QDesignerFormWindowInterface *fw, QWidget // restore buddy using the QByteArray name. if (buddyLabel) { SetPropertyCommand *buddyCmd = new SetPropertyCommand(fw); - buddyCmd->init(buddyLabel, QLatin1String("buddy"), QVariant(newWidgetName.toUtf8())); + buddyCmd->init(buddyLabel, QStringLiteral("buddy"), QVariant(newWidgetName.toUtf8())); us->push(buddyCmd); } us->endMacro(); @@ -360,11 +360,11 @@ bool MorphWidgetCommand::init(QWidget *widget, const QString &newClassName) // up the children of the before widget if (QDesignerContainerExtension* c = qt_extension<QDesignerContainerExtension*>(core->extensionManager(), m_afterWidget)) { if (const int pageCount = childContainers(core, m_beforeWidget).size()) { - const QString qWidget = QLatin1String("QWidget"); + const QString qWidget = QStringLiteral("QWidget"); const QString containerName = m_afterWidget->objectName(); for (int i = 0; i < pageCount; i++) { QString name = containerName; - name += QLatin1String("Page"); + name += QStringLiteral("Page"); name += QString::number(i + 1); QWidget *page = core->widgetFactory()->createWidget(qWidget); page->setObjectName(name); @@ -378,7 +378,7 @@ bool MorphWidgetCommand::init(QWidget *widget, const QString &newClassName) // Copy over applicable properties const QDesignerPropertySheetExtension *beforeSheet = qt_extension<QDesignerPropertySheetExtension*>(core->extensionManager(), widget); QDesignerPropertySheetExtension *afterSheet = qt_extension<QDesignerPropertySheetExtension*>(core->extensionManager(), m_afterWidget); - const QString objectNameProperty = QLatin1String("objectName"); + const QString objectNameProperty = QStringLiteral("objectName"); const int count = beforeSheet->count(); for (int i = 0; i < count; i++) if (beforeSheet->isVisible(i) && beforeSheet->isChanged(i)) { diff --git a/src/designer/src/lib/shared/newactiondialog.cpp b/src/designer/src/lib/shared/newactiondialog.cpp index ddd314864..fed412780 100644 --- a/src/designer/src/lib/shared/newactiondialog.cpp +++ b/src/designer/src/lib/shared/newactiondialog.cpp @@ -93,7 +93,7 @@ NewActionDialog::NewActionDialog(ActionEditor *parent) : m_ui->tooltipEditor->setTextPropertyValidationMode(ValidationRichText); connect(m_ui->toolTipToolButton, SIGNAL(clicked()), this, SLOT(slotEditToolTip())); - m_ui->keysequenceResetToolButton->setIcon(createIconSet(QLatin1String("resetproperty.png"))); + m_ui->keysequenceResetToolButton->setIcon(createIconSet(QStringLiteral("resetproperty.png"))); connect(m_ui->keysequenceResetToolButton, SIGNAL(clicked()), this, SLOT(slotResetKeySequence())); setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); diff --git a/src/designer/src/lib/shared/newformwidget.cpp b/src/designer/src/lib/shared/newformwidget.cpp index 2ae9db6e5..edcdf94a9 100644 --- a/src/designer/src/lib/shared/newformwidget.cpp +++ b/src/designer/src/lib/shared/newformwidget.cpp @@ -149,12 +149,12 @@ NewFormWidget::NewFormWidget(QDesignerFormEditorInterface *core, QWidget *parent m_ui->lblPreview->setBackgroundRole(QPalette::Base); QDesignerSharedSettings settings(m_core); - QString uiExtension = QLatin1String("ui"); - QString templatePath = QLatin1String(":/trolltech/designer/templates/forms"); + QString uiExtension = QStringLiteral("ui"); + QString templatePath = QStringLiteral(":/trolltech/designer/templates/forms"); QDesignerLanguageExtension *lang = qt_extension<QDesignerLanguageExtension *>(core->extensionManager(), core); if (lang) { - templatePath = QLatin1String(":/templates/forms"); + templatePath = QStringLiteral(":/templates/forms"); uiExtension = lang->uiExtension(); } @@ -409,7 +409,7 @@ void NewFormWidget::loadFrom(const QString &path, bool resourceFile, const QStri return; // Iterate through the directory and add the templates - const QFileInfoList list = dir.entryInfoList(QStringList(QLatin1String("*.") + uiExtension), + const QFileInfoList list = dir.entryInfoList(QStringList(QStringLiteral("*.") + uiExtension), QDir::Files); if (list.isEmpty()) diff --git a/src/designer/src/lib/shared/plugindialog.cpp b/src/designer/src/lib/shared/plugindialog.cpp index cb5c7efab..1b62d3870 100644 --- a/src/designer/src/lib/shared/plugindialog.cpp +++ b/src/designer/src/lib/shared/plugindialog.cpp @@ -144,7 +144,7 @@ void PluginDialog::populateTreeWidget() QIcon PluginDialog::pluginIcon(const QIcon &icon) { if (icon.isNull()) - return QIcon(QLatin1String(":/trolltech/formeditor/images/qtlogo.png")); + return QIcon(QStringLiteral(":/trolltech/formeditor/images/qtlogo.png")); return icon; } diff --git a/src/designer/src/lib/shared/pluginmanager.cpp b/src/designer/src/lib/shared/pluginmanager.cpp index bbd72d9ff..3214b9bfe 100644 --- a/src/designer/src/lib/shared/pluginmanager.cpp +++ b/src/designer/src/lib/shared/pluginmanager.cpp @@ -111,7 +111,7 @@ QStringList QDesignerPluginManager::defaultPluginPaths() const QStringList path_list = QCoreApplication::libraryPaths(); - const QString designer = QLatin1String("designer"); + const QString designer = QStringLiteral("designer"); foreach (const QString &path, path_list) { QString libPath = path; libPath += QDir::separator(); @@ -121,9 +121,9 @@ QStringList QDesignerPluginManager::defaultPluginPaths() QString homeLibPath = QDir::homePath(); homeLibPath += QDir::separator(); - homeLibPath += QLatin1String(".designer"); + homeLibPath += QStringLiteral(".designer"); homeLibPath += QDir::separator(); - homeLibPath += QLatin1String("plugins"); + homeLibPath += QStringLiteral("plugins"); result.append(homeLibPath); return result; @@ -135,11 +135,11 @@ QStringList QDesignerPluginManager::defaultPluginPaths() static inline QString getDesignerLanguage(QDesignerFormEditorInterface *core) { if (QDesignerLanguageExtension *lang = qt_extension<QDesignerLanguageExtension *>(core->extensionManager(), core)) { - if (lang->uiExtension() == QLatin1String("jui")) + if (lang->uiExtension() == QStringLiteral("jui")) return QLatin1String(jambiLanguageC); - return QLatin1String("unknown"); + return QStringLiteral("unknown"); } - return QLatin1String("c++"); + return QStringLiteral("c++"); } // ---------------- QDesignerCustomWidgetSharedData @@ -279,19 +279,19 @@ static inline QString msgAttributeMissing(const QString &name) static qdesigner_internal::TextPropertyValidationMode typeStringToType(const QString &v, bool *ok) { *ok = true; - if (v == QLatin1String("multiline")) + if (v == QStringLiteral("multiline")) return qdesigner_internal::ValidationMultiLine; - if (v == QLatin1String("richtext")) + if (v == QStringLiteral("richtext")) return qdesigner_internal::ValidationRichText; - if (v == QLatin1String("stylesheet")) + if (v == QStringLiteral("stylesheet")) return qdesigner_internal::ValidationStyleSheet; - if (v == QLatin1String("singleline")) + if (v == QStringLiteral("singleline")) return qdesigner_internal::ValidationSingleLine; - if (v == QLatin1String("objectname")) + if (v == QStringLiteral("objectname")) return qdesigner_internal::ValidationObjectName; - if (v == QLatin1String("objectnamescope")) + if (v == QStringLiteral("objectnamescope")) return qdesigner_internal::ValidationObjectNameScope; - if (v == QLatin1String("url")) + if (v == QStringLiteral("url")) return qdesigner_internal::ValidationURL; *ok = false; return qdesigner_internal::ValidationRichText; @@ -328,7 +328,7 @@ static bool parsePropertySpecs(QXmlStreamReader &sr, return false; } bool typeOk; - const bool noTr = notrS == QLatin1String("true") || notrS == QLatin1String("1"); + const bool noTr = notrS == QStringLiteral("true") || notrS == QStringLiteral("1"); QDesignerCustomWidgetSharedData::StringPropertyType v(typeStringToType(type, &typeOk), !noTr); if (!typeOk) { *errorMessage = QDesignerPluginManager::tr("'%1' is not a valid string property specification.").arg(type); @@ -556,7 +556,7 @@ QDesignerPluginManager::QDesignerPluginManager(QDesignerFormEditorInterface *cor { m_d->m_pluginPaths = defaultPluginPaths(); const QSettings settings(qApp->organizationName(), QDesignerQSettings::settingsApplicationName()); - m_d->m_disabledPlugins = unique(settings.value(QLatin1String("PluginManager/DisabledPlugins")).toStringList()); + m_d->m_disabledPlugins = unique(settings.value(QStringLiteral("PluginManager/DisabledPlugins")).toStringList()); // Register plugins updateRegisteredPlugins(); @@ -716,8 +716,8 @@ void QDesignerPluginManager::registerPlugin(const QString &plugin) bool QDesignerPluginManager::syncSettings() { QSettings settings(qApp->organizationName(), QDesignerQSettings::settingsApplicationName()); - settings.beginGroup(QLatin1String("PluginManager")); - settings.setValue(QLatin1String("DisabledPlugins"), m_d->m_disabledPlugins); + settings.beginGroup(QStringLiteral("PluginManager")); + settings.setValue(QStringLiteral("DisabledPlugins"), m_d->m_disabledPlugins); settings.endGroup(); return settings.status() == QSettings::NoError; } diff --git a/src/designer/src/lib/shared/previewconfigurationwidget.cpp b/src/designer/src/lib/shared/previewconfigurationwidget.cpp index 58ee6473e..dd3ed0d2c 100644 --- a/src/designer/src/lib/shared/previewconfigurationwidget.cpp +++ b/src/designer/src/lib/shared/previewconfigurationwidget.cpp @@ -78,7 +78,7 @@ static const Skins &defaultSkins() { static Skins rc; if (rc.empty()) { const QString skinPath = QLatin1String(skinResourcePathC); - QString pattern = QLatin1String("*."); + QString pattern = QStringLiteral("*."); pattern += QLatin1String(skinExtensionC); const QDir dir(skinPath, pattern); const QFileInfoList list = dir.entryInfoList(QDir::Dirs|QDir::NoDotAndDotDot, QDir::Name); diff --git a/src/designer/src/lib/shared/propertylineedit.cpp b/src/designer/src/lib/shared/propertylineedit.cpp index cd332b7f8..8a120322a 100644 --- a/src/designer/src/lib/shared/propertylineedit.cpp +++ b/src/designer/src/lib/shared/propertylineedit.cpp @@ -69,7 +69,7 @@ namespace qdesigner_internal { } void PropertyLineEdit::insertNewLine() { - insertText(QLatin1String("\\n")); + insertText(QStringLiteral("\\n")); } void PropertyLineEdit::insertText(const QString &text) { diff --git a/src/designer/src/lib/shared/qdesigner_command.cpp b/src/designer/src/lib/shared/qdesigner_command.cpp index a4a2d093e..3df904002 100644 --- a/src/designer/src/lib/shared/qdesigner_command.cpp +++ b/src/designer/src/lib/shared/qdesigner_command.cpp @@ -91,7 +91,7 @@ QT_BEGIN_NAMESPACE static inline void setPropertySheetWindowTitle(const QDesignerFormEditorInterface *core, QObject *o, const QString &t) { if (QDesignerPropertySheetExtension *sheet = qt_extension<QDesignerPropertySheetExtension*>(core->extensionManager(), o)) { - const int idx = sheet->indexOf(QLatin1String("windowTitle")); + const int idx = sheet->indexOf(QStringLiteral("windowTitle")); if (idx != -1) { sheet->setProperty(idx, t); sheet->setChanged(idx, true); @@ -251,7 +251,7 @@ void InsertWidgetCommand::refreshBuddyLabels() if (label_list.empty()) return; - const QString buddyProperty = QLatin1String("buddy"); + const QString buddyProperty = QStringLiteral("buddy"); const QByteArray objectNameU8 = m_widget->objectName().toUtf8(); // Re-set the buddy (The sheet locates the object by name and sets it) const LabelList::const_iterator cend = label_list.constEnd(); @@ -1016,7 +1016,7 @@ void ToolBoxCommand::addPage() QDesignerPropertySheetExtension *sheet = qt_extension<QDesignerPropertySheetExtension*>(formWindow()->core()->extensionManager(), m_toolBox); if (sheet) { qdesigner_internal::PropertySheetStringValue itemText(m_itemText); - sheet->setProperty(sheet->indexOf(QLatin1String("currentItemText")), QVariant::fromValue(itemText)); + sheet->setProperty(sheet->indexOf(QStringLiteral("currentItemText")), QVariant::fromValue(itemText)); } m_widget->show(); @@ -1113,7 +1113,7 @@ void AddToolBoxPageCommand::init(QToolBox *toolBox, InsertionMode mode) m_widget = new QDesignerWidget(formWindow(), m_toolBox); m_itemText = QApplication::translate("Command", "Page"); m_itemIcon = QIcon(); - m_widget->setObjectName(QLatin1String("page")); + m_widget->setObjectName(QStringLiteral("page")); formWindow()->ensureUniqueObjectName(m_widget); setText(QApplication::translate("Command", "Insert Page")); @@ -1176,7 +1176,7 @@ void TabWidgetCommand::addPage() QDesignerPropertySheetExtension *sheet = qt_extension<QDesignerPropertySheetExtension*>(formWindow()->core()->extensionManager(), m_tabWidget); if (sheet) { qdesigner_internal::PropertySheetStringValue itemText(m_itemText); - sheet->setProperty(sheet->indexOf(QLatin1String("currentTabText")), QVariant::fromValue(itemText)); + sheet->setProperty(sheet->indexOf(QStringLiteral("currentTabText")), QVariant::fromValue(itemText)); } formWindow()->clearSelection(); @@ -1236,7 +1236,7 @@ void AddTabPageCommand::init(QTabWidget *tabWidget, InsertionMode mode) m_widget = new QDesignerWidget(formWindow(), m_tabWidget); m_itemText = QApplication::translate("Command", "Page"); m_itemIcon = QIcon(); - m_widget->setObjectName(QLatin1String("tab")); + m_widget->setObjectName(QStringLiteral("tab")); formWindow()->ensureUniqueObjectName(m_widget); setText(QApplication::translate("Command", "Insert Page")); @@ -1422,7 +1422,7 @@ void AddStackedWidgetPageCommand::init(QStackedWidget *stackedWidget, InsertionM if (mode == InsertAfter) m_index++; m_widget = new QDesignerWidget(formWindow(), m_stackedWidget); - m_widget->setObjectName(QLatin1String("page")); + m_widget->setObjectName(QStringLiteral("page")); formWindow()->ensureUniqueObjectName(m_widget); setText(QApplication::translate("Command", "Insert Page")); @@ -1481,7 +1481,7 @@ void CreateMenuBarCommand::init(QMainWindow *mainWindow) { m_mainWindow = mainWindow; QDesignerFormEditorInterface *core = formWindow()->core(); - m_menuBar = qobject_cast<QMenuBar*>(core->widgetFactory()->createWidget(QLatin1String("QMenuBar"), m_mainWindow)); + m_menuBar = qobject_cast<QMenuBar*>(core->widgetFactory()->createWidget(QStringLiteral("QMenuBar"), m_mainWindow)); core->widgetFactory()->initialize(m_menuBar); } @@ -1492,7 +1492,7 @@ void CreateMenuBarCommand::redo() c = qt_extension<QDesignerContainerExtension*>(core->extensionManager(), m_mainWindow); c->addWidget(m_menuBar); - m_menuBar->setObjectName(QLatin1String("menuBar")); + m_menuBar->setObjectName(QStringLiteral("menuBar")); formWindow()->ensureUniqueObjectName(m_menuBar); core->metaDataBase()->add(m_menuBar); formWindow()->emitSelectionChanged(); @@ -1572,7 +1572,7 @@ void CreateStatusBarCommand::init(QMainWindow *mainWindow) { m_mainWindow = mainWindow; QDesignerFormEditorInterface *core = formWindow()->core(); - m_statusBar = qobject_cast<QStatusBar*>(core->widgetFactory()->createWidget(QLatin1String("QStatusBar"), m_mainWindow)); + m_statusBar = qobject_cast<QStatusBar*>(core->widgetFactory()->createWidget(QStringLiteral("QStatusBar"), m_mainWindow)); core->widgetFactory()->initialize(m_statusBar); } @@ -1583,7 +1583,7 @@ void CreateStatusBarCommand::redo() c = qt_extension<QDesignerContainerExtension*>(core->extensionManager(), m_mainWindow); c->addWidget(m_statusBar); - m_statusBar->setObjectName(QLatin1String("statusBar")); + m_statusBar->setObjectName(QStringLiteral("statusBar")); formWindow()->ensureUniqueObjectName(m_statusBar); core->metaDataBase()->add(m_statusBar); formWindow()->emitSelectionChanged(); @@ -1660,7 +1660,7 @@ void AddToolBarCommand::init(QMainWindow *mainWindow) m_mainWindow = mainWindow; QDesignerWidgetFactoryInterface * wf = formWindow()->core()->widgetFactory(); // Pass on 0 parent first to avoid reparenting flicker. - m_toolBar = qobject_cast<QToolBar*>(wf->createWidget(QLatin1String("QToolBar"), 0)); + m_toolBar = qobject_cast<QToolBar*>(wf->createWidget(QStringLiteral("QToolBar"), 0)); wf->initialize(m_toolBar); m_toolBar->hide(); } @@ -1673,7 +1673,7 @@ void AddToolBarCommand::redo() QDesignerContainerExtension *c = qt_extension<QDesignerContainerExtension*>(core->extensionManager(), m_mainWindow); c->addWidget(m_toolBar); - m_toolBar->setObjectName(QLatin1String("toolBar")); + m_toolBar->setObjectName(QStringLiteral("toolBar")); formWindow()->ensureUniqueObjectName(m_toolBar); setPropertySheetWindowTitle(core, m_toolBar, m_toolBar->objectName()); formWindow()->emitSelectionChanged(); @@ -1724,7 +1724,7 @@ void AddDockWidgetCommand::init(QMainWindow *mainWindow) { m_mainWindow = mainWindow; QDesignerFormEditorInterface *core = formWindow()->core(); - m_dockWidget = qobject_cast<QDockWidget*>(core->widgetFactory()->createWidget(QLatin1String("QDockWidget"), m_mainWindow)); + m_dockWidget = qobject_cast<QDockWidget*>(core->widgetFactory()->createWidget(QStringLiteral("QDockWidget"), m_mainWindow)); } void AddDockWidgetCommand::redo() @@ -1733,7 +1733,7 @@ void AddDockWidgetCommand::redo() QDesignerContainerExtension *c = qt_extension<QDesignerContainerExtension*>(core->extensionManager(), m_mainWindow); c->addWidget(m_dockWidget); - m_dockWidget->setObjectName(QLatin1String("dockWidget")); + m_dockWidget->setObjectName(QStringLiteral("dockWidget")); formWindow()->ensureUniqueObjectName(m_dockWidget); formWindow()->manageWidget(m_dockWidget); formWindow()->emitSelectionChanged(); @@ -1814,7 +1814,7 @@ void AdjustWidgetSizeCommand::updatePropertyEditor() const { if (QDesignerPropertyEditorInterface *propertyEditor = formWindow()->core()->propertyEditor()) { if (propertyEditor->object() == m_widget) - propertyEditor->setPropertyValue(QLatin1String("geometry"), m_widget->geometry(), true); + propertyEditor->setPropertyValue(QStringLiteral("geometry"), m_widget->geometry(), true); } } // ------------ ChangeFormLayoutItemRoleCommand @@ -2094,16 +2094,16 @@ void AddContainerWidgetPageCommand::init(QWidget *containerWidget, ContainerType case PageContainer: setText(QApplication::translate("Command", "Insert Page")); m_widget = new QDesignerWidget(formWindow(), m_containerWidget); - m_widget->setObjectName(QLatin1String("page")); + m_widget->setObjectName(QStringLiteral("page")); break; case MdiContainer: setText(QApplication::translate("Command", "Insert Subwindow")); m_widget = new QDesignerWidget(formWindow(), m_containerWidget); - m_widget->setObjectName(QLatin1String("subwindow")); + m_widget->setObjectName(QStringLiteral("subwindow")); setPropertySheetWindowTitle(core, m_widget, QApplication::translate("Command", "Subwindow")); break; case WizardContainer: // Apply style, don't manage - m_widget = core->widgetFactory()->createWidget(QLatin1String("QWizardPage"), 0); + m_widget = core->widgetFactory()->createWidget(QStringLiteral("QWizardPage"), 0); break; } formWindow()->ensureUniqueObjectName(m_widget); diff --git a/src/designer/src/lib/shared/qdesigner_formbuilder.cpp b/src/designer/src/lib/shared/qdesigner_formbuilder.cpp index 3ad5a0558..f6c1bd13a 100644 --- a/src/designer/src/lib/shared/qdesigner_formbuilder.cpp +++ b/src/designer/src/lib/shared/qdesigner_formbuilder.cpp @@ -165,11 +165,11 @@ QWidget *QDesignerFormBuilder::createWidget(const QString &widgetName, QWidget * { QWidget *widget = 0; - if (widgetName == QLatin1String("QToolBar")) { + if (widgetName == QStringLiteral("QToolBar")) { widget = new QToolBar(parentWidget); - } else if (widgetName == QLatin1String("QMenu")) { + } else if (widgetName == QStringLiteral("QMenu")) { widget = new QMenu(parentWidget); - } else if (widgetName == QLatin1String("QMenuBar")) { + } else if (widgetName == QStringLiteral("QMenuBar")) { widget = new QMenuBar(parentWidget); } else { widget = core()->widgetFactory()->createWidget(widgetName, parentWidget); @@ -275,7 +275,7 @@ void QDesignerFormBuilder::applyProperties(QObject *o, const QList<DomProperty*> const QDesignerPropertySheetExtension *sheet = qt_extension<QDesignerPropertySheetExtension*>(core()->extensionManager(), o); const QDesignerDynamicPropertySheetExtension *dynamicSheet = qt_extension<QDesignerDynamicPropertySheetExtension*>(core()->extensionManager(), o); - const bool changingMetaObject = WidgetFactory::classNameOf(core(), o) == QLatin1String("QAxWidget"); + const bool changingMetaObject = WidgetFactory::classNameOf(core(), o) == QStringLiteral("QAxWidget"); const QDesignerMetaObjectInterface *meta = core()->introspection()->metaObject(o); const bool dynamicPropertiesAllowed = dynamicSheet && dynamicSheet->dynamicPropertiesAllowed(); @@ -313,7 +313,7 @@ void QDesignerFormBuilder::applyProperties(QObject *o, const QList<DomProperty*> QObject *obj = o; QAbstractScrollArea *scroll = qobject_cast<QAbstractScrollArea *>(o); - if (scroll && attributeName == QLatin1String("cursor") && scroll->viewport()) + if (scroll && attributeName == QStringLiteral("cursor") && scroll->viewport()) obj = scroll->viewport(); // a real property diff --git a/src/designer/src/lib/shared/qdesigner_formwindowcommand.cpp b/src/designer/src/lib/shared/qdesigner_formwindowcommand.cpp index 75dbeb755..b3c07efc3 100644 --- a/src/designer/src/lib/shared/qdesigner_formwindowcommand.cpp +++ b/src/designer/src/lib/shared/qdesigner_formwindowcommand.cpp @@ -119,7 +119,7 @@ void QDesignerFormWindowCommand::updateBuddies(QDesignerFormWindowInterface *for if (label_list.empty()) return; - const QString buddyProperty = QLatin1String("buddy"); + const QString buddyProperty = QStringLiteral("buddy"); const QByteArray oldNameU8 = old_name.toUtf8(); const QByteArray newNameU8 = new_name.toUtf8(); diff --git a/src/designer/src/lib/shared/qdesigner_introspection.cpp b/src/designer/src/lib/shared/qdesigner_introspection.cpp index ab5ac993d..5926a2416 100644 --- a/src/designer/src/lib/shared/qdesigner_introspection.cpp +++ b/src/designer/src/lib/shared/qdesigner_introspection.cpp @@ -99,7 +99,7 @@ namespace { QString QDesignerMetaEnum::separator() const { - static const QString rc = QLatin1String("::"); + static const QString rc = QStringLiteral("::"); return rc; } diff --git a/src/designer/src/lib/shared/qdesigner_membersheet.cpp b/src/designer/src/lib/shared/qdesigner_membersheet.cpp index afe054c88..c9ece1cdf 100644 --- a/src/designer/src/lib/shared/qdesigner_membersheet.cpp +++ b/src/designer/src/lib/shared/qdesigner_membersheet.cpp @@ -65,46 +65,46 @@ Qt3Members *Qt3Members::m_instance = 0; Qt3Members::Qt3Members() { - m_classNameToSignals[QLatin1String("QTextEdit")].append(QLatin1String("currentFontChanged(QFont)")); - m_classNameToSignals[QLatin1String("QTextEdit")].append(QLatin1String("currentColorChanged(QColor)")); - m_classNameToSignals[QLatin1String("QTabWidget")].append(QLatin1String("currentChanged(QWidget*)")); - m_classNameToSignals[QLatin1String("QTabWidget")].append(QLatin1String("selected(QString)")); - m_classNameToSignals[QLatin1String("QTabBar")].append(QLatin1String("selected(int)")); - m_classNameToSignals[QLatin1String("QMenuBar")].append(QLatin1String("activated(int)")); - m_classNameToSignals[QLatin1String("QMenuBar")].append(QLatin1String("highlighted(int)")); - m_classNameToSignals[QLatin1String("QMenu")].append(QLatin1String("activated(int)")); - m_classNameToSignals[QLatin1String("QMenu")].append(QLatin1String("highlighted(int)")); - m_classNameToSignals[QLatin1String("QLineEdit")].append(QLatin1String("lostFocus()")); - m_classNameToSignals[QLatin1String("QDial")].append(QLatin1String("dialPressed()")); - m_classNameToSignals[QLatin1String("QDial")].append(QLatin1String("dialMoved(int)")); - m_classNameToSignals[QLatin1String("QDial")].append(QLatin1String("dialReleased()")); - m_classNameToSignals[QLatin1String("QComboBox")].append(QLatin1String("textChanged(QString)")); - m_classNameToSignals[QLatin1String("QActionGroup")].append(QLatin1String("selected(QAction*)")); - m_classNameToSignals[QLatin1String("QAction")].append(QLatin1String("activated(int)")); - m_classNameToSignals[QLatin1String("QAbstractSocket")].append(QLatin1String("connectionClosed()")); - m_classNameToSignals[QLatin1String("QAbstractSocket")].append(QLatin1String("delayedCloseFinished()")); - - m_classNameToSlots[QLatin1String("QWidget")].append(QLatin1String("setShown(bool)")); - m_classNameToSlots[QLatin1String("QToolButton")].append(QLatin1String("setTextPosition(QToolButton::TextPosition)")); - m_classNameToSlots[QLatin1String("QToolButton")].append(QLatin1String("setUsesBigPixmap(bool)")); - m_classNameToSlots[QLatin1String("QToolButton")].append(QLatin1String("setUsesTextLabel(bool)")); - m_classNameToSlots[QLatin1String("QTextEdit")].append(QLatin1String("setModified(bool)")); - m_classNameToSlots[QLatin1String("QTextEdit")].append(QLatin1String("setColor(QColor)")); - m_classNameToSlots[QLatin1String("QTabWidget")].append(QLatin1String("setCurrentPage(int)")); - m_classNameToSlots[QLatin1String("QTabWidget")].append(QLatin1String("showPage(QWidget*)")); - m_classNameToSlots[QLatin1String("QTabWidget")].append(QLatin1String("removePage(QWidget*)")); - m_classNameToSlots[QLatin1String("QTabBar")].append(QLatin1String("setCurrentTab(int)")); - m_classNameToSlots[QLatin1String("QStatusBar")].append(QLatin1String("message(QString,int)")); - m_classNameToSlots[QLatin1String("QStatusBar")].append(QLatin1String("clear()")); - m_classNameToSlots[QLatin1String("QSplashScreen")].append(QLatin1String("message(QString,int)")); - m_classNameToSlots[QLatin1String("QSplashScreen")].append(QLatin1String("clear()")); - m_classNameToSlots[QLatin1String("QSlider")].append(QLatin1String("addStep()")); - m_classNameToSlots[QLatin1String("QSlider")].append(QLatin1String("subtractStep()")); - m_classNameToSlots[QLatin1String("QAbstractButton")].append(QLatin1String("setOn(bool)")); - m_classNameToSlots[QLatin1String("QAction")].append(QLatin1String("setOn(bool)")); - m_classNameToSlots[QLatin1String("QErrorMessage")].append(QLatin1String("message(QString)")); - m_classNameToSlots[QLatin1String("QTimer")].append(QLatin1String("changeInterval(int)")); - m_classNameToSlots[QLatin1String("QTimer")].append(QLatin1String("start(int,bool)")); + m_classNameToSignals[QStringLiteral("QTextEdit")].append(QStringLiteral("currentFontChanged(QFont)")); + m_classNameToSignals[QStringLiteral("QTextEdit")].append(QStringLiteral("currentColorChanged(QColor)")); + m_classNameToSignals[QStringLiteral("QTabWidget")].append(QStringLiteral("currentChanged(QWidget*)")); + m_classNameToSignals[QStringLiteral("QTabWidget")].append(QStringLiteral("selected(QString)")); + m_classNameToSignals[QStringLiteral("QTabBar")].append(QStringLiteral("selected(int)")); + m_classNameToSignals[QStringLiteral("QMenuBar")].append(QStringLiteral("activated(int)")); + m_classNameToSignals[QStringLiteral("QMenuBar")].append(QStringLiteral("highlighted(int)")); + m_classNameToSignals[QStringLiteral("QMenu")].append(QStringLiteral("activated(int)")); + m_classNameToSignals[QStringLiteral("QMenu")].append(QStringLiteral("highlighted(int)")); + m_classNameToSignals[QStringLiteral("QLineEdit")].append(QStringLiteral("lostFocus()")); + m_classNameToSignals[QStringLiteral("QDial")].append(QStringLiteral("dialPressed()")); + m_classNameToSignals[QStringLiteral("QDial")].append(QStringLiteral("dialMoved(int)")); + m_classNameToSignals[QStringLiteral("QDial")].append(QStringLiteral("dialReleased()")); + m_classNameToSignals[QStringLiteral("QComboBox")].append(QStringLiteral("textChanged(QString)")); + m_classNameToSignals[QStringLiteral("QActionGroup")].append(QStringLiteral("selected(QAction*)")); + m_classNameToSignals[QStringLiteral("QAction")].append(QStringLiteral("activated(int)")); + m_classNameToSignals[QStringLiteral("QAbstractSocket")].append(QStringLiteral("connectionClosed()")); + m_classNameToSignals[QStringLiteral("QAbstractSocket")].append(QStringLiteral("delayedCloseFinished()")); + + m_classNameToSlots[QStringLiteral("QWidget")].append(QStringLiteral("setShown(bool)")); + m_classNameToSlots[QStringLiteral("QToolButton")].append(QStringLiteral("setTextPosition(QToolButton::TextPosition)")); + m_classNameToSlots[QStringLiteral("QToolButton")].append(QStringLiteral("setUsesBigPixmap(bool)")); + m_classNameToSlots[QStringLiteral("QToolButton")].append(QStringLiteral("setUsesTextLabel(bool)")); + m_classNameToSlots[QStringLiteral("QTextEdit")].append(QStringLiteral("setModified(bool)")); + m_classNameToSlots[QStringLiteral("QTextEdit")].append(QStringLiteral("setColor(QColor)")); + m_classNameToSlots[QStringLiteral("QTabWidget")].append(QStringLiteral("setCurrentPage(int)")); + m_classNameToSlots[QStringLiteral("QTabWidget")].append(QStringLiteral("showPage(QWidget*)")); + m_classNameToSlots[QStringLiteral("QTabWidget")].append(QStringLiteral("removePage(QWidget*)")); + m_classNameToSlots[QStringLiteral("QTabBar")].append(QStringLiteral("setCurrentTab(int)")); + m_classNameToSlots[QStringLiteral("QStatusBar")].append(QStringLiteral("message(QString,int)")); + m_classNameToSlots[QStringLiteral("QStatusBar")].append(QStringLiteral("clear()")); + m_classNameToSlots[QStringLiteral("QSplashScreen")].append(QStringLiteral("message(QString,int)")); + m_classNameToSlots[QStringLiteral("QSplashScreen")].append(QStringLiteral("clear()")); + m_classNameToSlots[QStringLiteral("QSlider")].append(QStringLiteral("addStep()")); + m_classNameToSlots[QStringLiteral("QSlider")].append(QStringLiteral("subtractStep()")); + m_classNameToSlots[QStringLiteral("QAbstractButton")].append(QStringLiteral("setOn(bool)")); + m_classNameToSlots[QStringLiteral("QAction")].append(QStringLiteral("setOn(bool)")); + m_classNameToSlots[QStringLiteral("QErrorMessage")].append(QStringLiteral("message(QString)")); + m_classNameToSlots[QStringLiteral("QTimer")].append(QStringLiteral("changeInterval(int)")); + m_classNameToSlots[QStringLiteral("QTimer")].append(QStringLiteral("start(int,bool)")); } Qt3Members *Qt3Members::instance() @@ -270,7 +270,7 @@ bool QDesignerMemberSheet::isSlot(int index) const bool QDesignerMemberSheet::inheritedFromWidget(int index) const { const QString name = d->m_meta->method(index)->signature(); - return declaredInClass(index) == QLatin1String("QWidget") || declaredInClass(index) == QLatin1String("QObject"); + return declaredInClass(index) == QStringLiteral("QWidget") || declaredInClass(index) == QStringLiteral("QObject"); } diff --git a/src/designer/src/lib/shared/qdesigner_menu.cpp b/src/designer/src/lib/shared/qdesigner_menu.cpp index f5f2ae09f..47dedaa17 100644 --- a/src/designer/src/lib/shared/qdesigner_menu.cpp +++ b/src/designer/src/lib/shared/qdesigner_menu.cpp @@ -90,7 +90,7 @@ static inline void extendClickableArea(QRect *subMenuRect, Qt::LayoutDirection d QDesignerMenu::QDesignerMenu(QWidget *parent) : QMenu(parent), - m_subMenuPixmap(QPixmap(QLatin1String(":/trolltech/formeditor/images/submenu.png"))), + m_subMenuPixmap(QPixmap(QStringLiteral(":/trolltech/formeditor/images/submenu.png"))), m_currentIndex(0), m_addItem(new SpecialMenuAction(this)), m_addSeparator(new SpecialMenuAction(this)), @@ -116,7 +116,7 @@ QDesignerMenu::QDesignerMenu(QWidget *parent) : connect(m_deactivateWindowTimer, SIGNAL(timeout()), this, SLOT(slotDeactivateNow())); - m_editor->setObjectName(QLatin1String("__qt__passive_editor")); + m_editor->setObjectName(QStringLiteral("__qt__passive_editor")); m_editor->hide(); m_editor->installEventFilter(this); @@ -1007,7 +1007,7 @@ void QDesignerMenu::createRealMenuAction(QAction *action) core->widgetFactory()->initialize(menu); - const QString niceObjectName = ActionEditor::actionTextToName(menu->title(), QLatin1String("menu")); + const QString niceObjectName = ActionEditor::actionTextToName(menu->title(), QStringLiteral("menu")); menu->setObjectName(niceObjectName); core->metaDataBase()->add(menu); @@ -1205,7 +1205,7 @@ void QDesignerMenu::leaveEditMode(LeaveEditMode mode) } SetPropertyCommand *cmd = new SetPropertyCommand(fw); - cmd->init(action, QLatin1String("text"), m_editor->text()); + cmd->init(action, QStringLiteral("text"), m_editor->text()); fw->commandHistory()->push(cmd); if (parentMenu()) { diff --git a/src/designer/src/lib/shared/qdesigner_menubar.cpp b/src/designer/src/lib/shared/qdesigner_menubar.cpp index f26138214..af9b1fdd2 100644 --- a/src/designer/src/lib/shared/qdesigner_menubar.cpp +++ b/src/designer/src/lib/shared/qdesigner_menubar.cpp @@ -114,7 +114,7 @@ QDesignerMenuBar::QDesignerMenuBar(QWidget *parent) : italic.setItalic(true); m_addMenu->setFont(italic); - m_editor->setObjectName(QLatin1String("__qt__passive_editor")); + m_editor->setObjectName(QStringLiteral("__qt__passive_editor")); m_editor->hide(); m_editor->installEventFilter(this); installEventFilter(this); @@ -483,8 +483,8 @@ void QDesignerMenuBar::leaveEditMode(LeaveEditMode mode) fw->beginCommand(QApplication::translate("Command", "Change Title")); } else { fw->beginCommand(QApplication::translate("Command", "Insert Menu")); - const QString niceObjectName = ActionEditor::actionTextToName(m_editor->text(), QLatin1String("menu")); - QMenu *menu = qobject_cast<QMenu*>(fw->core()->widgetFactory()->createWidget(QLatin1String("QMenu"), this)); + const QString niceObjectName = ActionEditor::actionTextToName(m_editor->text(), QStringLiteral("menu")); + QMenu *menu = qobject_cast<QMenu*>(fw->core()->widgetFactory()->createWidget(QStringLiteral("QMenu"), this)); fw->core()->widgetFactory()->initialize(menu); menu->setObjectName(niceObjectName); menu->setTitle(tr("Menu")); @@ -496,7 +496,7 @@ void QDesignerMenuBar::leaveEditMode(LeaveEditMode mode) } SetPropertyCommand *cmd = new SetPropertyCommand(fw); - cmd->init(action, QLatin1String("text"), m_editor->text()); + cmd->init(action, QStringLiteral("text"), m_editor->text()); fw->commandHistory()->push(cmd); fw->endCommand(); } diff --git a/src/designer/src/lib/shared/qdesigner_promotion.cpp b/src/designer/src/lib/shared/qdesigner_promotion.cpp index 601cc19ea..4c3ad4791 100644 --- a/src/designer/src/lib/shared/qdesigner_promotion.cpp +++ b/src/designer/src/lib/shared/qdesigner_promotion.cpp @@ -62,14 +62,14 @@ namespace { const QSet<QString> &nonPromotableClasses() { static QSet<QString> rc; if (rc.empty()) { - rc.insert(QLatin1String("Line")); - rc.insert(QLatin1String("QAction")); - rc.insert(QLatin1String("Spacer")); - rc.insert(QLatin1String("QMainWindow")); - rc.insert(QLatin1String("QDialog")); - rc.insert(QLatin1String("QWorkspace")); - rc.insert(QLatin1String("QMdiArea")); - rc.insert(QLatin1String("QMdiSubWindow")); + rc.insert(QStringLiteral("Line")); + rc.insert(QStringLiteral("QAction")); + rc.insert(QStringLiteral("Spacer")); + rc.insert(QStringLiteral("QMainWindow")); + rc.insert(QStringLiteral("QDialog")); + rc.insert(QStringLiteral("QWorkspace")); + rc.insert(QStringLiteral("QMdiArea")); + rc.insert(QStringLiteral("QMdiSubWindow")); } return rc; } @@ -99,7 +99,7 @@ namespace { // extract class name from xml "<widget class="QWidget" ...>". Quite a hack. QString classNameFromXml(QString xml) { - static const QString tag = QLatin1String("class=\""); + static const QString tag = QStringLiteral("class=\""); const int pos = xml.indexOf(tag); if (pos == -1) return QString(); @@ -199,8 +199,8 @@ namespace qdesigner_internal { if (nonPromotableClasses().contains(name)) return false; - if (name.startsWith(QLatin1String("QDesigner")) || - name.startsWith(QLatin1String("QLayout"))) + if (name.startsWith(QStringLiteral("QDesigner")) || + name.startsWith(QStringLiteral("QLayout"))) return false; return true; diff --git a/src/designer/src/lib/shared/qdesigner_promotiondialog.cpp b/src/designer/src/lib/shared/qdesigner_promotiondialog.cpp index a79022a14..d4fadc2b4 100644 --- a/src/designer/src/lib/shared/qdesigner_promotiondialog.cpp +++ b/src/designer/src/lib/shared/qdesigner_promotiondialog.cpp @@ -96,7 +96,7 @@ namespace qdesigner_internal { setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Maximum); QHBoxLayout *hboxLayout = new QHBoxLayout(this); - m_classNameEdit->setValidator(new QRegExpValidator(QRegExp(QLatin1String("[_a-zA-Z:][:_a-zA-Z0-9]*")), m_classNameEdit)); + m_classNameEdit->setValidator(new QRegExpValidator(QRegExp(QStringLiteral("[_a-zA-Z:][:_a-zA-Z0-9]*")), m_classNameEdit)); connect(m_classNameEdit, SIGNAL(textChanged(QString)), this, SLOT(slotNameChanged(QString))); connect(m_includeFileEdit, SIGNAL(textChanged(QString)), this, SLOT(slotIncludeFileChanged(QString))); @@ -156,7 +156,7 @@ namespace qdesigner_internal { const QChar dot(QLatin1Char('.')); QString suggestedHeader = m_promotedHeaderLowerCase ? className.toLower() : className; - suggestedHeader.replace(QLatin1String("::"), QString(QLatin1Char('_'))); + suggestedHeader.replace(QStringLiteral("::"), QString(QLatin1Char('_'))); if (!m_promotedHeaderSuffix.startsWith(dot)) suggestedHeader += dot; suggestedHeader += m_promotedHeaderSuffix; @@ -251,7 +251,7 @@ namespace qdesigner_internal { preselectedBaseClass = baseClassNameList.indexOf(m_promotableWidgetClassName); } if (preselectedBaseClass == -1) - preselectedBaseClass = baseClassNameList.indexOf(QLatin1String("QFrame")); + preselectedBaseClass = baseClassNameList.indexOf(QStringLiteral("QFrame")); NewPromotedClassPanel *newPromotedClassPanel = new NewPromotedClassPanel(baseClassNameList, preselectedBaseClass); newPromotedClassPanel->setPromotedHeaderSuffix(core->integration()->headerSuffix()); diff --git a/src/designer/src/lib/shared/qdesigner_propertycommand.cpp b/src/designer/src/lib/shared/qdesigner_propertycommand.cpp index 723e01f43..f56f99b09 100644 --- a/src/designer/src/lib/shared/qdesigner_propertycommand.cpp +++ b/src/designer/src/lib/shared/qdesigner_propertycommand.cpp @@ -78,21 +78,21 @@ QString fontMask(unsigned m) { QString rc; if (m & QFont::FamilyResolved) - rc += QLatin1String("Family"); + rc += QStringLiteral("Family"); if (m & QFont::SizeResolved) - rc += QLatin1String("Size "); + rc += QStringLiteral("Size "); if (m & QFont::WeightResolved) - rc += QLatin1String("Bold "); + rc += QStringLiteral("Bold "); if (m & QFont::StyleResolved) - rc += QLatin1String("Style "); + rc += QStringLiteral("Style "); if (m & QFont::UnderlineResolved) - rc += QLatin1String("Underline "); + rc += QStringLiteral("Underline "); if (m & QFont::StrikeOutResolved) - rc += QLatin1String("StrikeOut "); + rc += QStringLiteral("StrikeOut "); if (m & QFont::KerningResolved) - rc += QLatin1String("Kerning "); + rc += QStringLiteral("Kerning "); if (m & QFont::StyleStrategyResolved) - rc += QLatin1String("StyleStrategy"); + rc += QStringLiteral("StyleStrategy"); return rc; } @@ -102,19 +102,19 @@ QString fontString(const QFont &f) QString rc; { const QChar comma = QLatin1Char(','); QTextStream str(&rc); - str << QLatin1String("QFont(\"") << f.family() << comma << + str << QStringLiteral("QFont(\"") << f.family() << comma << f.pointSize(); if (f.bold()) - str << comma << QLatin1String("bold"); + str << comma << QStringLiteral("bold"); if (f.italic()) - str << comma << QLatin1String("italic"); + str << comma << QStringLiteral("italic"); if (f.underline()) - str << comma << QLatin1String("underline"); + str << comma << QStringLiteral("underline"); if (f.strikeOut()) - str << comma << QLatin1String("strikeOut"); + str << comma << QStringLiteral("strikeOut"); if (f.kerning()) - str << comma << QLatin1String("kerning"); - str << comma << f.styleStrategy() << QLatin1String(" resolve: ") + str << comma << QStringLiteral("kerning"); + str << comma << f.styleStrategy() << QStringLiteral(" resolve: ") << fontMask(f.resolve()) << QLatin1Char(')'); } return rc; @@ -566,35 +566,35 @@ PropertyHelper::Value applySubProperty(const QVariant &oldValue, const QVariant // figure out special property enum SpecialProperty getSpecialProperty(const QString& propertyName) { - if (propertyName == QLatin1String("objectName")) + if (propertyName == QStringLiteral("objectName")) return SP_ObjectName; - if (propertyName == QLatin1String("layoutName")) + if (propertyName == QStringLiteral("layoutName")) return SP_LayoutName; - if (propertyName == QLatin1String("spacerName")) + if (propertyName == QStringLiteral("spacerName")) return SP_SpacerName; - if (propertyName == QLatin1String("icon")) + if (propertyName == QStringLiteral("icon")) return SP_Icon; - if (propertyName == QLatin1String("currentTabName")) + if (propertyName == QStringLiteral("currentTabName")) return SP_CurrentTabName; - if (propertyName == QLatin1String("currentItemName")) + if (propertyName == QStringLiteral("currentItemName")) return SP_CurrentItemName; - if (propertyName == QLatin1String("currentPageName")) + if (propertyName == QStringLiteral("currentPageName")) return SP_CurrentPageName; - if (propertyName == QLatin1String("geometry")) + if (propertyName == QStringLiteral("geometry")) return SP_Geometry; - if (propertyName == QLatin1String("windowTitle")) + if (propertyName == QStringLiteral("windowTitle")) return SP_WindowTitle; - if (propertyName == QLatin1String("minimumSize")) + if (propertyName == QStringLiteral("minimumSize")) return SP_MinimumSize; - if (propertyName == QLatin1String("maximumSize")) + if (propertyName == QStringLiteral("maximumSize")) return SP_MaximumSize; - if (propertyName == QLatin1String("alignment")) + if (propertyName == QStringLiteral("alignment")) return SP_Alignment; - if (propertyName == QLatin1String("autoDefault")) + if (propertyName == QStringLiteral("autoDefault")) return SP_AutoDefault; - if (propertyName == QLatin1String("shortcut")) + if (propertyName == QStringLiteral("shortcut")) return SP_Shortcut; - if (propertyName == QLatin1String("orientation")) + if (propertyName == QStringLiteral("orientation")) return SP_Orientation; return SP_None; } diff --git a/src/designer/src/lib/shared/qdesigner_propertyeditor.cpp b/src/designer/src/lib/shared/qdesigner_propertyeditor.cpp index 7c864deed..ef6d20776 100644 --- a/src/designer/src/lib/shared/qdesigner_propertyeditor.cpp +++ b/src/designer/src/lib/shared/qdesigner_propertyeditor.cpp @@ -62,31 +62,31 @@ static const PropertyNameTypeMap &stringPropertyTypes() if (propertyNameTypeMap.empty()) { const StringPropertyParameters richtext(ValidationRichText, true); // Accessibility. Both are texts the narrator reads - propertyNameTypeMap.insert(QLatin1String("accessibleDescription"), richtext); - propertyNameTypeMap.insert(QLatin1String("accessibleName"), richtext); + propertyNameTypeMap.insert(QStringLiteral("accessibleDescription"), richtext); + propertyNameTypeMap.insert(QStringLiteral("accessibleName"), richtext); // object names const StringPropertyParameters objectName(ValidationObjectName, false); - propertyNameTypeMap.insert(QLatin1String("buddy"), objectName); - propertyNameTypeMap.insert(QLatin1String("currentItemName"), objectName); - propertyNameTypeMap.insert(QLatin1String("currentPageName"), objectName); - propertyNameTypeMap.insert(QLatin1String("currentTabName"), objectName); - propertyNameTypeMap.insert(QLatin1String("layoutName"), objectName); - propertyNameTypeMap.insert(QLatin1String("spacerName"), objectName); + propertyNameTypeMap.insert(QStringLiteral("buddy"), objectName); + propertyNameTypeMap.insert(QStringLiteral("currentItemName"), objectName); + propertyNameTypeMap.insert(QStringLiteral("currentPageName"), objectName); + propertyNameTypeMap.insert(QStringLiteral("currentTabName"), objectName); + propertyNameTypeMap.insert(QStringLiteral("layoutName"), objectName); + propertyNameTypeMap.insert(QStringLiteral("spacerName"), objectName); // Style sheet - propertyNameTypeMap.insert(QLatin1String("styleSheet"), StringPropertyParameters(ValidationStyleSheet, false)); + propertyNameTypeMap.insert(QStringLiteral("styleSheet"), StringPropertyParameters(ValidationStyleSheet, false)); // Buttons/ QCommandLinkButton const StringPropertyParameters multiline(ValidationMultiLine, true); - propertyNameTypeMap.insert(QLatin1String("description"), multiline); - propertyNameTypeMap.insert(QLatin1String("iconText"), multiline); + propertyNameTypeMap.insert(QStringLiteral("description"), multiline); + propertyNameTypeMap.insert(QStringLiteral("iconText"), multiline); // Tooltips, etc. - propertyNameTypeMap.insert(QLatin1String("toolTip"), richtext); - propertyNameTypeMap.insert(QLatin1String("whatsThis"), richtext); - propertyNameTypeMap.insert(QLatin1String("windowIconText"), richtext); - propertyNameTypeMap.insert(QLatin1String("html"), richtext); + propertyNameTypeMap.insert(QStringLiteral("toolTip"), richtext); + propertyNameTypeMap.insert(QStringLiteral("whatsThis"), richtext); + propertyNameTypeMap.insert(QStringLiteral("windowIconText"), richtext); + propertyNameTypeMap.insert(QStringLiteral("html"), richtext); // A QWizard page id - propertyNameTypeMap.insert(QLatin1String("pageId"), StringPropertyParameters(ValidationSingleLine, false)); + propertyNameTypeMap.insert(QStringLiteral("pageId"), StringPropertyParameters(ValidationSingleLine, false)); // QPlainTextEdit - propertyNameTypeMap.insert(QLatin1String("plainText"), StringPropertyParameters(ValidationMultiLine, true)); + propertyNameTypeMap.insert(QStringLiteral("plainText"), StringPropertyParameters(ValidationMultiLine, true)); } return propertyNameTypeMap; } @@ -104,7 +104,7 @@ QDesignerPropertyEditor::StringPropertyParameters QDesignerPropertyEditor::textP const QString &propertyName, bool isMainContainer) { // object name - no comment - if (propertyName == QLatin1String("objectName")) { + if (propertyName == QStringLiteral("objectName")) { const TextPropertyValidationMode vm = isMainContainer ? ValidationObjectNameScope : ValidationObjectName; return StringPropertyParameters(vm, false); } @@ -124,7 +124,7 @@ QDesignerPropertyEditor::StringPropertyParameters QDesignerPropertyEditor::textP return hit.value(); // text: Check according to widget type. - if (propertyName == QLatin1String("text")) { + if (propertyName == QStringLiteral("text")) { if (qobject_cast<const QAction *>(object) || qobject_cast<const QLineEdit *>(object)) return StringPropertyParameters(ValidationSingleLine, true); if (qobject_cast<const QAbstractButton *>(object)) @@ -133,14 +133,14 @@ QDesignerPropertyEditor::StringPropertyParameters QDesignerPropertyEditor::textP } // Fuzzy matching - if (propertyName.endsWith(QLatin1String("Name"))) + if (propertyName.endsWith(QStringLiteral("Name"))) return StringPropertyParameters(ValidationSingleLine, true); - if (propertyName.endsWith(QLatin1String("ToolTip"))) + if (propertyName.endsWith(QStringLiteral("ToolTip"))) return StringPropertyParameters(ValidationRichText, true); #ifdef Q_OS_WIN // No translation for the active X "control" property - if (propertyName == QLatin1String("control") && className == QLatin1String("QAxWidget")) + if (propertyName == QStringLiteral("control") && className == QStringLiteral("QAxWidget")) return StringPropertyParameters(ValidationSingleLine, false); #endif diff --git a/src/designer/src/lib/shared/qdesigner_propertysheet.cpp b/src/designer/src/lib/shared/qdesigner_propertysheet.cpp index 0623b41e6..68ed9efc4 100644 --- a/src/designer/src/lib/shared/qdesigner_propertysheet.cpp +++ b/src/designer/src/lib/shared/qdesigner_propertysheet.cpp @@ -467,24 +467,24 @@ QString QDesignerPropertySheetPrivate::transformLayoutPropertyName(int index) co typedef QMap<QDesignerPropertySheet::PropertyType, QString> TypeNameMap; static TypeNameMap typeNameMap; if (typeNameMap.empty()) { - typeNameMap.insert(QDesignerPropertySheet::PropertyLayoutObjectName, QLatin1String("objectName")); - typeNameMap.insert(QDesignerPropertySheet::PropertyLayoutLeftMargin, QLatin1String("leftMargin")); - typeNameMap.insert(QDesignerPropertySheet::PropertyLayoutTopMargin, QLatin1String("topMargin")); - typeNameMap.insert(QDesignerPropertySheet::PropertyLayoutRightMargin, QLatin1String("rightMargin")); - typeNameMap.insert(QDesignerPropertySheet::PropertyLayoutBottomMargin, QLatin1String("bottomMargin")); - typeNameMap.insert(QDesignerPropertySheet::PropertyLayoutSpacing, QLatin1String("spacing")); - typeNameMap.insert(QDesignerPropertySheet::PropertyLayoutHorizontalSpacing, QLatin1String("horizontalSpacing")); - typeNameMap.insert(QDesignerPropertySheet::PropertyLayoutVerticalSpacing, QLatin1String("verticalSpacing")); - typeNameMap.insert(QDesignerPropertySheet::PropertyLayoutSizeConstraint, QLatin1String("sizeConstraint")); - typeNameMap.insert(QDesignerPropertySheet::PropertyLayoutFieldGrowthPolicy, QLatin1String("fieldGrowthPolicy")); - typeNameMap.insert(QDesignerPropertySheet::PropertyLayoutRowWrapPolicy, QLatin1String("rowWrapPolicy")); - typeNameMap.insert(QDesignerPropertySheet::PropertyLayoutLabelAlignment, QLatin1String("labelAlignment")); - typeNameMap.insert(QDesignerPropertySheet::PropertyLayoutFormAlignment, QLatin1String("formAlignment")); - typeNameMap.insert(QDesignerPropertySheet::PropertyLayoutBoxStretch, QLatin1String("stretch")); - typeNameMap.insert(QDesignerPropertySheet::PropertyLayoutGridRowStretch, QLatin1String("rowStretch")); - typeNameMap.insert(QDesignerPropertySheet::PropertyLayoutGridColumnStretch, QLatin1String("columnStretch")); - typeNameMap.insert(QDesignerPropertySheet::PropertyLayoutGridRowMinimumHeight, QLatin1String("rowMinimumHeight")); - typeNameMap.insert(QDesignerPropertySheet::PropertyLayoutGridColumnMinimumWidth, QLatin1String("columnMinimumWidth")); + typeNameMap.insert(QDesignerPropertySheet::PropertyLayoutObjectName, QStringLiteral("objectName")); + typeNameMap.insert(QDesignerPropertySheet::PropertyLayoutLeftMargin, QStringLiteral("leftMargin")); + typeNameMap.insert(QDesignerPropertySheet::PropertyLayoutTopMargin, QStringLiteral("topMargin")); + typeNameMap.insert(QDesignerPropertySheet::PropertyLayoutRightMargin, QStringLiteral("rightMargin")); + typeNameMap.insert(QDesignerPropertySheet::PropertyLayoutBottomMargin, QStringLiteral("bottomMargin")); + typeNameMap.insert(QDesignerPropertySheet::PropertyLayoutSpacing, QStringLiteral("spacing")); + typeNameMap.insert(QDesignerPropertySheet::PropertyLayoutHorizontalSpacing, QStringLiteral("horizontalSpacing")); + typeNameMap.insert(QDesignerPropertySheet::PropertyLayoutVerticalSpacing, QStringLiteral("verticalSpacing")); + typeNameMap.insert(QDesignerPropertySheet::PropertyLayoutSizeConstraint, QStringLiteral("sizeConstraint")); + typeNameMap.insert(QDesignerPropertySheet::PropertyLayoutFieldGrowthPolicy, QStringLiteral("fieldGrowthPolicy")); + typeNameMap.insert(QDesignerPropertySheet::PropertyLayoutRowWrapPolicy, QStringLiteral("rowWrapPolicy")); + typeNameMap.insert(QDesignerPropertySheet::PropertyLayoutLabelAlignment, QStringLiteral("labelAlignment")); + typeNameMap.insert(QDesignerPropertySheet::PropertyLayoutFormAlignment, QStringLiteral("formAlignment")); + typeNameMap.insert(QDesignerPropertySheet::PropertyLayoutBoxStretch, QStringLiteral("stretch")); + typeNameMap.insert(QDesignerPropertySheet::PropertyLayoutGridRowStretch, QStringLiteral("rowStretch")); + typeNameMap.insert(QDesignerPropertySheet::PropertyLayoutGridColumnStretch, QStringLiteral("columnStretch")); + typeNameMap.insert(QDesignerPropertySheet::PropertyLayoutGridRowMinimumHeight, QStringLiteral("rowMinimumHeight")); + typeNameMap.insert(QDesignerPropertySheet::PropertyLayoutGridColumnMinimumWidth, QStringLiteral("columnMinimumWidth")); } const TypeNameMap::const_iterator it = typeNameMap.constFind(propertyType(index)); if (it != typeNameMap.constEnd()) @@ -534,20 +534,20 @@ QDesignerPropertySheet::PropertyType QDesignerPropertySheet::propertyTypeFromNam propertyTypeHash.insert(QLatin1String(layoutGridColumnStretchPropertyC), PropertyLayoutGridColumnStretch); propertyTypeHash.insert(QLatin1String(layoutGridRowMinimumHeightC), PropertyLayoutGridRowMinimumHeight); propertyTypeHash.insert(QLatin1String(layoutGridColumnMinimumWidthC), PropertyLayoutGridColumnMinimumWidth); - propertyTypeHash.insert(QLatin1String("buddy"), PropertyBuddy); - propertyTypeHash.insert(QLatin1String("geometry"), PropertyGeometry); - propertyTypeHash.insert(QLatin1String("checkable"), PropertyCheckable); - propertyTypeHash.insert(QLatin1String("accessibleName"), PropertyAccessibility); - propertyTypeHash.insert(QLatin1String("accessibleDescription"), PropertyAccessibility); - propertyTypeHash.insert(QLatin1String("windowTitle"), PropertyWindowTitle); - propertyTypeHash.insert(QLatin1String("windowIcon"), PropertyWindowIcon); - propertyTypeHash.insert(QLatin1String("windowFilePath"), PropertyWindowFilePath); - propertyTypeHash.insert(QLatin1String("windowOpacity"), PropertyWindowOpacity); - propertyTypeHash.insert(QLatin1String("windowIconText"), PropertyWindowIconText); - propertyTypeHash.insert(QLatin1String("windowModality"), PropertyWindowModality); - propertyTypeHash.insert(QLatin1String("windowModified"), PropertyWindowModified); - propertyTypeHash.insert(QLatin1String("styleSheet"), PropertyStyleSheet); - propertyTypeHash.insert(QLatin1String("text"), PropertyText); + propertyTypeHash.insert(QStringLiteral("buddy"), PropertyBuddy); + propertyTypeHash.insert(QStringLiteral("geometry"), PropertyGeometry); + propertyTypeHash.insert(QStringLiteral("checkable"), PropertyCheckable); + propertyTypeHash.insert(QStringLiteral("accessibleName"), PropertyAccessibility); + propertyTypeHash.insert(QStringLiteral("accessibleDescription"), PropertyAccessibility); + propertyTypeHash.insert(QStringLiteral("windowTitle"), PropertyWindowTitle); + propertyTypeHash.insert(QStringLiteral("windowIcon"), PropertyWindowIcon); + propertyTypeHash.insert(QStringLiteral("windowFilePath"), PropertyWindowFilePath); + propertyTypeHash.insert(QStringLiteral("windowOpacity"), PropertyWindowOpacity); + propertyTypeHash.insert(QStringLiteral("windowIconText"), PropertyWindowIconText); + propertyTypeHash.insert(QStringLiteral("windowModality"), PropertyWindowModality); + propertyTypeHash.insert(QStringLiteral("windowModified"), PropertyWindowModified); + propertyTypeHash.insert(QStringLiteral("styleSheet"), PropertyStyleSheet); + propertyTypeHash.insert(QStringLiteral("text"), PropertyText); } return propertyTypeHash.value(name, PropertyNone); } @@ -559,7 +559,7 @@ QDesignerPropertySheet::QDesignerPropertySheet(QObject *object, QObject *parent) typedef QDesignerPropertySheetPrivate::Info Info; const QDesignerMetaObjectInterface *baseMeta = d->m_meta; - while (baseMeta &&baseMeta->className().startsWith(QLatin1String("QDesigner"))) { + while (baseMeta &&baseMeta->className().startsWith(QStringLiteral("QDesigner"))) { baseMeta = baseMeta->superClass(); } Q_ASSERT(baseMeta != 0); @@ -603,26 +603,26 @@ QDesignerPropertySheet::QDesignerPropertySheet(QObject *object, QObject *parent) } if (object->isWidgetType()) { - createFakeProperty(QLatin1String("focusPolicy")); - createFakeProperty(QLatin1String("cursor")); - createFakeProperty(QLatin1String("toolTip")); - createFakeProperty(QLatin1String("whatsThis")); - createFakeProperty(QLatin1String("acceptDrops")); - createFakeProperty(QLatin1String("dragEnabled")); + createFakeProperty(QStringLiteral("focusPolicy")); + createFakeProperty(QStringLiteral("cursor")); + createFakeProperty(QStringLiteral("toolTip")); + createFakeProperty(QStringLiteral("whatsThis")); + createFakeProperty(QStringLiteral("acceptDrops")); + createFakeProperty(QStringLiteral("dragEnabled")); // windowModality/Opacity is visible only for the main container, in which case the form windows enables it on loading - setVisible(createFakeProperty(QLatin1String("windowModality")), false); - setVisible(createFakeProperty(QLatin1String("windowOpacity"), double(1.0)), false); + setVisible(createFakeProperty(QStringLiteral("windowModality")), false); + setVisible(createFakeProperty(QStringLiteral("windowOpacity"), double(1.0)), false); if (qobject_cast<const QToolBar *>(d->m_object)) { // prevent toolbars from being dragged off - createFakeProperty(QLatin1String("floatable"), QVariant(true)); + createFakeProperty(QStringLiteral("floatable"), QVariant(true)); } else { if (qobject_cast<const QMenuBar *>(d->m_object)) { // Keep the menu bar editable in the form even if a native menu bar is used. const bool nativeMenuBarDefault = !qApp->testAttribute(Qt::AA_DontUseNativeMenuBar); - createFakeProperty(QLatin1String("nativeMenuBar"), QVariant(nativeMenuBarDefault)); + createFakeProperty(QStringLiteral("nativeMenuBar"), QVariant(nativeMenuBarDefault)); } } if (d->m_canHaveLayoutAttributes) { - static const QString layoutGroup = QLatin1String("Layout"); + static const QString layoutGroup = QStringLiteral("Layout"); const char* fakeLayoutProperties[] = { layoutObjectNameC, layoutLeftMarginC, layoutTopMarginC, layoutRightMarginC, layoutBottomMarginC, layoutSpacingC, layoutHorizontalSpacingC, layoutVerticalSpacingC, layoutFieldGrowthPolicyC, layoutRowWrapPolicyC, layoutLabelAlignmentC, layoutFormAlignmentC, @@ -642,19 +642,19 @@ QDesignerPropertySheet::QDesignerPropertySheet(QObject *object, QObject *parent) } if (d->m_objectType == ObjectLabel) - createFakeProperty(QLatin1String("buddy"), QVariant(QByteArray())); + createFakeProperty(QStringLiteral("buddy"), QVariant(QByteArray())); /* We need to create a fake property since the property does not work * for non-toplevel windows or on other systems than Mac and only if * it is above a certain Mac OS version. */ if (qobject_cast<const QMainWindow *>(d->m_object)) - createFakeProperty(QLatin1String("unifiedTitleAndToolBarOnMac"), false); + createFakeProperty(QStringLiteral("unifiedTitleAndToolBarOnMac"), false); } if (qobject_cast<const QDialog*>(object)) { - createFakeProperty(QLatin1String("modal")); + createFakeProperty(QStringLiteral("modal")); } if (qobject_cast<const QDockWidget*>(object)) { - createFakeProperty(QLatin1String("floating")); + createFakeProperty(QStringLiteral("floating")); } typedef QList<QByteArray> ByteArrayList; @@ -691,8 +691,8 @@ bool QDesignerPropertySheet::dynamicPropertiesAllowed() const bool QDesignerPropertySheet::canAddDynamicProperty(const QString &propName) const { // used internally - if (propName == QLatin1String("database") || - propName == QLatin1String("buttonGroupId")) + if (propName == QStringLiteral("database") || + propName == QStringLiteral("buttonGroupId")) return false; const int index = d->m_meta->indexOfProperty(propName); if (index != -1) @@ -704,7 +704,7 @@ bool QDesignerPropertySheet::canAddDynamicProperty(const QString &propName) cons else return true; } - if (!QDesignerPropertySheet::internalDynamicPropertiesEnabled() && propName.startsWith(QLatin1String("_q_"))) + if (!QDesignerPropertySheet::internalDynamicPropertiesEnabled() && propName.startsWith(QStringLiteral("_q_"))) return false; return true; } @@ -1158,7 +1158,7 @@ void QDesignerPropertySheet::setProperty(int index, const QVariant &value) const QDesignerMetaPropertyInterface *p = d->m_meta->property(index); p->write(d->m_object, resolvePropertyValue(index, value)); if (qobject_cast<QGroupBox *>(d->m_object) && propertyType(index) == PropertyCheckable) { - const int idx = indexOf(QLatin1String("focusPolicy")); + const int idx = indexOf(QStringLiteral("focusPolicy")); if (!isChanged(idx)) { qdesigner_internal::PropertySheetEnumValue e = qvariant_cast<qdesigner_internal::PropertySheetEnumValue>(property(idx)); if (value.toBool()) { @@ -1195,7 +1195,7 @@ bool QDesignerPropertySheet::reset(int index) if (d->isStringProperty(index)) { qdesigner_internal::PropertySheetStringValue value; // Main container: Reset to stored class name as not to change the file names generated by uic. - if (propertyName(index) == QLatin1String("objectName")) { + if (propertyName(index) == QStringLiteral("objectName")) { const QVariant classNameDefaultV = d->m_object->property("_q_classname"); if (classNameDefaultV.isValid()) value.setValue(classNameDefaultV.toString()); diff --git a/src/designer/src/lib/shared/qdesigner_stackedbox.cpp b/src/designer/src/lib/shared/qdesigner_stackedbox.cpp index 547024ada..34b88e1de 100644 --- a/src/designer/src/lib/shared/qdesigner_stackedbox.cpp +++ b/src/designer/src/lib/shared/qdesigner_stackedbox.cpp @@ -74,8 +74,8 @@ QStackedWidgetPreviewEventFilter::QStackedWidgetPreviewEventFilter(QStackedWidge QObject(parent), m_buttonToolTipEnabled(false), // Not on preview m_stackedWidget(parent), - m_prev(createToolButton(m_stackedWidget, Qt::LeftArrow, QLatin1String("__qt__passive_prev"))), - m_next(createToolButton(m_stackedWidget, Qt::RightArrow, QLatin1String("__qt__passive_next"))) + m_prev(createToolButton(m_stackedWidget, Qt::LeftArrow, QStringLiteral("__qt__passive_prev"))), + m_next(createToolButton(m_stackedWidget, Qt::RightArrow, QStringLiteral("__qt__passive_next"))) { connect(m_prev, SIGNAL(clicked()), this, SLOT(prevPage())); connect(m_next, SIGNAL(clicked()), this, SLOT(nextPage())); @@ -169,12 +169,12 @@ static inline QString stackedClassName(QStackedWidget *w) { if (const QDesignerFormWindowInterface *fw = QDesignerFormWindowInterface::findFormWindow(w)) return qdesigner_internal::WidgetFactory::classNameOf(fw->core(), w); - return QLatin1String("Stacked widget"); + return QStringLiteral("Stacked widget"); } void QStackedWidgetPreviewEventFilter::updateButtonToolTip(QObject *o) { - QString className = QLatin1String("Stacked widget"); + QString className = QStringLiteral("Stacked widget"); if (const QDesignerFormWindowInterface *fw = QDesignerFormWindowInterface::findFormWindow(m_stackedWidget)) className = qdesigner_internal::WidgetFactory::classNameOf(fw->core(), m_stackedWidget); if (o == m_prev) { @@ -301,7 +301,7 @@ void QStackedWidgetEventFilter::gotoPage(int page) { // Are we on a form or in a preview? if (QDesignerFormWindowInterface *fw = QDesignerFormWindowInterface::findFormWindow(stackedWidget())) { qdesigner_internal::SetPropertyCommand *cmd = new qdesigner_internal::SetPropertyCommand(fw); - cmd->init(stackedWidget(), QLatin1String("currentIndex"), page); + cmd->init(stackedWidget(), QStringLiteral("currentIndex"), page); fw->commandHistory()->push(cmd); fw->emitSelectionChanged(); // Magically prevent an endless loop triggered by auto-repeat. updateButtons(); diff --git a/src/designer/src/lib/shared/qdesigner_tabwidget.cpp b/src/designer/src/lib/shared/qdesigner_tabwidget.cpp index 33091625e..9472fada1 100644 --- a/src/designer/src/lib/shared/qdesigner_tabwidget.cpp +++ b/src/designer/src/lib/shared/qdesigner_tabwidget.cpp @@ -194,7 +194,7 @@ bool QTabWidgetEventFilter::eventFilter(QObject *o, QEvent *e) if (tabbar->tabRect(i).contains(m_pressPoint)) { if (i != tabbar->currentIndex()) { qdesigner_internal::SetPropertyCommand *cmd = new qdesigner_internal::SetPropertyCommand(fw); - cmd->init(m_tabWidget, QLatin1String("currentIndex"), i); + cmd->init(m_tabWidget, QStringLiteral("currentIndex"), i); fw->commandHistory()->push(cmd); } break; diff --git a/src/designer/src/lib/shared/qdesigner_taskmenu.cpp b/src/designer/src/lib/shared/qdesigner_taskmenu.cpp index 0dc2f4d6c..1b5e20673 100644 --- a/src/designer/src/lib/shared/qdesigner_taskmenu.cpp +++ b/src/designer/src/lib/shared/qdesigner_taskmenu.cpp @@ -126,7 +126,7 @@ static QString objName(const QDesignerFormEditorInterface *core, QObject *object = qt_extension<QDesignerPropertySheetExtension*>(core->extensionManager(), object); Q_ASSERT(sheet != 0); - const QString objectNameProperty = QLatin1String("objectName"); + const QString objectNameProperty = QStringLiteral("objectName"); const int index = sheet->indexOf(objectNameProperty); const qdesigner_internal::PropertySheetStringValue objectNameValue = qvariant_cast<qdesigner_internal::PropertySheetStringValue>(sheet->property(index)); @@ -565,7 +565,7 @@ void QDesignerTaskMenu::changeObjectName() if (dialog.exec() == QDialog::Accepted) { const QString newObjectName = dialog.newObjectName(); if (!newObjectName.isEmpty() && newObjectName != oldObjectName ) { - const QString objectNameProperty = QLatin1String("objectName"); + const QString objectNameProperty = QStringLiteral("objectName"); PropertySheetStringValue objectNameValue; objectNameValue.setValue(newObjectName); setProperty(fw, CurrentWidgetMode, objectNameProperty, QVariant::fromValue(objectNameValue)); @@ -624,12 +624,12 @@ void QDesignerTaskMenu::changeTextProperty(const QString &propertyName, const QS void QDesignerTaskMenu::changeToolTip() { - changeTextProperty(QLatin1String("toolTip"), tr("Edit ToolTip"), MultiSelectionMode, Qt::AutoText); + changeTextProperty(QStringLiteral("toolTip"), tr("Edit ToolTip"), MultiSelectionMode, Qt::AutoText); } void QDesignerTaskMenu::changeWhatsThis() { - changeTextProperty(QLatin1String("whatsThis"), tr("Edit WhatsThis"), MultiSelectionMode, Qt::AutoText); + changeTextProperty(QStringLiteral("whatsThis"), tr("Edit WhatsThis"), MultiSelectionMode, Qt::AutoText); } void QDesignerTaskMenu::changeStyleSheet() @@ -809,7 +809,7 @@ static void createSizeCommand(QDesignerFormWindowInterface *fw, QWidget *w, int if (flags & ApplyMinimumHeight) minimumSize.setHeight(size.height()); SetPropertyCommand* cmd = new SetPropertyCommand(fw); - cmd->init(w, QLatin1String("minimumSize"), minimumSize); + cmd->init(w, QStringLiteral("minimumSize"), minimumSize); fw->commandHistory()->push(cmd); } if (flags & (ApplyMaximumWidth|ApplyMaximumHeight)) { @@ -819,7 +819,7 @@ static void createSizeCommand(QDesignerFormWindowInterface *fw, QWidget *w, int if (flags & ApplyMaximumHeight) maximumSize.setHeight(size.height()); SetPropertyCommand* cmd = new SetPropertyCommand(fw); - cmd->init(w, QLatin1String("maximumSize"), maximumSize); + cmd->init(w, QStringLiteral("maximumSize"), maximumSize); fw->commandHistory()->push(cmd); } } diff --git a/src/designer/src/lib/shared/qdesigner_toolbar.cpp b/src/designer/src/lib/shared/qdesigner_toolbar.cpp index ad17d1dd0..ed7377b6b 100644 --- a/src/designer/src/lib/shared/qdesigner_toolbar.cpp +++ b/src/designer/src/lib/shared/qdesigner_toolbar.cpp @@ -233,7 +233,7 @@ void ToolBarEventFilter::slotInsertSeparator() QAction *theSender = qobject_cast<QAction*>(sender()); QAction *previous = qvariant_cast<QAction *>(theSender->data()); fw->beginCommand(tr("Insert Separator")); - QAction *action = createAction(fw, QLatin1String("separator"), true); + QAction *action = createAction(fw, QStringLiteral("separator"), true); InsertActionIntoCommand *cmd = new InsertActionIntoCommand(fw); cmd->init(m_toolBar, action, previous); fw->commandHistory()->push(cmd); diff --git a/src/designer/src/lib/shared/qdesigner_utils.cpp b/src/designer/src/lib/shared/qdesigner_utils.cpp index 063e0873f..2008e3573 100644 --- a/src/designer/src/lib/shared/qdesigner_utils.cpp +++ b/src/designer/src/lib/shared/qdesigner_utils.cpp @@ -762,7 +762,7 @@ namespace qdesigner_internal } if (!action) { if (const QDesignerTaskMenuExtension *taskMenu = qobject_cast<QDesignerTaskMenuExtension *>( - core->extensionManager()->extension(managedWidget, QLatin1String("QDesignerInternalTaskMenuExtension")))) { + core->extensionManager()->extension(managedWidget, QStringLiteral("QDesignerInternalTaskMenuExtension")))) { action = taskMenu->preferredEditAction(); if (!action) { const QList<QAction *> actions = taskMenu->taskActions(); @@ -776,7 +776,7 @@ namespace qdesigner_internal QDESIGNER_SHARED_EXPORT bool runUIC(const QString &fileName, QByteArray& ba, QString &errorMessage) { - const QString binary = QLibraryInfo::location(QLibraryInfo::BinariesPath) + QLatin1String("/uic"); + const QString binary = QLibraryInfo::location(QLibraryInfo::BinariesPath) + QStringLiteral("/uic"); QProcess uic; uic.start(binary, QStringList(fileName)); if (!uic.waitForStarted()) { diff --git a/src/designer/src/lib/shared/qdesigner_widgetbox.cpp b/src/designer/src/lib/shared/qdesigner_widgetbox.cpp index 98169918b..1468b7b56 100644 --- a/src/designer/src/lib/shared/qdesigner_widgetbox.cpp +++ b/src/designer/src/lib/shared/qdesigner_widgetbox.cpp @@ -166,10 +166,10 @@ bool QDesignerWidgetBox::findWidget(const QDesignerWidgetBoxInterface *wbox, // Note that entry names do not necessarily match the class name // (at least, not for the standard widgets), so, // look in the XML for the class name of the first widget to appear - const QString widgetTag = QLatin1String("<widget"); - QString pattern = QLatin1String("^<widget\\s+class\\s*=\\s*\""); + const QString widgetTag = QStringLiteral("<widget"); + QString pattern = QStringLiteral("^<widget\\s+class\\s*=\\s*\""); pattern += className; - pattern += QLatin1String("\".*$"); + pattern += QStringLiteral("\".*$"); const QRegExp regexp(pattern); Q_ASSERT(regexp.isValid()); const int catCount = wbox->categoryCount(); @@ -203,7 +203,7 @@ DomUI *QDesignerWidgetBox::xmlToUi(const QString &name, const QString &xml, bool // The xml description must either contain a root element "ui" with a child element "widget" // or "widget" as the root element (4.3 legacy) - const QString widgetTag = QLatin1String("widget"); + const QString widgetTag = QStringLiteral("widget"); while (!reader.atEnd()) { if (reader.readNext() == QXmlStreamReader::StartElement) { @@ -213,12 +213,12 @@ DomUI *QDesignerWidgetBox::xmlToUi(const QString &name, const QString &xml, bool continue; } - if (name.compare(QLatin1String("widget"), Qt::CaseInsensitive) == 0) { // 4.3 legacy, wrap into DomUI + if (name.compare(QStringLiteral("widget"), Qt::CaseInsensitive) == 0) { // 4.3 legacy, wrap into DomUI ui = new DomUI; DomWidget *widget = new DomWidget; widget->read(reader); ui->setElementWidget(widget); - } else if (name.compare(QLatin1String("ui"), Qt::CaseInsensitive) == 0) { // 4.4 + } else if (name.compare(QStringLiteral("ui"), Qt::CaseInsensitive) == 0) { // 4.4 ui = new DomUI; ui->read(reader); } else { @@ -245,7 +245,7 @@ DomUI *QDesignerWidgetBox::xmlToUi(const QString &name, const QString &xml, bool if (insertFakeTopLevel) { DomWidget *fakeTopLevel = new DomWidget; - fakeTopLevel->setAttributeClass(QLatin1String("QWidget")); + fakeTopLevel->setAttributeClass(QStringLiteral("QWidget")); QList<DomWidget *> children; children.push_back(ui->takeElementWidget()); fakeTopLevel->setElementWidget(children); diff --git a/src/designer/src/lib/shared/qscripthighlighter.cpp b/src/designer/src/lib/shared/qscripthighlighter.cpp index f24fec502..57f5be4b4 100644 --- a/src/designer/src/lib/shared/qscripthighlighter.cpp +++ b/src/designer/src/lib/shared/qscripthighlighter.cpp @@ -48,75 +48,75 @@ QT_BEGIN_NAMESPACE static const QSet<QString> &qscriptKeywords() { static QSet<QString> keywords; if (keywords.empty()) { - keywords.insert(QLatin1String("Infinity")); - keywords.insert(QLatin1String("NaN")); - keywords.insert(QLatin1String("abstract")); - keywords.insert(QLatin1String("boolean")); - keywords.insert(QLatin1String("break")); - keywords.insert(QLatin1String("byte")); - keywords.insert(QLatin1String("case")); - keywords.insert(QLatin1String("catch")); - keywords.insert(QLatin1String("char")); - keywords.insert(QLatin1String("class")); - keywords.insert(QLatin1String("const")); - keywords.insert(QLatin1String("constructor")); - keywords.insert(QLatin1String("continue")); - keywords.insert(QLatin1String("debugger")); - keywords.insert(QLatin1String("default")); - keywords.insert(QLatin1String("delete")); - keywords.insert(QLatin1String("do")); - keywords.insert(QLatin1String("double")); - keywords.insert(QLatin1String("else")); - keywords.insert(QLatin1String("enum")); - keywords.insert(QLatin1String("export")); - keywords.insert(QLatin1String("extends")); - keywords.insert(QLatin1String("false")); - keywords.insert(QLatin1String("final")); - keywords.insert(QLatin1String("finally")); - keywords.insert(QLatin1String("float")); - keywords.insert(QLatin1String("for")); - keywords.insert(QLatin1String("function")); - keywords.insert(QLatin1String("goto")); - keywords.insert(QLatin1String("if")); - keywords.insert(QLatin1String("implements")); - keywords.insert(QLatin1String("import")); - keywords.insert(QLatin1String("in")); - keywords.insert(QLatin1String("instanceof")); - keywords.insert(QLatin1String("int")); - keywords.insert(QLatin1String("interface")); - keywords.insert(QLatin1String("long")); - keywords.insert(QLatin1String("native")); - keywords.insert(QLatin1String("new")); - keywords.insert(QLatin1String("package")); - keywords.insert(QLatin1String("private")); - keywords.insert(QLatin1String("protected")); - keywords.insert(QLatin1String("public")); - keywords.insert(QLatin1String("return")); - keywords.insert(QLatin1String("short")); - keywords.insert(QLatin1String("static")); - keywords.insert(QLatin1String("super")); - keywords.insert(QLatin1String("switch")); - keywords.insert(QLatin1String("synchronized")); - keywords.insert(QLatin1String("this")); - keywords.insert(QLatin1String("throw")); - keywords.insert(QLatin1String("throws")); - keywords.insert(QLatin1String("transient")); - keywords.insert(QLatin1String("true")); - keywords.insert(QLatin1String("try")); - keywords.insert(QLatin1String("typeof")); - keywords.insert(QLatin1String("undefined")); - keywords.insert(QLatin1String("var")); - keywords.insert(QLatin1String("void")); - keywords.insert(QLatin1String("volatile")); - keywords.insert(QLatin1String("while")); - keywords.insert(QLatin1String("with")); // end + keywords.insert(QStringLiteral("Infinity")); + keywords.insert(QStringLiteral("NaN")); + keywords.insert(QStringLiteral("abstract")); + keywords.insert(QStringLiteral("boolean")); + keywords.insert(QStringLiteral("break")); + keywords.insert(QStringLiteral("byte")); + keywords.insert(QStringLiteral("case")); + keywords.insert(QStringLiteral("catch")); + keywords.insert(QStringLiteral("char")); + keywords.insert(QStringLiteral("class")); + keywords.insert(QStringLiteral("const")); + keywords.insert(QStringLiteral("constructor")); + keywords.insert(QStringLiteral("continue")); + keywords.insert(QStringLiteral("debugger")); + keywords.insert(QStringLiteral("default")); + keywords.insert(QStringLiteral("delete")); + keywords.insert(QStringLiteral("do")); + keywords.insert(QStringLiteral("double")); + keywords.insert(QStringLiteral("else")); + keywords.insert(QStringLiteral("enum")); + keywords.insert(QStringLiteral("export")); + keywords.insert(QStringLiteral("extends")); + keywords.insert(QStringLiteral("false")); + keywords.insert(QStringLiteral("final")); + keywords.insert(QStringLiteral("finally")); + keywords.insert(QStringLiteral("float")); + keywords.insert(QStringLiteral("for")); + keywords.insert(QStringLiteral("function")); + keywords.insert(QStringLiteral("goto")); + keywords.insert(QStringLiteral("if")); + keywords.insert(QStringLiteral("implements")); + keywords.insert(QStringLiteral("import")); + keywords.insert(QStringLiteral("in")); + keywords.insert(QStringLiteral("instanceof")); + keywords.insert(QStringLiteral("int")); + keywords.insert(QStringLiteral("interface")); + keywords.insert(QStringLiteral("long")); + keywords.insert(QStringLiteral("native")); + keywords.insert(QStringLiteral("new")); + keywords.insert(QStringLiteral("package")); + keywords.insert(QStringLiteral("private")); + keywords.insert(QStringLiteral("protected")); + keywords.insert(QStringLiteral("public")); + keywords.insert(QStringLiteral("return")); + keywords.insert(QStringLiteral("short")); + keywords.insert(QStringLiteral("static")); + keywords.insert(QStringLiteral("super")); + keywords.insert(QStringLiteral("switch")); + keywords.insert(QStringLiteral("synchronized")); + keywords.insert(QStringLiteral("this")); + keywords.insert(QStringLiteral("throw")); + keywords.insert(QStringLiteral("throws")); + keywords.insert(QStringLiteral("transient")); + keywords.insert(QStringLiteral("true")); + keywords.insert(QStringLiteral("try")); + keywords.insert(QStringLiteral("typeof")); + keywords.insert(QStringLiteral("undefined")); + keywords.insert(QStringLiteral("var")); + keywords.insert(QStringLiteral("void")); + keywords.insert(QStringLiteral("volatile")); + keywords.insert(QStringLiteral("while")); + keywords.insert(QStringLiteral("with")); // end } return keywords; } static QSet<QChar> alphaChars() { QSet<QChar> rc; - const QString alpha = QLatin1String("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"); + const QString alpha = QStringLiteral("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"); foreach (QChar chr, alpha) rc.insert(chr); return rc; diff --git a/src/designer/src/lib/shared/qsimpleresource.cpp b/src/designer/src/lib/shared/qsimpleresource.cpp index 0994acfef..3cc17f28b 100644 --- a/src/designer/src/lib/shared/qsimpleresource.cpp +++ b/src/designer/src/lib/shared/qsimpleresource.cpp @@ -79,7 +79,7 @@ QSimpleResource::QSimpleResource(QDesignerFormEditorInterface *core) : { QString workingDirectory = QDir::homePath(); workingDirectory += QDir::separator(); - workingDirectory += QLatin1String(".designer"); + workingDirectory += QStringLiteral(".designer"); setWorkingDirectory(QDir(workingDirectory)); #ifndef QT_FORMBUILDER_NO_SCRIPT // Disable scripting in the editors. @@ -109,16 +109,16 @@ DomScript *QSimpleResource::createScript(const QString &script, ScriptSource sou DomScript *domScript = new DomScript(); switch (source) { case ScriptExtension: - domScript->setAttributeSource(QLatin1String("extension")); + domScript->setAttributeSource(QStringLiteral("extension")); break; case ScriptDesigner: - domScript->setAttributeSource(QLatin1String("designer")); + domScript->setAttributeSource(QStringLiteral("designer")); break; case ScriptCustomWidgetPlugin: - domScript->setAttributeSource(QLatin1String("customwidgetplugin")); + domScript->setAttributeSource(QStringLiteral("customwidgetplugin")); break; } - domScript->setAttributeLanguage(QLatin1String("Qt Script")); + domScript->setAttributeLanguage(QStringLiteral("Qt Script")); domScript->setText(script); return domScript; } @@ -272,7 +272,7 @@ void QSimpleResource::addCustomWidgetsToWidgetDatabase(const QDesignerFormEditor IncludeType includeType = IncludeLocal; if (const DomHeader *header = custom_widget->elementHeader()) { includeFile = header->text(); - if (header->hasAttributeLocation() && header->attributeLocation() == QLatin1String("global")) + if (header->hasAttributeLocation() && header->attributeLocation() == QStringLiteral("global")) includeType = IncludeGlobal; } const bool domIsContainer = custom_widget->elementContainer(); @@ -333,7 +333,7 @@ void QSimpleResource::handleDomCustomWidgets(const QDesignerFormEditorInterface } // Oops, there are classes left whose base class could not be found. // Default them to QWidget with warnings. - const QString fallBackBaseClass = QLatin1String("QWidget"); + const QString fallBackBaseClass = QStringLiteral("QWidget"); for (int i=0; i < custom_widget_list.size(); i++ ) { DomCustomWidget *custom_widget = custom_widget_list[i]; const QString customClassName = custom_widget->elementClass(); diff --git a/src/designer/src/lib/shared/qtresourceeditordialog.cpp b/src/designer/src/lib/shared/qtresourceeditordialog.cpp index a922da604..342b1fdd1 100644 --- a/src/designer/src/lib/shared/qtresourceeditordialog.cpp +++ b/src/designer/src/lib/shared/qtresourceeditordialog.cpp @@ -1432,7 +1432,7 @@ void QtResourceEditorDialogPrivate::slotNewQrcFile() QApplication::translate("QtResourceEditorDialog", "New Resource File", 0, QApplication::UnicodeUTF8), m_firstQrcFileDialog ? qrcStartDirectory() : QString(), QApplication::translate("QtResourceEditorDialog", "Resource files (*.qrc)", 0, QApplication::UnicodeUTF8), - QLatin1String("qrc")); + QStringLiteral("qrc")); if (qrcPath.isEmpty()) return; @@ -1634,7 +1634,7 @@ void QtResourceEditorDialogPrivate::slotAddFiles() while (itResourcePath.hasNext()) { QString resourcePath = itResourcePath.next(); QString relativePath = dir.relativeFilePath(resourcePath); - if (relativePath.startsWith(QLatin1String(".."))) { + if (relativePath.startsWith(QStringLiteral(".."))) { QMessageBox msgBox(QMessageBox::Warning, QApplication::translate("QtResourceEditorDialog", "Incorrect Path", 0, QApplication::UnicodeUTF8), outOfPathWarning(relativePath), QMessageBox::Cancel); @@ -1849,7 +1849,7 @@ QString QtResourceEditorDialogPrivate::browseForNewLocation(const QString &resou QApplication::translate("QtResourceEditorDialog", "Copy As", 0, QApplication::UnicodeUTF8), initialPath); QString relativePath = rootDir.relativeFilePath(newPath); - if (relativePath.startsWith(QLatin1String(".."))) { + if (relativePath.startsWith(QStringLiteral(".."))) { if (warning(QApplication::translate("QtResourceEditorDialog", "Copy As", 0, QApplication::UnicodeUTF8), QApplication::translate("QtResourceEditorDialog", "<p>The selected file:</p>" "<p>%1</p><p>is outside of the current resource file's directory:</p><p>%2</p>" @@ -2143,8 +2143,8 @@ QString QtResourceEditorDialog::selectedResource() const if (!currentResourceFile->alias().isEmpty()) resourceEnding = currentResourceFile->alias(); - const QString dotSlash(QLatin1String("./")); - const QString dotDotSlash(QLatin1String("../")); + const QString dotSlash(QStringLiteral("./")); + const QString dotDotSlash(QStringLiteral("../")); while (1) { if (resourceEnding.startsWith(slash)) resourceEnding = resourceEnding.mid(1); diff --git a/src/designer/src/lib/shared/qtresourceview.cpp b/src/designer/src/lib/shared/qtresourceview.cpp index 765e848ec..43ed4ecfa 100644 --- a/src/designer/src/lib/shared/qtresourceview.cpp +++ b/src/designer/src/lib/shared/qtresourceview.cpp @@ -378,7 +378,7 @@ void QtResourceViewPrivate::createPaths() return; // Resource root up until 4.6 was ':', changed to ":/" as of 4.7 - const QString root(QLatin1String(":/")); + const QString root(QStringLiteral(":/")); QMap<QString, QString> contents = m_resourceModel->contents(); QMapIterator<QString, QString> itContents(contents); @@ -421,7 +421,7 @@ void QtResourceViewPrivate::filterOutResources() // 3) we hide these items which has pathToVisible value false. const bool matchAll = m_filterPattern.isEmpty(); - const QString root(QLatin1String(":/")); + const QString root(QStringLiteral(":/")); QQueue<QString> pathQueue; pathQueue.enqueue(root); @@ -536,7 +536,7 @@ QTreeWidgetItem *QtResourceViewPrivate::createPath(const QString &path, QTreeWid QFileInfo di(path); substPath = di.fileName(); } else { - substPath = QLatin1String("<resource root>"); + substPath = QStringLiteral("<resource root>"); } item->setText(0, substPath); item->setToolTip(0, path); @@ -583,20 +583,20 @@ QtResourceView::QtResourceView(QDesignerFormEditorInterface *core, QWidget *pare { d_ptr->q_ptr = this; - QIcon editIcon = QIcon::fromTheme(QLatin1String("document-properties"), qdesigner_internal::createIconSet(QLatin1String("edit.png"))); + QIcon editIcon = QIcon::fromTheme(QStringLiteral("document-properties"), qdesigner_internal::createIconSet(QStringLiteral("edit.png"))); d_ptr->m_editResourcesAction = new QAction(editIcon, tr("Edit Resources..."), this); d_ptr->m_toolBar->addAction(d_ptr->m_editResourcesAction); connect(d_ptr->m_editResourcesAction, SIGNAL(triggered()), this, SLOT(slotEditResources())); d_ptr->m_editResourcesAction->setEnabled(false); - QIcon refreshIcon = QIcon::fromTheme(QLatin1String("view-refresh"), qdesigner_internal::createIconSet(QLatin1String("reload.png"))); + QIcon refreshIcon = QIcon::fromTheme(QStringLiteral("view-refresh"), qdesigner_internal::createIconSet(QStringLiteral("reload.png"))); d_ptr->m_reloadResourcesAction = new QAction(refreshIcon, tr("Reload"), this); d_ptr->m_toolBar->addAction(d_ptr->m_reloadResourcesAction); connect(d_ptr->m_reloadResourcesAction, SIGNAL(triggered()), this, SLOT(slotReloadResources())); d_ptr->m_reloadResourcesAction->setEnabled(false); - QIcon copyIcon = QIcon::fromTheme(QLatin1String("edit-copy"), qdesigner_internal::createIconSet(QLatin1String("editcopy.png"))); + QIcon copyIcon = QIcon::fromTheme(QStringLiteral("edit-copy"), qdesigner_internal::createIconSet(QStringLiteral("editcopy.png"))); d_ptr->m_copyResourcePathAction = new QAction(copyIcon, tr("Copy Path"), this); connect(d_ptr->m_copyResourcePathAction, SIGNAL(triggered()), this, SLOT(slotCopyResourcePath())); d_ptr->m_copyResourcePathAction->setEnabled(false); diff --git a/src/designer/src/lib/shared/richtexteditor.cpp b/src/designer/src/lib/shared/richtexteditor.cpp index c53cc3a1f..cff92605b 100644 --- a/src/designer/src/lib/shared/richtexteditor.cpp +++ b/src/designer/src/lib/shared/richtexteditor.cpp @@ -88,7 +88,7 @@ namespace qdesigner_internal { // Richtext simplification filter helpers: Elements to be discarded static inline bool filterElement(const QStringRef &name) { - return name != QLatin1String("meta") && name != QLatin1String("style"); + return name != QStringLiteral("meta") && name != QStringLiteral("style"); } // Richtext simplification filter helpers: Filter attributes of elements @@ -102,15 +102,15 @@ static inline void filterAttributes(const QStringRef &name, return; // No style attributes for <body> - if (name == QLatin1String("body")) { + if (name == QStringLiteral("body")) { atts->clear(); return; } // Clean out everything except 'align' for 'p' - if (name == QLatin1String("p")) { + if (name == QStringLiteral("p")) { for (AttributeIt it = atts->begin(); it != atts->end(); ) { - if (it->name() == QLatin1String("align")) { + if (it->name() == QStringLiteral("align")) { ++it; *paragraphAlignmentFound = true; } else { @@ -256,11 +256,11 @@ void AddLinkDialog::accept() const QString url = m_ui->urlInput->text(); if (!title.isEmpty()) { - QString html = QLatin1String("<a href=\""); + QString html = QStringLiteral("<a href=\""); html += url; - html += QLatin1String("\">"); + html += QStringLiteral("\">"); html += title; - html += QLatin1String("</a>"); + html += QStringLiteral("</a>"); m_editor->insertHtml(html); } @@ -455,19 +455,19 @@ RichTextEditorToolBar::RichTextEditorToolBar(QDesignerFormEditorInterface *core, // Bold, italic and underline buttons m_bold_action = createCheckableAction( - createIconSet(QLatin1String("textbold.png")), + createIconSet(QStringLiteral("textbold.png")), tr("Bold"), editor, SLOT(setFontBold(bool)), this); m_bold_action->setShortcut(tr("CTRL+B")); addAction(m_bold_action); m_italic_action = createCheckableAction( - createIconSet(QLatin1String("textitalic.png")), + createIconSet(QStringLiteral("textitalic.png")), tr("Italic"), editor, SLOT(setFontItalic(bool)), this); m_italic_action->setShortcut(tr("CTRL+I")); addAction(m_italic_action); m_underline_action = createCheckableAction( - createIconSet(QLatin1String("textunder.png")), + createIconSet(QStringLiteral("textunder.png")), tr("Underline"), editor, SLOT(setFontUnderline(bool)), this); m_underline_action->setShortcut(tr("CTRL+U")); addAction(m_underline_action); @@ -481,22 +481,22 @@ RichTextEditorToolBar::RichTextEditorToolBar(QDesignerFormEditorInterface *core, SLOT(alignmentActionTriggered(QAction*))); m_align_left_action = createCheckableAction( - createIconSet(QLatin1String("textleft.png")), + createIconSet(QStringLiteral("textleft.png")), tr("Left Align"), editor, 0, alignment_group); addAction(m_align_left_action); m_align_center_action = createCheckableAction( - createIconSet(QLatin1String("textcenter.png")), + createIconSet(QStringLiteral("textcenter.png")), tr("Center"), editor, 0, alignment_group); addAction(m_align_center_action); m_align_right_action = createCheckableAction( - createIconSet(QLatin1String("textright.png")), + createIconSet(QStringLiteral("textright.png")), tr("Right Align"), editor, 0, alignment_group); addAction(m_align_right_action); m_align_justify_action = createCheckableAction( - createIconSet(QLatin1String("textjustify.png")), + createIconSet(QStringLiteral("textjustify.png")), tr("Justify"), editor, 0, alignment_group); addAction(m_align_justify_action); @@ -505,13 +505,13 @@ RichTextEditorToolBar::RichTextEditorToolBar(QDesignerFormEditorInterface *core, // Superscript and subscript buttons m_valign_sup_action = createCheckableAction( - createIconSet(QLatin1String("textsuperscript.png")), + createIconSet(QStringLiteral("textsuperscript.png")), tr("Superscript"), this, SLOT(setVAlignSuper(bool)), this); addAction(m_valign_sup_action); m_valign_sub_action = createCheckableAction( - createIconSet(QLatin1String("textsubscript.png")), + createIconSet(QStringLiteral("textsubscript.png")), tr("Subscript"), this, SLOT(setVAlignSub(bool)), this); addAction(m_valign_sub_action); @@ -520,12 +520,12 @@ RichTextEditorToolBar::RichTextEditorToolBar(QDesignerFormEditorInterface *core, // Insert hyperlink and image buttons - m_link_action->setIcon(createIconSet(QLatin1String("textanchor.png"))); + m_link_action->setIcon(createIconSet(QStringLiteral("textanchor.png"))); m_link_action->setText(tr("Insert &Link")); connect(m_link_action, SIGNAL(triggered()), SLOT(insertLink())); addAction(m_link_action); - m_image_action->setIcon(createIconSet(QLatin1String("insertimage.png"))); + m_image_action->setIcon(createIconSet(QStringLiteral("insertimage.png"))); m_image_action->setText(tr("Insert &Image")); connect(m_image_action, SIGNAL(triggered()), SLOT(insertImage())); addAction(m_image_action); @@ -541,7 +541,7 @@ RichTextEditorToolBar::RichTextEditorToolBar(QDesignerFormEditorInterface *core, // Simplify rich text m_simplify_richtext_action - = createCheckableAction(createIconSet(QLatin1String("simplifyrichtext.png")), + = createCheckableAction(createIconSet(QStringLiteral("simplifyrichtext.png")), tr("Simplify Rich Text"), m_editor, SLOT(setSimplifyRichText(bool))); m_simplify_richtext_action->setChecked(m_editor->simplifyRichText()); connect(m_editor, SIGNAL(simplifyRichTextChanged(bool)), @@ -623,7 +623,7 @@ void RichTextEditorToolBar::insertImage() { const QString path = IconSelector::choosePixmapResource(m_core, m_core->resourceModel(), QString(), this); if (!path.isEmpty()) - m_editor->insertHtml(QLatin1String("<img src=\"") + path + QLatin1String("\"/>")); + m_editor->insertHtml(QStringLiteral("<img src=\"") + path + QStringLiteral("\"/>")); } void RichTextEditorToolBar::updateActions() @@ -843,7 +843,7 @@ void RichTextEditorDialog::setDefaultFont(const QFont &font) void RichTextEditorDialog::setText(const QString &text) { // Generally simplify rich text unless verbose text is found. - const bool isSimplifiedRichText = !text.startsWith(QLatin1String("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">")); + const bool isSimplifiedRichText = !text.startsWith(QStringLiteral("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">")); m_editor->setSimplifyRichText(isSimplifiedRichText); m_editor->setText(text); m_text_edit->setPlainText(text); diff --git a/src/designer/src/lib/shared/scripterrordialog.cpp b/src/designer/src/lib/shared/scripterrordialog.cpp index aa71b0192..da98abcf4 100644 --- a/src/designer/src/lib/shared/scripterrordialog.cpp +++ b/src/designer/src/lib/shared/scripterrordialog.cpp @@ -61,7 +61,7 @@ static void formatError(const QFormScriptRunner::Error &error, QTextCharFormat format(oldFormat); // verbatim listing - format.setFontFamily(QLatin1String("Courier")); + format.setFontFamily(QStringLiteral("Courier")); cursor.insertText(error.script, format); const QString newLine(QLatin1Char('\n')); diff --git a/src/designer/src/lib/shared/shared_settings.cpp b/src/designer/src/lib/shared/shared_settings.cpp index e68c9c3a0..b506faaa1 100644 --- a/src/designer/src/lib/shared/shared_settings.cpp +++ b/src/designer/src/lib/shared/shared_settings.cpp @@ -113,7 +113,7 @@ const QStringList &QDesignerSharedSettings::defaultFormTemplatePaths() static QStringList rc; if (rc.empty()) { // Ensure default form template paths - const QString templatePath = QLatin1String("/templates"); + const QString templatePath = QStringLiteral("/templates"); // home QString path = QDir::homePath(); path += QLatin1String(designerPath); diff --git a/src/designer/src/lib/shared/signalslotdialog.cpp b/src/designer/src/lib/shared/signalslotdialog.cpp index 59f263fba..9ae33f4bd 100644 --- a/src/designer/src/lib/shared/signalslotdialog.cpp +++ b/src/designer/src/lib/shared/signalslotdialog.cpp @@ -168,7 +168,7 @@ namespace { QString signature = le->text(); if (!m_signatureRegexp.exactMatch(signature )) { if (m_methodNameRegexp.exactMatch(signature )) { - signature += QLatin1String("()"); + signature += QStringLiteral("()"); le->setText(signature); } else { return; @@ -370,8 +370,8 @@ SignalSlotDialog::SignalSlotDialog(QDesignerDialogGuiInterface *dialogGui, QWidg m_ui->addSignalButton->setIcon(plusIcon); m_ui->removeSignalButton->setIcon(minusIcon); - m_slotPanel = new SignaturePanel(this, m_ui->slotListView, m_ui->addSlotButton, m_ui->removeSlotButton, QLatin1String("slot")); - m_signalPanel = new SignaturePanel(this, m_ui->signalListView, m_ui->addSignalButton, m_ui->removeSignalButton, QLatin1String("signal")); + m_slotPanel = new SignaturePanel(this, m_ui->slotListView, m_ui->addSlotButton, m_ui->removeSlotButton, QStringLiteral("slot")); + m_signalPanel = new SignaturePanel(this, m_ui->signalListView, m_ui->addSignalButton, m_ui->removeSignalButton, QStringLiteral("signal")); connect(m_slotPanel, SIGNAL(checkSignature(QString,bool*)), this, SLOT(slotCheckSignature(QString,bool*))); connect(m_signalPanel, SIGNAL(checkSignature(QString,bool*)), this, SLOT(slotCheckSignature(QString,bool*))); diff --git a/src/designer/src/lib/shared/spacer_widget.cpp b/src/designer/src/lib/shared/spacer_widget.cpp index 4203ab068..5d22f727d 100644 --- a/src/designer/src/lib/shared/spacer_widget.cpp +++ b/src/designer/src/lib/shared/spacer_widget.cpp @@ -171,7 +171,7 @@ void Spacer::resizeEvent(QResizeEvent* e) const QSize oldSize = e->oldSize(); if (oldSize.isNull() || oldSize.width() <= m_SizeOffset.width() || oldSize.height() <= m_SizeOffset.height()) if (QDesignerPropertySheetExtension *sheet = qt_extension<QDesignerPropertySheetExtension*>(m_formWindow->core()->extensionManager(), this)) - sheet->setChanged(sheet->indexOf(QLatin1String("sizeHint")), true); + sheet->setChanged(sheet->indexOf(QStringLiteral("sizeHint")), true); } updateMask(); diff --git a/src/designer/src/lib/shared/stylesheeteditor.cpp b/src/designer/src/lib/shared/stylesheeteditor.cpp index 6afdfaeb1..837b2baa6 100644 --- a/src/designer/src/lib/shared/stylesheeteditor.cpp +++ b/src/designer/src/lib/shared/stylesheeteditor.cpp @@ -228,7 +228,7 @@ void StyleSheetEditorDialog::slotAddResource(const QString &property) { const QString path = IconSelector::choosePixmapResource(m_core, m_core->resourceModel(), QString(), this); if (!path.isEmpty()) - insertCssProperty(property, QString(QLatin1String("url(%1)")).arg(path)); + insertCssProperty(property, QString(QStringLiteral("url(%1)")).arg(path)); } void StyleSheetEditorDialog::slotAddGradient(const QString &property) @@ -248,10 +248,10 @@ void StyleSheetEditorDialog::slotAddColor(const QString &property) QString colorStr; if (color.alpha() == 255) { - colorStr = QString(QLatin1String("rgb(%1, %2, %3)")).arg( + colorStr = QString(QStringLiteral("rgb(%1, %2, %3)")).arg( color.red()).arg(color.green()).arg(color.blue()); } else { - colorStr = QString(QLatin1String("rgba(%1, %2, %3, %4)")).arg( + colorStr = QString(QStringLiteral("rgba(%1, %2, %3, %4)")).arg( color.red()).arg(color.green()).arg(color.blue()).arg(color.alpha()); } @@ -271,29 +271,29 @@ void StyleSheetEditorDialog::slotAddFont() switch (font.style()) { case QFont::StyleItalic: - fontStr += QLatin1String("italic "); + fontStr += QStringLiteral("italic "); break; case QFont::StyleOblique: - fontStr += QLatin1String("oblique "); + fontStr += QStringLiteral("oblique "); break; default: break; } fontStr += QString::number(font.pointSize()); - fontStr += QLatin1String("pt \""); + fontStr += QStringLiteral("pt \""); fontStr += font.family(); fontStr += QLatin1Char('"'); - insertCssProperty(QLatin1String("font"), fontStr); + insertCssProperty(QStringLiteral("font"), fontStr); QString decoration; if (font.underline()) - decoration += QLatin1String("underline"); + decoration += QStringLiteral("underline"); if (font.strikeOut()) { if (!decoration.isEmpty()) decoration += QLatin1Char(' '); - decoration += QLatin1String("line-through"); + decoration += QStringLiteral("line-through"); } - insertCssProperty(QLatin1String("text-decoration"), decoration); + insertCssProperty(QStringLiteral("text-decoration"), decoration); } } @@ -308,8 +308,8 @@ void StyleSheetEditorDialog::insertCssProperty(const QString &name, const QStrin // Simple check to see if we're in a selector scope const QTextDocument *doc = m_editor->document(); - const QTextCursor closing = doc->find(QLatin1String("}"), cursor, QTextDocument::FindBackward); - const QTextCursor opening = doc->find(QLatin1String("{"), cursor, QTextDocument::FindBackward); + const QTextCursor closing = doc->find(QStringLiteral("}"), cursor, QTextDocument::FindBackward); + const QTextCursor opening = doc->find(QStringLiteral("{"), cursor, QTextDocument::FindBackward); const bool inSelector = !opening.isNull() && (closing.isNull() || closing.position() < opening.position()); QString insertion; @@ -318,7 +318,7 @@ void StyleSheetEditorDialog::insertCssProperty(const QString &name, const QStrin if (inSelector) insertion += QLatin1Char('\t'); insertion += name; - insertion += QLatin1String(": "); + insertion += QStringLiteral(": "); insertion += value; insertion += QLatin1Char(';'); cursor.insertText(insertion); @@ -331,8 +331,8 @@ void StyleSheetEditorDialog::insertCssProperty(const QString &name, const QStrin void StyleSheetEditorDialog::slotRequestHelp() { - m_core->integration()->emitHelpRequested(QLatin1String("qt"), - QLatin1String("stylesheet-reference.html")); + m_core->integration()->emitHelpRequested(QStringLiteral("qt"), + QStringLiteral("stylesheet-reference.html")); } QDialogButtonBox * StyleSheetEditorDialog::buttonBox() const @@ -356,7 +356,7 @@ bool StyleSheetEditorDialog::isStyleSheetValid(const QString &styleSheet) QCss::StyleSheet sheet; if (parser.parse(&sheet)) return true; - QString fullSheet = QLatin1String("* { "); + QString fullSheet = QStringLiteral("* { "); fullSheet += styleSheet; fullSheet += QLatin1Char('}'); QCss::Parser parser2(fullSheet); @@ -369,10 +369,10 @@ void StyleSheetEditorDialog::validateStyleSheet() setOkButtonEnabled(valid); if (valid) { m_validityLabel->setText(tr("Valid Style Sheet")); - m_validityLabel->setStyleSheet(QLatin1String("color: green")); + m_validityLabel->setStyleSheet(QStringLiteral("color: green")); } else { m_validityLabel->setText(tr("Invalid Style Sheet")); - m_validityLabel->setStyleSheet(QLatin1String("color: red")); + m_validityLabel->setStyleSheet(QStringLiteral("color: red")); } } diff --git a/src/designer/src/lib/shared/textpropertyeditor.cpp b/src/designer/src/lib/shared/textpropertyeditor.cpp index 00bc2cfef..3287df9f0 100644 --- a/src/designer/src/lib/shared/textpropertyeditor.cpp +++ b/src/designer/src/lib/shared/textpropertyeditor.cpp @@ -168,7 +168,7 @@ namespace { QUrl UrlValidator::guessUrlFromString(const QString &string) const { const QString urlStr = string.trimmed(); - const QRegExp qualifiedUrl(QLatin1String("^[a-zA-Z]+\\:.*")); + const QRegExp qualifiedUrl(QStringLiteral("^[a-zA-Z]+\\:.*")); // Check if it looks like a qualified URL. Try parsing it and see. const bool hasSchema = qualifiedUrl.exactMatch(urlStr); @@ -179,8 +179,8 @@ namespace { } // Might be a Qt resource - if (string.startsWith(QLatin1String(":/"))) - return QUrl(QLatin1String("qrc") + string); + if (string.startsWith(QStringLiteral(":/"))) + return QUrl(QStringLiteral("qrc") + string); // Might be a file. if (QFile::exists(urlStr)) @@ -192,11 +192,11 @@ namespace { if (dotIndex != -1) { const QString prefix = urlStr.left(dotIndex).toLower(); QString urlString; - if (prefix == QLatin1String("ftp")) + if (prefix == QStringLiteral("ftp")) urlString += prefix; else - urlString += QLatin1String("http"); - urlString += QLatin1String("://"); + urlString += QStringLiteral("http"); + urlString += QStringLiteral("://"); urlString += urlStr; const QUrl url(urlString, QUrl::TolerantMode); if (url.isValid()) @@ -265,25 +265,25 @@ namespace qdesigner_internal { m_lineEdit->setCompleter(0); break; case ValidationObjectName: - setRegExpValidator(QLatin1String("[_a-zA-Z][_a-zA-Z0-9]{,1023}")); + setRegExpValidator(QStringLiteral("[_a-zA-Z][_a-zA-Z0-9]{,1023}")); m_lineEdit->setCompleter(0); break; case ValidationObjectNameScope: - setRegExpValidator(QLatin1String("[_a-zA-Z:][_a-zA-Z0-9:]{,1023}")); + setRegExpValidator(QStringLiteral("[_a-zA-Z:][_a-zA-Z0-9:]{,1023}")); m_lineEdit->setCompleter(0); break; case ValidationURL: { static QStringList urlCompletions; if (urlCompletions.empty()) { - urlCompletions.push_back(QLatin1String("about:blank")); - urlCompletions.push_back(QLatin1String("http://")); - urlCompletions.push_back(QLatin1String("http://www.")); - urlCompletions.push_back(QLatin1String("http://qt.nokia.com/")); - urlCompletions.push_back(QLatin1String("file://")); - urlCompletions.push_back(QLatin1String("ftp://")); - urlCompletions.push_back(QLatin1String("data:")); - urlCompletions.push_back(QLatin1String("data:text/html,")); - urlCompletions.push_back(QLatin1String("qrc:/")); + urlCompletions.push_back(QStringLiteral("about:blank")); + urlCompletions.push_back(QStringLiteral("http://")); + urlCompletions.push_back(QStringLiteral("http://www.")); + urlCompletions.push_back(QStringLiteral("http://qt.nokia.com/")); + urlCompletions.push_back(QStringLiteral("file://")); + urlCompletions.push_back(QStringLiteral("ftp://")); + urlCompletions.push_back(QStringLiteral("data:")); + urlCompletions.push_back(QStringLiteral("data:text/html,")); + urlCompletions.push_back(QStringLiteral("qrc:/")); } QCompleter *completer = new QCompleter(urlCompletions, m_lineEdit); m_lineEdit->setCompleter(completer); @@ -391,7 +391,7 @@ namespace qdesigner_internal { QString rc(s); // protect backslashes - rc.replace(QLatin1Char('\\'), QLatin1String("\\\\")); + rc.replace(QLatin1Char('\\'), QStringLiteral("\\\\")); // escape newlines rc.replace(NewLineChar, QString(EscapedNewLine)); return rc; diff --git a/src/designer/src/lib/shared/widgetdatabase.cpp b/src/designer/src/lib/shared/widgetdatabase.cpp index 3fe13977f..7c7caf828 100644 --- a/src/designer/src/lib/shared/widgetdatabase.cpp +++ b/src/designer/src/lib/shared/widgetdatabase.cpp @@ -296,29 +296,29 @@ WidgetDataBase::WidgetDataBase(QDesignerFormEditorInterface *core, QObject *pare // ### check the casts #if 0 // ### enable me after 4.1 - item(indexOfClassName(QLatin1String("QToolBar")))->setContainer(true); + item(indexOfClassName(QStringLiteral("QToolBar")))->setContainer(true); #endif - item(indexOfClassName(QLatin1String("QTabWidget")))->setContainer(true); - item(indexOfClassName(QLatin1String("QGroupBox")))->setContainer(true); - item(indexOfClassName(QLatin1String("QScrollArea")))->setContainer(true); - item(indexOfClassName(QLatin1String("QStackedWidget")))->setContainer(true); - item(indexOfClassName(QLatin1String("QToolBox")))->setContainer(true); - item(indexOfClassName(QLatin1String("QFrame")))->setContainer(true); - item(indexOfClassName(QLatin1String("QLayoutWidget")))->setContainer(true); - item(indexOfClassName(QLatin1String("QDesignerWidget")))->setContainer(true); - item(indexOfClassName(QLatin1String("QDesignerDialog")))->setContainer(true); - item(indexOfClassName(QLatin1String("QSplitter")))->setContainer(true); - item(indexOfClassName(QLatin1String("QMainWindow")))->setContainer(true); - item(indexOfClassName(QLatin1String("QDockWidget")))->setContainer(true); - item(indexOfClassName(QLatin1String("QDesignerDockWidget")))->setContainer(true); - item(indexOfClassName(QLatin1String("QMdiArea")))->setContainer(true); - item(indexOfClassName(QLatin1String("QWorkspace")))->setContainer(true); - item(indexOfClassName(QLatin1String("QWizard")))->setContainer(true); - item(indexOfClassName(QLatin1String("QWizardPage")))->setContainer(true); - - item(indexOfClassName(QLatin1String("QWidget")))->setContainer(true); - item(indexOfClassName(QLatin1String("QDialog")))->setContainer(true); + item(indexOfClassName(QStringLiteral("QTabWidget")))->setContainer(true); + item(indexOfClassName(QStringLiteral("QGroupBox")))->setContainer(true); + item(indexOfClassName(QStringLiteral("QScrollArea")))->setContainer(true); + item(indexOfClassName(QStringLiteral("QStackedWidget")))->setContainer(true); + item(indexOfClassName(QStringLiteral("QToolBox")))->setContainer(true); + item(indexOfClassName(QStringLiteral("QFrame")))->setContainer(true); + item(indexOfClassName(QStringLiteral("QLayoutWidget")))->setContainer(true); + item(indexOfClassName(QStringLiteral("QDesignerWidget")))->setContainer(true); + item(indexOfClassName(QStringLiteral("QDesignerDialog")))->setContainer(true); + item(indexOfClassName(QStringLiteral("QSplitter")))->setContainer(true); + item(indexOfClassName(QStringLiteral("QMainWindow")))->setContainer(true); + item(indexOfClassName(QStringLiteral("QDockWidget")))->setContainer(true); + item(indexOfClassName(QStringLiteral("QDesignerDockWidget")))->setContainer(true); + item(indexOfClassName(QStringLiteral("QMdiArea")))->setContainer(true); + item(indexOfClassName(QStringLiteral("QWorkspace")))->setContainer(true); + item(indexOfClassName(QStringLiteral("QWizard")))->setContainer(true); + item(indexOfClassName(QStringLiteral("QWizardPage")))->setContainer(true); + + item(indexOfClassName(QStringLiteral("QWidget")))->setContainer(true); + item(indexOfClassName(QStringLiteral("QDialog")))->setContainer(true); } WidgetDataBase::~WidgetDataBase() @@ -475,7 +475,7 @@ void WidgetDataBase::grabStandardWidgetBoxIcons() // At this point, grab the default icons for the non-custom widgets from // the widget box. They will show up in the object inspector. if (const QDesignerWidgetBox *wb = qobject_cast<const QDesignerWidgetBox *>(m_core->widgetBox())) { - const QString qWidgetClass = QLatin1String("QWidget"); + const QString qWidgetClass = QStringLiteral("QWidget"); const int itemCount = count(); for (int i = 0; i < itemCount; ++i) { QDesignerWidgetDataBaseItemInterface *dbItem = item(i); @@ -484,7 +484,7 @@ void WidgetDataBase::grabStandardWidgetBoxIcons() // QWidget const QString name = dbItem->name(); if (name == qWidgetClass) { - dbItem->setIcon(wb->iconForWidget(name, QLatin1String("Containers"))); + dbItem->setIcon(wb->iconForWidget(name, QStringLiteral("Containers"))); } else { dbItem->setIcon(wb->iconForWidget(name)); } @@ -500,7 +500,7 @@ enum { NewFormWidth = 400, NewFormHeight = 300 }; // Check if class is suitable to generate a form from static inline bool isExistingTemplate(const QString &className) { - return className == QLatin1String("QWidget") || className == QLatin1String("QDialog") || className == QLatin1String("QMainWindow"); + return className == QStringLiteral("QWidget") || className == QStringLiteral("QDialog") || className == QStringLiteral("QMainWindow"); } // Check if class is suitable to generate a form from @@ -508,11 +508,11 @@ static inline bool suitableForNewForm(const QString &className) { if (className.isEmpty()) // Missing custom widget information return false; - if (className == QLatin1String("QWorkspace")) + if (className == QStringLiteral("QWorkspace")) return false; - if (className == QLatin1String("QSplitter")) + if (className == QStringLiteral("QSplitter")) return false; - if (className.startsWith(QLatin1String("QDesigner")) || className.startsWith(QLatin1String("QLayout"))) + if (className.startsWith(QStringLiteral("QDesigner")) || className.startsWith(QStringLiteral("QLayout"))) return false; return true; } @@ -567,14 +567,14 @@ static QString xmlFromWidgetBox(const QDesignerFormEditorInterface *core, const QScopedPointer<DomUI> domUI(QDesignerWidgetBox::xmlToUi(className, widget.domXml(), false)); if (domUI.isNull()) return QString(); - domUI->setAttributeVersion(QLatin1String("4.0")); + domUI->setAttributeVersion(QStringLiteral("4.0")); DomWidget *domWidget = domUI->elementWidget(); if (!domWidget) return QString(); // Properties: Remove the "objectName" property in favour of the name attribute and check geometry. domWidget->setAttributeName(objectName); - const QString geometryProperty = QLatin1String("geometry"); - const QString objectNameProperty = QLatin1String("objectName"); + const QString geometryProperty = QStringLiteral("geometry"); + const QString objectNameProperty = QStringLiteral("objectName"); PropertyList properties = domWidget->elementProperty(); for (PropertyList::iterator it = properties.begin(); it != properties.end(); ) { DomProperty *property = *it; @@ -597,7 +597,7 @@ static QString xmlFromWidgetBox(const QDesignerFormEditorInterface *core, const DomString *windowTitleString = new DomString; windowTitleString->setText(objectName); DomProperty *windowTitleProperty = new DomProperty; - windowTitleProperty->setAttributeName(QLatin1String("windowTitle")); + windowTitleProperty->setAttributeName(QStringLiteral("windowTitle")); windowTitleProperty->setElementString(windowTitleString); properties.push_back(windowTitleProperty); // ------ @@ -622,19 +622,19 @@ static QString generateNewFormXML(const QString &className, const QString &simil { QString rc; { QTextStream str(&rc); - str << QLatin1String("<ui version=\"4.0\" >\n<class>") << name << QLatin1String("</class>\n") - << QLatin1String("<widget class=\"") << className << QLatin1String("\" name=\"") << name << QLatin1String("\" >\n") - << QLatin1String("<property name=\"geometry\" >\n<rect><x>0</x><y>0</y><width>") - << NewFormWidth << QLatin1String("</width><height>") << NewFormHeight << QLatin1String("</height></rect>\n</property>\n"); - str << QLatin1String("<property name=\"windowTitle\" >\n<string>") << name << QLatin1String("</string>\n</property>\n"); - - if (similarClassName == QLatin1String("QMainWindow")) { - str << QLatin1String("<widget class=\"QWidget\" name=\"centralwidget\" />\n"); + str << QStringLiteral("<ui version=\"4.0\" >\n<class>") << name << QStringLiteral("</class>\n") + << QStringLiteral("<widget class=\"") << className << QStringLiteral("\" name=\"") << name << QStringLiteral("\" >\n") + << QStringLiteral("<property name=\"geometry\" >\n<rect><x>0</x><y>0</y><width>") + << NewFormWidth << QStringLiteral("</width><height>") << NewFormHeight << QStringLiteral("</height></rect>\n</property>\n"); + str << QStringLiteral("<property name=\"windowTitle\" >\n<string>") << name << QStringLiteral("</string>\n</property>\n"); + + if (similarClassName == QStringLiteral("QMainWindow")) { + str << QStringLiteral("<widget class=\"QWidget\" name=\"centralwidget\" />\n"); } else { - if (similarClassName == QLatin1String("QWizard")) - str << QLatin1String("<widget class=\"QWizardPage\" name=\"wizardPage1\" /><widget class=\"QWizardPage\" name=\"wizardPage2\" />\n"); + if (similarClassName == QStringLiteral("QWizard")) + str << QStringLiteral("<widget class=\"QWizardPage\" name=\"wizardPage1\" /><widget class=\"QWizardPage\" name=\"wizardPage2\" />\n"); } - str << QLatin1String("</widget>\n</ui>\n"); + str << QStringLiteral("</widget>\n</ui>\n"); } return rc; } @@ -650,7 +650,7 @@ QString WidgetDataBase::formTemplate(const QDesignerFormEditorInterface *core, c // 2) If that fails, only custom main windows, custom dialogs and unsupported Qt Widgets should // be left over. Generate something that is similar to the default templates. Find a similar class. const QDesignerWidgetDataBaseInterface *wdb = core->widgetDataBase(); - QString similarClass = QLatin1String("QWidget"); + QString similarClass = QStringLiteral("QWidget"); const int index = wdb->indexOfClassName(className); if (index != -1) { const QDesignerWidgetDataBaseItemInterface *item = wdb->item(index); @@ -665,16 +665,16 @@ QString WidgetDataBase::formTemplate(const QDesignerFormEditorInterface *core, c QString WidgetDataBase::scaleFormTemplate(const QString &xml, const QSize &size, bool fixed) { typedef QList<DomProperty*> PropertyList; - DomUI *domUI = QDesignerWidgetBox::xmlToUi(QLatin1String("Form"), xml, false); + DomUI *domUI = QDesignerWidgetBox::xmlToUi(QStringLiteral("Form"), xml, false); if (!domUI) return QString(); DomWidget *domWidget = domUI->elementWidget(); if (!domWidget) return QString(); // Properties: Find/Ensure the geometry, minimum and maximum sizes properties - const QString geometryPropertyName = QLatin1String("geometry"); - const QString minimumSizePropertyName = QLatin1String("minimumSize"); - const QString maximumSizePropertyName = QLatin1String("maximumSize"); + const QString geometryPropertyName = QStringLiteral("geometry"); + const QString minimumSizePropertyName = QStringLiteral("minimumSize"); + const QString maximumSizePropertyName = QStringLiteral("maximumSize"); DomProperty *geomProperty = 0; DomProperty *minimumSizeProperty = 0; DomProperty *maximumSizeProperty = 0; @@ -827,7 +827,7 @@ QDESIGNER_SHARED_EXPORT QDesignerWidgetDataBaseItemInterface * derivedItem = WidgetDataBaseItem::clone(baseItem); // Sort of hack: If base class is QWidget, we most likely // do not want to inherit the container attribute. - static const QString qWidgetName = QLatin1String("QWidget"); + static const QString qWidgetName = QStringLiteral("QWidget"); if (baseItem->name() == qWidgetName) derivedItem->setContainer(false); // set new props diff --git a/src/designer/src/lib/shared/widgetfactory.cpp b/src/designer/src/lib/shared/widgetfactory.cpp index 7b61c6976..96a900ffa 100644 --- a/src/designer/src/lib/shared/widgetfactory.cpp +++ b/src/designer/src/lib/shared/widgetfactory.cpp @@ -170,31 +170,31 @@ void WizardPageChangeWatcher::pageChanged() // ---------------- WidgetFactory::Strings WidgetFactory::Strings::Strings() : - m_alignment(QLatin1String("alignment")), - m_bottomMargin(QLatin1String("bottomMargin")), - m_geometry(QLatin1String("geometry")), - m_leftMargin(QLatin1String("leftMargin")), - m_line(QLatin1String("Line")), - m_objectName(QLatin1String("objectName")), - m_spacerName(QLatin1String("spacerName")), - m_orientation(QLatin1String("orientation")), - m_qAction(QLatin1String("QAction")), - m_qButtonGroup(QLatin1String("QButtonGroup")), - m_qAxWidget(QLatin1String("QAxWidget")), - m_qDialog(QLatin1String("QDialog")), - m_qDockWidget(QLatin1String("QDockWidget")), - m_qLayoutWidget(QLatin1String("QLayoutWidget")), - m_qMenu(QLatin1String("QMenu")), - m_qMenuBar(QLatin1String("QMenuBar")), - m_qWidget(QLatin1String("QWidget")), - m_rightMargin(QLatin1String("rightMargin")), - m_sizeHint(QLatin1String("sizeHint")), - m_spacer(QLatin1String("Spacer")), - m_text(QLatin1String("text")), - m_title(QLatin1String("title")), - m_topMargin(QLatin1String("topMargin")), - m_windowIcon(QLatin1String("windowIcon")), - m_windowTitle(QLatin1String("windowTitle")) + m_alignment(QStringLiteral("alignment")), + m_bottomMargin(QStringLiteral("bottomMargin")), + m_geometry(QStringLiteral("geometry")), + m_leftMargin(QStringLiteral("leftMargin")), + m_line(QStringLiteral("Line")), + m_objectName(QStringLiteral("objectName")), + m_spacerName(QStringLiteral("spacerName")), + m_orientation(QStringLiteral("orientation")), + m_qAction(QStringLiteral("QAction")), + m_qButtonGroup(QStringLiteral("QButtonGroup")), + m_qAxWidget(QStringLiteral("QAxWidget")), + m_qDialog(QStringLiteral("QDialog")), + m_qDockWidget(QStringLiteral("QDockWidget")), + m_qLayoutWidget(QStringLiteral("QLayoutWidget")), + m_qMenu(QStringLiteral("QMenu")), + m_qMenuBar(QStringLiteral("QMenuBar")), + m_qWidget(QStringLiteral("QWidget")), + m_rightMargin(QStringLiteral("rightMargin")), + m_sizeHint(QStringLiteral("sizeHint")), + m_spacer(QStringLiteral("Spacer")), + m_text(QStringLiteral("text")), + m_title(QStringLiteral("title")), + m_topMargin(QStringLiteral("topMargin")), + m_windowIcon(QStringLiteral("windowIcon")), + m_windowTitle(QStringLiteral("windowTitle")) { } // ---------------- WidgetFactory @@ -400,7 +400,7 @@ QWidget *WidgetFactory::createWidget(const QString &widgetName, QWidget *parentW if (item == 0) { // Emergency: Create, derived from QWidget QString includeFile = widgetName.toLower(); - includeFile += QLatin1String(".h"); + includeFile += QStringLiteral(".h"); item = appendDerived(db,widgetName, tr("%1 Widget").arg(widgetName),fallBackBaseClass, includeFile, true, true); Q_ASSERT(item); @@ -442,18 +442,18 @@ QString WidgetFactory::classNameOf(QDesignerFormEditorInterface *c, const QObjec if (!customClassName.isEmpty()) return customClassName; if (qobject_cast<const QDesignerMenuBar*>(w)) - return QLatin1String("QMenuBar"); + return QStringLiteral("QMenuBar"); else if (qobject_cast<const QDesignerMenu*>(w)) - return QLatin1String("QMenu"); + return QStringLiteral("QMenu"); else if (qobject_cast<const QDesignerDockWidget*>(w)) - return QLatin1String("QDockWidget"); + return QStringLiteral("QDockWidget"); else if (qobject_cast<const QDesignerDialog*>(w)) - return QLatin1String("QDialog"); + return QStringLiteral("QDialog"); else if (qobject_cast<const QDesignerWidget*>(w)) - return QLatin1String("QWidget"); + return QStringLiteral("QWidget"); #ifdef Q_OS_WIN else if (isAxWidget(w)) - return QLatin1String("QAxWidget"); + return QStringLiteral("QAxWidget"); #endif return QLatin1String(className); } @@ -803,7 +803,7 @@ static bool isTabBarInteractor(const QTabBar *tabBar) bool WidgetFactory::isPassiveInteractor(QWidget *widget) { - static const QString qtPassive = QLatin1String("__qt__passive_"); + static const QString qtPassive = QStringLiteral("__qt__passive_"); if (m_lastPassiveInteractor != 0 && (QWidget*)(*m_lastPassiveInteractor) == widget) return m_lastWasAPassiveInteractor; @@ -833,10 +833,10 @@ bool WidgetFactory::isPassiveInteractor(QWidget *widget) // A scroll bar is an interactor on a QAbstractScrollArea only. if (const QWidget *parent = widget->parentWidget()) { const QString objectName = parent->objectName(); - static const QString scrollAreaVContainer = QLatin1String("qt_scrollarea_vcontainer"); + static const QString scrollAreaVContainer = QStringLiteral("qt_scrollarea_vcontainer"); void activeFormWindowChanged(QDesignerFormWindowInterface *formWindow); void formWindowAdded(QDesignerFormWindowInterface *formWindow); - static const QString scrollAreaHContainer = QLatin1String("qt_scrollarea_hcontainer"); + static const QString scrollAreaHContainer = QStringLiteral("qt_scrollarea_hcontainer"); if (objectName == scrollAreaVContainer || objectName == scrollAreaHContainer) { m_lastWasAPassiveInteractor = true; return m_lastWasAPassiveInteractor; diff --git a/src/designer/src/lib/shared/zoomwidget.cpp b/src/designer/src/lib/shared/zoomwidget.cpp index 7ca6491ff..85d16d4e9 100644 --- a/src/designer/src/lib/shared/zoomwidget.cpp +++ b/src/designer/src/lib/shared/zoomwidget.cpp @@ -237,7 +237,7 @@ void ZoomView::showContextMenu(const QPoint &globalPos) zoomMenu()->addActions(&menu); if (debugZoomWidget) { menu.addSeparator(); - QAction *da = menu.addAction(QLatin1String("Dump")); + QAction *da = menu.addAction(QStringLiteral("Dump")); connect(da, SIGNAL(triggered()), this, SLOT(dump())); } menu.exec(globalPos); diff --git a/src/designer/src/lib/uilib/abstractformbuilder.cpp b/src/designer/src/lib/uilib/abstractformbuilder.cpp index d5f656da1..51431e846 100644 --- a/src/designer/src/lib/uilib/abstractformbuilder.cpp +++ b/src/designer/src/lib/uilib/abstractformbuilder.cpp @@ -168,7 +168,7 @@ static inline QString msgXmlError(const QXmlStreamReader &reader) // of an <ui> element and leave reader positioned at <ui>. static bool inline readUiAttributes(QXmlStreamReader &reader, const QString &language, QString *errorMessage) { - const QString uiElement = QLatin1String("ui"); + const QString uiElement = QStringLiteral("ui"); // Read up to first element while (!reader.atEnd()) { switch (reader.readNext()) { @@ -177,8 +177,8 @@ static bool inline readUiAttributes(QXmlStreamReader &reader, const QString &lan return false; case QXmlStreamReader::StartElement: if (reader.name().compare(uiElement, Qt::CaseInsensitive) == 0) { - const QString versionAttribute = QLatin1String("version"); - const QString languageAttribute = QLatin1String("language"); + const QString versionAttribute = QStringLiteral("version"); + const QString languageAttribute = QStringLiteral("language"); const QXmlStreamAttributes attributes = reader.attributes(); if (attributes.hasAttribute(versionAttribute)) { const QString versionString = attributes.value(versionAttribute).toString(); @@ -812,27 +812,27 @@ static inline QString alignmentValue(Qt::Alignment a) QString h,v; switch (a & Qt::AlignHorizontal_Mask) { case Qt::AlignLeft: - h = QLatin1String("Qt::AlignLeft"); + h = QStringLiteral("Qt::AlignLeft"); break; case Qt::AlignRight: - h = QLatin1String("Qt::AlignRight"); + h = QStringLiteral("Qt::AlignRight"); break; case Qt::AlignHCenter: - h = QLatin1String("Qt::AlignHCenter"); + h = QStringLiteral("Qt::AlignHCenter"); break; case Qt::AlignJustify: - h = QLatin1String("Qt::AlignJustify"); + h = QStringLiteral("Qt::AlignJustify"); break; } switch (a & Qt::AlignVertical_Mask) { case Qt::AlignTop: - v = QLatin1String("Qt::AlignTop"); + v = QStringLiteral("Qt::AlignTop"); break; case Qt::AlignBottom: - v = QLatin1String("Qt::AlignBottom"); + v = QStringLiteral("Qt::AlignBottom"); break; case Qt::AlignVCenter: - v = QLatin1String("Qt::AlignVCenter"); + v = QStringLiteral("Qt::AlignVCenter"); break; } if (h.isEmpty() && v.isEmpty()) @@ -850,19 +850,19 @@ static inline Qt::Alignment alignmentFromDom(const QString &in) Qt::Alignment rc = 0; if (!in.isEmpty()) { foreach (const QString &f, in.split(QLatin1Char('|'))) { - if (f == QLatin1String("Qt::AlignLeft")) { + if (f == QStringLiteral("Qt::AlignLeft")) { rc |= Qt::AlignLeft; - } else if (f == QLatin1String("Qt::AlignRight")) { + } else if (f == QStringLiteral("Qt::AlignRight")) { rc |= Qt::AlignRight; - } else if (f == QLatin1String("Qt::AlignHCenter")) { + } else if (f == QStringLiteral("Qt::AlignHCenter")) { rc |= Qt::AlignHCenter; - } else if (f == QLatin1String("Qt::AlignJustify")) { + } else if (f == QStringLiteral("Qt::AlignJustify")) { rc |= Qt::AlignJustify; - } else if (f == QLatin1String("Qt::AlignTop")) { + } else if (f == QStringLiteral("Qt::AlignTop")) { rc |= Qt::AlignTop; - } else if (f == QLatin1String("Qt::AlignBottom")) { + } else if (f == QStringLiteral("Qt::AlignBottom")) { rc |= Qt::AlignBottom; - } else if (f == QLatin1String("Qt::AlignVCenter")) { + } else if (f == QStringLiteral("Qt::AlignVCenter")) { rc |= Qt::AlignVCenter; } } @@ -1273,7 +1273,7 @@ void QAbstractFormBuilder::save(QIODevice *dev, QWidget *widget) Q_ASSERT( ui_widget != 0 ); DomUI *ui = new DomUI(); - ui->setAttributeVersion(QLatin1String("4.0")); + ui->setAttributeVersion(QStringLiteral("4.0")); ui->setElementWidget(ui_widget); saveDom(ui, widget); @@ -1476,15 +1476,11 @@ struct FormBuilderSaveLayoutEntry { // filter out the case of "Spacer" and "QLayoutWidget" widgets void FormBuilderSaveLayoutEntry::setAlignment(Qt::Alignment al) { - if (!item->widget()) - return; - - const QString className = item->widget()->metaObject()->className(); - if (className == QLatin1String("Spacer") - || className == QLatin1String("QLayoutWidget")) - return; - - alignment = al; + if (const QWidget *widget = item->widget()) { + const char *className = widget->metaObject()->className(); + if (qstrcmp(className, "Spacer") && qstrcmp(className, "QLayoutWidget")) + alignment = al; + } } // Create list from standard box layout @@ -2116,10 +2112,10 @@ void QAbstractFormBuilder::saveTreeWidgetExtraInfo(QTreeWidget *treeWidget, DomW foreach (const QFormBuilderStrings::TextRoleNName &it, strings.itemTextRoles) { p = saveText(it.second, treeWidget->headerItem()->data(c, it.first.second)); // Prevent uic 4.4.X from crashing if it cannot find a column text - if (!p && it.first.first == Qt::EditRole && it.second == QLatin1String("text")) { + if (!p && it.first.first == Qt::EditRole && it.second == QStringLiteral("text")) { DomString *defaultHeader = new DomString; defaultHeader->setText(QString::number(c + 1)); - defaultHeader->setAttributeNotr(QLatin1String("true")); + defaultHeader->setAttributeNotr(QStringLiteral("true")); p = new DomProperty; p->setAttributeName(it.second); p->setElementString(defaultHeader); @@ -2303,7 +2299,7 @@ void QAbstractFormBuilder::saveButtonExtraInfo(const QAbstractButton *widget, Do DomPropertyList attributes = ui_widget->elementAttribute(); DomString *domString = new DomString(); domString->setText(buttonGroup->objectName()); - domString->setAttributeNotr(QLatin1String("true")); + domString->setAttributeNotr(QStringLiteral("true")); DomProperty *domProperty = new DomProperty(); domProperty->setAttributeName(QLatin1String(buttonGroupPropertyC)); domProperty->setElementString(domString); @@ -2323,13 +2319,13 @@ void QAbstractFormBuilder::saveItemViewExtraInfo(const QAbstractItemView *itemVi // Special handling for qtableview/qtreeview fake header attributes // static QStringList realPropertyNames = - (QStringList() << QLatin1String("visible") - << QLatin1String("cascadingSectionResizes") - << QLatin1String("defaultSectionSize") - << QLatin1String("highlightSections") - << QLatin1String("minimumSectionSize") - << QLatin1String("showSortIndicator") - << QLatin1String("stretchLastSection")); + (QStringList() << QStringLiteral("visible") + << QStringLiteral("cascadingSectionResizes") + << QStringLiteral("defaultSectionSize") + << QStringLiteral("highlightSections") + << QStringLiteral("minimumSectionSize") + << QStringLiteral("showSortIndicator") + << QStringLiteral("stretchLastSection")); if (const QTreeView *treeView = qobject_cast<const QTreeView*>(itemView)) { QList<DomProperty*> viewProperties = ui_widget->elementAttribute(); @@ -2337,7 +2333,7 @@ void QAbstractFormBuilder::saveItemViewExtraInfo(const QAbstractItemView *itemVi foreach (const QString &realPropertyName, realPropertyNames) { const QString upperPropertyName = realPropertyName.at(0).toUpper() + realPropertyName.mid(1); - const QString fakePropertyName = QLatin1String("header") + upperPropertyName; + const QString fakePropertyName = QStringLiteral("header") + upperPropertyName; foreach (DomProperty *property, headerProperties) { if (property->attributeName() == realPropertyName) { property->setAttributeName(fakePropertyName); @@ -2348,13 +2344,13 @@ void QAbstractFormBuilder::saveItemViewExtraInfo(const QAbstractItemView *itemVi ui_widget->setElementAttribute(viewProperties); } else if (const QTableView *tableView = qobject_cast<const QTableView*>(itemView)) { static QStringList headerPrefixes = - (QStringList() << QLatin1String("horizontalHeader") - << QLatin1String("verticalHeader")); + (QStringList() << QStringLiteral("horizontalHeader") + << QStringLiteral("verticalHeader")); QList<DomProperty*> viewProperties = ui_widget->elementAttribute(); foreach (const QString &headerPrefix, headerPrefixes) { QList<DomProperty*> headerProperties; - if (headerPrefix == QLatin1String("horizontalHeader")) + if (headerPrefix == QStringLiteral("horizontalHeader")) headerProperties = computeProperties(tableView->horizontalHeader()); else headerProperties = computeProperties(tableView->verticalHeader()); @@ -2704,13 +2700,13 @@ void QAbstractFormBuilder::loadItemViewExtraInfo(DomWidget *ui_widget, QAbstract // Special handling for qtableview/qtreeview fake header attributes // static QStringList realPropertyNames = - (QStringList() << QLatin1String("visible") - << QLatin1String("cascadingSectionResizes") - << QLatin1String("defaultSectionSize") - << QLatin1String("highlightSections") - << QLatin1String("minimumSectionSize") - << QLatin1String("showSortIndicator") - << QLatin1String("stretchLastSection")); + (QStringList() << QStringLiteral("visible") + << QStringLiteral("cascadingSectionResizes") + << QStringLiteral("defaultSectionSize") + << QStringLiteral("highlightSections") + << QStringLiteral("minimumSectionSize") + << QStringLiteral("showSortIndicator") + << QStringLiteral("stretchLastSection")); if (QTreeView *treeView = qobject_cast<QTreeView*>(itemView)) { QList<DomProperty*> allAttributes = ui_widget->elementAttribute(); @@ -2718,7 +2714,7 @@ void QAbstractFormBuilder::loadItemViewExtraInfo(DomWidget *ui_widget, QAbstract foreach (const QString &realPropertyName, realPropertyNames) { const QString upperPropertyName = realPropertyName.at(0).toUpper() + realPropertyName.mid(1); - const QString fakePropertyName = QLatin1String("header") + upperPropertyName; + const QString fakePropertyName = QStringLiteral("header") + upperPropertyName; foreach (DomProperty *attr, allAttributes) { if (attr->attributeName() == fakePropertyName) { attr->setAttributeName(realPropertyName); @@ -2729,8 +2725,8 @@ void QAbstractFormBuilder::loadItemViewExtraInfo(DomWidget *ui_widget, QAbstract applyProperties(treeView->header(), headerProperties); } else if (QTableView *tableView = qobject_cast<QTableView*>(itemView)) { static QStringList headerPrefixes = - (QStringList() << QLatin1String("horizontalHeader") - << QLatin1String("verticalHeader")); + (QStringList() << QStringLiteral("horizontalHeader") + << QStringLiteral("verticalHeader")); QList<DomProperty*> allAttributes = ui_widget->elementAttribute(); foreach (const QString &headerPrefix, headerPrefixes) { @@ -2746,7 +2742,7 @@ void QAbstractFormBuilder::loadItemViewExtraInfo(DomWidget *ui_widget, QAbstract } } } - if (headerPrefix == QLatin1String("horizontalHeader")) + if (headerPrefix == QStringLiteral("horizontalHeader")) applyProperties(tableView->horizontalHeader(), headerProperties); else applyProperties(tableView->verticalHeader(), headerProperties); diff --git a/src/designer/src/lib/uilib/formbuilderextra.cpp b/src/designer/src/lib/uilib/formbuilderextra.cpp index 3d34a20bf..1c27b70f1 100644 --- a/src/designer/src/lib/uilib/formbuilderextra.cpp +++ b/src/designer/src/lib/uilib/formbuilderextra.cpp @@ -87,7 +87,7 @@ QFormBuilderExtra::CustomWidgetData::CustomWidgetData(const DomCustomWidget *dcw QFormBuilderExtra::QFormBuilderExtra() : m_defaultMargin(INT_MIN), m_defaultSpacing(INT_MIN), - m_language(QLatin1String("c++")), + m_language(QStringLiteral("c++")), m_layoutWidget(false), m_resourceBuilder(0), m_textBuilder(0) @@ -454,47 +454,47 @@ void QFormBuilderExtra::clearGridLayoutColumnMinimumWidth(QGridLayout *grid) // ------------ QFormBuilderStrings QFormBuilderStrings::QFormBuilderStrings() : - buddyProperty(QLatin1String("buddy")), - cursorProperty(QLatin1String("cursor")), - objectNameProperty(QLatin1String("objectName")), - trueValue(QLatin1String("true")), - falseValue(QLatin1String("false")), - horizontalPostFix(QLatin1String("Horizontal")), - separator(QLatin1String("separator")), - defaultTitle(QLatin1String("Page")), - titleAttribute(QLatin1String("title")), - labelAttribute(QLatin1String("label")), - toolTipAttribute(QLatin1String("toolTip")), - whatsThisAttribute(QLatin1String("whatsThis")), - flagsAttribute(QLatin1String("flags")), - iconAttribute(QLatin1String("icon")), - pixmapAttribute(QLatin1String("pixmap")), - textAttribute(QLatin1String("text")), - currentIndexProperty(QLatin1String("currentIndex")), - toolBarAreaAttribute(QLatin1String("toolBarArea")), - toolBarBreakAttribute(QLatin1String("toolBarBreak")), - dockWidgetAreaAttribute(QLatin1String("dockWidgetArea")), - marginProperty(QLatin1String("margin")), - spacingProperty(QLatin1String("spacing")), - leftMarginProperty(QLatin1String("leftMargin")), - topMarginProperty(QLatin1String("topMargin")), - rightMarginProperty(QLatin1String("rightMargin")), - bottomMarginProperty(QLatin1String("bottomMargin")), - horizontalSpacingProperty(QLatin1String("horizontalSpacing")), - verticalSpacingProperty(QLatin1String("verticalSpacing")), - sizeHintProperty(QLatin1String("sizeHint")), - sizeTypeProperty(QLatin1String("sizeType")), - orientationProperty(QLatin1String("orientation")), - styleSheetProperty(QLatin1String("styleSheet")), - qtHorizontal(QLatin1String("Qt::Horizontal")), - qtVertical(QLatin1String("Qt::Vertical")), - currentRowProperty(QLatin1String("currentRow")), - tabSpacingProperty(QLatin1String("tabSpacing")), - qWidgetClass(QLatin1String("QWidget")), - lineClass(QLatin1String("Line")), - geometryProperty(QLatin1String("geometry")), - scriptWidgetVariable(QLatin1String("widget")), - scriptChildWidgetsVariable(QLatin1String("childWidgets")) + buddyProperty(QStringLiteral("buddy")), + cursorProperty(QStringLiteral("cursor")), + objectNameProperty(QStringLiteral("objectName")), + trueValue(QStringLiteral("true")), + falseValue(QStringLiteral("false")), + horizontalPostFix(QStringLiteral("Horizontal")), + separator(QStringLiteral("separator")), + defaultTitle(QStringLiteral("Page")), + titleAttribute(QStringLiteral("title")), + labelAttribute(QStringLiteral("label")), + toolTipAttribute(QStringLiteral("toolTip")), + whatsThisAttribute(QStringLiteral("whatsThis")), + flagsAttribute(QStringLiteral("flags")), + iconAttribute(QStringLiteral("icon")), + pixmapAttribute(QStringLiteral("pixmap")), + textAttribute(QStringLiteral("text")), + currentIndexProperty(QStringLiteral("currentIndex")), + toolBarAreaAttribute(QStringLiteral("toolBarArea")), + toolBarBreakAttribute(QStringLiteral("toolBarBreak")), + dockWidgetAreaAttribute(QStringLiteral("dockWidgetArea")), + marginProperty(QStringLiteral("margin")), + spacingProperty(QStringLiteral("spacing")), + leftMarginProperty(QStringLiteral("leftMargin")), + topMarginProperty(QStringLiteral("topMargin")), + rightMarginProperty(QStringLiteral("rightMargin")), + bottomMarginProperty(QStringLiteral("bottomMargin")), + horizontalSpacingProperty(QStringLiteral("horizontalSpacing")), + verticalSpacingProperty(QStringLiteral("verticalSpacing")), + sizeHintProperty(QStringLiteral("sizeHint")), + sizeTypeProperty(QStringLiteral("sizeType")), + orientationProperty(QStringLiteral("orientation")), + styleSheetProperty(QStringLiteral("styleSheet")), + qtHorizontal(QStringLiteral("Qt::Horizontal")), + qtVertical(QStringLiteral("Qt::Vertical")), + currentRowProperty(QStringLiteral("currentRow")), + tabSpacingProperty(QStringLiteral("tabSpacing")), + qWidgetClass(QStringLiteral("QWidget")), + lineClass(QStringLiteral("Line")), + geometryProperty(QStringLiteral("geometry")), + scriptWidgetVariable(QStringLiteral("widget")), + scriptChildWidgetsVariable(QStringLiteral("childWidgets")) { itemRoles.append(qMakePair(Qt::FontRole, QString::fromLatin1("font"))); itemRoles.append(qMakePair(Qt::TextAlignmentRole, QString::fromLatin1("textAlignment"))); diff --git a/src/designer/src/lib/uilib/formscriptrunner.cpp b/src/designer/src/lib/uilib/formscriptrunner.cpp index 8efb12f9e..7ee6b3aaa 100644 --- a/src/designer/src/lib/uilib/formscriptrunner.cpp +++ b/src/designer/src/lib/uilib/formscriptrunner.cpp @@ -118,7 +118,7 @@ void QFormScriptRunner::QFormScriptRunnerPrivate::initializeEngine(QWidget *w, c } QString QFormScriptRunner::QFormScriptRunnerPrivate::engineError(QScriptEngine &scriptEngine) { - QScriptValue error = scriptEngine.evaluate(QLatin1String("Error")); + QScriptValue error = scriptEngine.evaluate(QStringLiteral("Error")); if (error.isValid()) return error.toString(); return QCoreApplication::tr("Unknown error"); diff --git a/src/designer/src/lib/uilib/properties.cpp b/src/designer/src/lib/uilib/properties.cpp index 88cd455d6..df8a22cb7 100644 --- a/src/designer/src/lib/uilib/properties.cpp +++ b/src/designer/src/lib/uilib/properties.cpp @@ -331,7 +331,7 @@ static bool applySimpleProperty(const QVariant &v, bool translateString, DomProp DomString *str = new DomString(); str->setText(v.toString()); if (!translateString) - str->setAttributeNotr(QLatin1String("true")); + str->setAttributeNotr(QStringLiteral("true")); dom_prop->setElementString(str); } return true; diff --git a/src/designer/src/lib/uilib/ui4.cpp b/src/designer/src/lib/uilib/ui4.cpp index 5c232c862..81930e129 100644 --- a/src/designer/src/lib/uilib/ui4.cpp +++ b/src/designer/src/lib/uilib/ui4.cpp @@ -3479,7 +3479,7 @@ void DomWidget::read(QXmlStreamReader &reader) continue; } if (name == QStringLiteral("native")) { - setAttributeNative((attribute.value().toString() == QLatin1String("true") ? true : false)); + setAttributeNative((attribute.value().toString() == QStringLiteral("true") ? true : false)); continue; } reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString()); @@ -3596,7 +3596,7 @@ void DomWidget::write(QXmlStreamWriter &writer, const QString &tagName) const writer.writeAttribute(QStringLiteral("name"), attributeName()); if (hasAttributeNative()) - writer.writeAttribute(QStringLiteral("native"), (attributeNative() ? QLatin1String("true") : QLatin1String("false"))); + writer.writeAttribute(QStringLiteral("native"), (attributeNative() ? QStringLiteral("true") : QStringLiteral("false"))); for (int i = 0; i < m_class.size(); ++i) { QString v = m_class[i]; @@ -4853,23 +4853,23 @@ void DomFont::read(QXmlStreamReader &reader) continue; } if (tag == QStringLiteral("italic")) { - setElementItalic((reader.readElementText() == QLatin1String("true") ? true : false)); + setElementItalic((reader.readElementText() == QStringLiteral("true") ? true : false)); continue; } if (tag == QStringLiteral("bold")) { - setElementBold((reader.readElementText() == QLatin1String("true") ? true : false)); + setElementBold((reader.readElementText() == QStringLiteral("true") ? true : false)); continue; } if (tag == QStringLiteral("underline")) { - setElementUnderline((reader.readElementText() == QLatin1String("true") ? true : false)); + setElementUnderline((reader.readElementText() == QStringLiteral("true") ? true : false)); continue; } if (tag == QStringLiteral("strikeout")) { - setElementStrikeOut((reader.readElementText() == QLatin1String("true") ? true : false)); + setElementStrikeOut((reader.readElementText() == QStringLiteral("true") ? true : false)); continue; } if (tag == QStringLiteral("antialiasing")) { - setElementAntialiasing((reader.readElementText() == QLatin1String("true") ? true : false)); + setElementAntialiasing((reader.readElementText() == QStringLiteral("true") ? true : false)); continue; } if (tag == QStringLiteral("stylestrategy")) { @@ -4877,7 +4877,7 @@ void DomFont::read(QXmlStreamReader &reader) continue; } if (tag == QStringLiteral("kerning")) { - setElementKerning((reader.readElementText() == QLatin1String("true") ? true : false)); + setElementKerning((reader.readElementText() == QStringLiteral("true") ? true : false)); continue; } reader.raiseError(QStringLiteral("Unexpected element ") + tag); @@ -4913,23 +4913,23 @@ void DomFont::write(QXmlStreamWriter &writer, const QString &tagName) const } if (m_children & Italic) { - writer.writeTextElement(QStringLiteral("italic"), (m_italic ? QLatin1String("true") : QLatin1String("false"))); + writer.writeTextElement(QStringLiteral("italic"), (m_italic ? QStringLiteral("true") : QStringLiteral("false"))); } if (m_children & Bold) { - writer.writeTextElement(QStringLiteral("bold"), (m_bold ? QLatin1String("true") : QLatin1String("false"))); + writer.writeTextElement(QStringLiteral("bold"), (m_bold ? QStringLiteral("true") : QStringLiteral("false"))); } if (m_children & Underline) { - writer.writeTextElement(QStringLiteral("underline"), (m_underline ? QLatin1String("true") : QLatin1String("false"))); + writer.writeTextElement(QStringLiteral("underline"), (m_underline ? QStringLiteral("true") : QStringLiteral("false"))); } if (m_children & StrikeOut) { - writer.writeTextElement(QStringLiteral("strikeout"), (m_strikeOut ? QLatin1String("true") : QLatin1String("false"))); + writer.writeTextElement(QStringLiteral("strikeout"), (m_strikeOut ? QStringLiteral("true") : QStringLiteral("false"))); } if (m_children & Antialiasing) { - writer.writeTextElement(QStringLiteral("antialiasing"), (m_antialiasing ? QLatin1String("true") : QLatin1String("false"))); + writer.writeTextElement(QStringLiteral("antialiasing"), (m_antialiasing ? QStringLiteral("true") : QStringLiteral("false"))); } if (m_children & StyleStrategy) { @@ -4937,7 +4937,7 @@ void DomFont::write(QXmlStreamWriter &writer, const QString &tagName) const } if (m_children & Kerning) { - writer.writeTextElement(QStringLiteral("kerning"), (m_kerning ? QLatin1String("true") : QLatin1String("false"))); + writer.writeTextElement(QStringLiteral("kerning"), (m_kerning ? QStringLiteral("true") : QStringLiteral("false"))); } if (!m_text.isEmpty()) diff --git a/src/designer/src/plugins/activeqt/qaxwidgetplugin.cpp b/src/designer/src/plugins/activeqt/qaxwidgetplugin.cpp index 4c7c1a7b3..4471cb148 100644 --- a/src/designer/src/plugins/activeqt/qaxwidgetplugin.cpp +++ b/src/designer/src/plugins/activeqt/qaxwidgetplugin.cpp @@ -62,12 +62,12 @@ QAxWidgetPlugin::QAxWidgetPlugin(QObject *parent) : QString QAxWidgetPlugin::name() const { - return QLatin1String("QAxWidget"); + return QStringLiteral("QAxWidget"); } QString QAxWidgetPlugin::group() const { - return QLatin1String("Containers"); + return QStringLiteral("Containers"); } QString QAxWidgetPlugin::toolTip() const @@ -82,7 +82,7 @@ QString QAxWidgetPlugin::whatsThis() const QString QAxWidgetPlugin::includeFile() const { - return QLatin1String("qaxwidget.h"); + return QStringLiteral("qaxwidget.h"); } QIcon QAxWidgetPlugin::icon() const @@ -126,7 +126,7 @@ void QAxWidgetPlugin::initialize(QDesignerFormEditorInterface *core) QString QAxWidgetPlugin::domXml() const { - return QLatin1String("\ + return QStringLiteral("\ <ui language=\"c++\">\ <widget class=\"QAxWidget\" name=\"axWidget\">\ <property name=\"geometry\">\ diff --git a/src/designer/src/plugins/activeqt/qaxwidgetpropertysheet.cpp b/src/designer/src/plugins/activeqt/qaxwidgetpropertysheet.cpp index d558c7b10..076669b88 100644 --- a/src/designer/src/plugins/activeqt/qaxwidgetpropertysheet.cpp +++ b/src/designer/src/plugins/activeqt/qaxwidgetpropertysheet.cpp @@ -60,7 +60,7 @@ const char *QAxWidgetPropertySheet::controlPropertyName = "control"; QAxWidgetPropertySheet::QAxWidgetPropertySheet(QDesignerAxWidget *object, QObject *parent) : QDesignerPropertySheet(object, parent), m_controlProperty(controlPropertyName), - m_propertyGroup(QLatin1String("QAxWidget")) + m_propertyGroup(QStringLiteral("QAxWidget")) { if (!axWidget()->loaded()) { // For some obscure reason.... const int controlIndex = QDesignerPropertySheet::indexOf(m_controlProperty); diff --git a/src/designer/src/plugins/phononwidgets/phononcollection.cpp b/src/designer/src/plugins/phononwidgets/phononcollection.cpp index 1a956cb1c..48da7e0a9 100644 --- a/src/designer/src/plugins/phononwidgets/phononcollection.cpp +++ b/src/designer/src/plugins/phononwidgets/phononcollection.cpp @@ -64,7 +64,7 @@ private: PhononCollection::PhononCollection(QObject *parent) : QObject(parent) { - const QString group = QLatin1String("Phonon"); + const QString group = QStringLiteral("Phonon"); m_plugins.push_back(new VideoPlayerPlugin(group, this)); m_plugins.push_back(new SeekSliderPlugin(group, this)); m_plugins.push_back(new VolumeSliderPlugin(group, this)); diff --git a/src/designer/src/plugins/phononwidgets/seeksliderplugin.cpp b/src/designer/src/plugins/phononwidgets/seeksliderplugin.cpp index c7d53819c..70c4b213c 100644 --- a/src/designer/src/plugins/phononwidgets/seeksliderplugin.cpp +++ b/src/designer/src/plugins/phononwidgets/seeksliderplugin.cpp @@ -56,7 +56,7 @@ SeekSliderPlugin::SeekSliderPlugin(const QString &group, QObject *parent) : QString SeekSliderPlugin::name() const { - return QLatin1String("Phonon::SeekSlider"); + return QStringLiteral("Phonon::SeekSlider"); } QString SeekSliderPlugin::group() const @@ -76,12 +76,12 @@ QString SeekSliderPlugin::whatsThis() const QString SeekSliderPlugin::includeFile() const { - return QLatin1String("<phonon/seekslider.h>"); + return QStringLiteral("<phonon/seekslider.h>"); } QIcon SeekSliderPlugin::icon() const { - return QIcon(QLatin1String(":/trolltech/phononwidgets/images/seekslider.png")); + return QIcon(QStringLiteral(":/trolltech/phononwidgets/images/seekslider.png")); } bool SeekSliderPlugin::isContainer() const @@ -108,7 +108,7 @@ void SeekSliderPlugin::initialize(QDesignerFormEditorInterface *) QString SeekSliderPlugin::domXml() const { - return QLatin1String("\ + return QStringLiteral("\ <ui language=\"c++\">\ <widget class=\"Phonon::SeekSlider\" name=\"seekSlider\"/>\ </ui>"); diff --git a/src/designer/src/plugins/phononwidgets/videoplayerplugin.cpp b/src/designer/src/plugins/phononwidgets/videoplayerplugin.cpp index 378a7a532..e25071a5c 100644 --- a/src/designer/src/plugins/phononwidgets/videoplayerplugin.cpp +++ b/src/designer/src/plugins/phononwidgets/videoplayerplugin.cpp @@ -62,7 +62,7 @@ VideoPlayerPlugin::VideoPlayerPlugin(const QString &group, QObject *parent) : QString VideoPlayerPlugin::name() const { - return QLatin1String("Phonon::VideoPlayer"); + return QStringLiteral("Phonon::VideoPlayer"); } QString VideoPlayerPlugin::group() const @@ -82,12 +82,12 @@ QString VideoPlayerPlugin::whatsThis() const QString VideoPlayerPlugin::includeFile() const { - return QLatin1String("<phonon/videoplayer.h>"); + return QStringLiteral("<phonon/videoplayer.h>"); } QIcon VideoPlayerPlugin::icon() const { - return QIcon(QLatin1String(":/trolltech/phononwidgets/images/videoplayer.png")); + return QIcon(QStringLiteral(":/trolltech/phononwidgets/images/videoplayer.png")); } bool VideoPlayerPlugin::isContainer() const @@ -117,7 +117,7 @@ void VideoPlayerPlugin::initialize(QDesignerFormEditorInterface * core) QString VideoPlayerPlugin::domXml() const { - return QLatin1String("\ + return QStringLiteral("\ <ui language=\"c++\">\ <widget class=\"Phonon::VideoPlayer\" name=\"videoPlayer\">\ <property name=\"geometry\">\ diff --git a/src/designer/src/plugins/phononwidgets/volumesliderplugin.cpp b/src/designer/src/plugins/phononwidgets/volumesliderplugin.cpp index 44d5372ac..8ed083dad 100644 --- a/src/designer/src/plugins/phononwidgets/volumesliderplugin.cpp +++ b/src/designer/src/plugins/phononwidgets/volumesliderplugin.cpp @@ -56,7 +56,7 @@ VolumeSliderPlugin::VolumeSliderPlugin(const QString &group, QObject *parent) : QString VolumeSliderPlugin::name() const { - return QLatin1String("Phonon::VolumeSlider"); + return QStringLiteral("Phonon::VolumeSlider"); } QString VolumeSliderPlugin::group() const @@ -76,12 +76,12 @@ QString VolumeSliderPlugin::whatsThis() const QString VolumeSliderPlugin::includeFile() const { - return QLatin1String("<phonon/volumeslider.h>"); + return QStringLiteral("<phonon/volumeslider.h>"); } QIcon VolumeSliderPlugin::icon() const { - return QIcon(QLatin1String(":/trolltech/phononwidgets/images/volumeslider.png")); + return QIcon(QStringLiteral(":/trolltech/phononwidgets/images/volumeslider.png")); } bool VolumeSliderPlugin::isContainer() const @@ -108,7 +108,7 @@ void VolumeSliderPlugin::initialize(QDesignerFormEditorInterface *) QString VolumeSliderPlugin::domXml() const { - return QLatin1String("\ + return QStringLiteral("\ <ui language=\"c++\">\ <widget class=\"Phonon::VolumeSlider\" name=\"volumeSlider\"/>\ </ui>"); diff --git a/src/designer/src/plugins/qdeclarativeview/qdeclarativeview_plugin.cpp b/src/designer/src/plugins/qdeclarativeview/qdeclarativeview_plugin.cpp index 16086fc60..b3f2e99ea 100644 --- a/src/designer/src/plugins/qdeclarativeview/qdeclarativeview_plugin.cpp +++ b/src/designer/src/plugins/qdeclarativeview/qdeclarativeview_plugin.cpp @@ -59,12 +59,12 @@ QDeclarativeViewPlugin::QDeclarativeViewPlugin(QObject *parent) : QString QDeclarativeViewPlugin::name() const { - return QLatin1String("QDeclarativeView"); + return QStringLiteral("QDeclarativeView"); } QString QDeclarativeViewPlugin::group() const { - return QLatin1String("Display Widgets"); + return QStringLiteral("Display Widgets"); } QString QDeclarativeViewPlugin::toolTip() const @@ -79,7 +79,7 @@ QString QDeclarativeViewPlugin::whatsThis() const QString QDeclarativeViewPlugin::includeFile() const { - return QLatin1String("QtDeclarative/QDeclarativeView"); + return QStringLiteral("QtDeclarative/QDeclarativeView"); } QIcon QDeclarativeViewPlugin::icon() const @@ -112,7 +112,7 @@ void QDeclarativeViewPlugin::initialize(QDesignerFormEditorInterface * /*core*/) QString QDeclarativeViewPlugin::domXml() const { - return QLatin1String("\ + return QStringLiteral("\ <ui language=\"c++\">\ <widget class=\"QDeclarativeView\" name=\"declarativeView\">\ <property name=\"geometry\">\ diff --git a/src/designer/src/plugins/qwebview/qwebview_plugin.cpp b/src/designer/src/plugins/qwebview/qwebview_plugin.cpp index 92d06babd..7cd0003b7 100644 --- a/src/designer/src/plugins/qwebview/qwebview_plugin.cpp +++ b/src/designer/src/plugins/qwebview/qwebview_plugin.cpp @@ -59,12 +59,12 @@ QWebViewPlugin::QWebViewPlugin(QObject *parent) : QString QWebViewPlugin::name() const { - return QLatin1String("QWebView"); + return QStringLiteral("QWebView"); } QString QWebViewPlugin::group() const { - return QLatin1String("Display Widgets"); + return QStringLiteral("Display Widgets"); } QString QWebViewPlugin::toolTip() const @@ -79,12 +79,12 @@ QString QWebViewPlugin::whatsThis() const QString QWebViewPlugin::includeFile() const { - return QLatin1String("QtWebKit/QWebView"); + return QStringLiteral("QtWebKit/QWebView"); } QIcon QWebViewPlugin::icon() const { - return QIcon(QLatin1String(":/trolltech/qwebview/images/qwebview.png")); + return QIcon(QStringLiteral(":/trolltech/qwebview/images/qwebview.png")); } bool QWebViewPlugin::isContainer() const @@ -112,7 +112,7 @@ void QWebViewPlugin::initialize(QDesignerFormEditorInterface * /*core*/) QString QWebViewPlugin::domXml() const { - return QLatin1String("\ + return QStringLiteral("\ <ui language=\"c++\">\ <widget class=\"QWebView\" name=\"webView\">\ <property name=\"url\">\ diff --git a/src/designer/src/uitools/quiloader.cpp b/src/designer/src/uitools/quiloader.cpp index 19d4277ae..2e4f0799a 100644 --- a/src/designer/src/uitools/quiloader.cpp +++ b/src/designer/src/uitools/quiloader.cpp @@ -101,7 +101,7 @@ QVariant TranslatingTextBuilder::loadText(const DomProperty *text) const return QVariant(); if (str->hasAttributeNotr()) { const QString notr = str->attributeNotr(); - if (notr == QLatin1String("true") || notr == QLatin1String("yes")) + if (notr == QStringLiteral("true") || notr == QStringLiteral("yes")) return QVariant::fromValue(str->text()); } QUiTranslatableStringValue strVal; @@ -395,7 +395,7 @@ static QString convertTranslatable(const DomProperty *p, const QByteArray &class return QString(); if (dom_str->hasAttributeNotr()) { const QString notr = dom_str->attributeNotr(); - if (notr == QLatin1String("yes") || notr == QLatin1String("true")) + if (notr == QStringLiteral("yes") || notr == QStringLiteral("true")) return QString(); } strVal->setValue(dom_str->text().toUtf8()); @@ -635,7 +635,7 @@ QUiLoader::QUiLoader(QObject *parent) foreach (const QString &path, QApplication::libraryPaths()) { QString libPath = path; libPath += QDir::separator(); - libPath += QLatin1String("designer"); + libPath += QStringLiteral("designer"); paths.append(libPath); } |