QtWidgets: use _L1 for for creating Latin-1 string literals

Task-number: QTBUG-98434
Change-Id: I310ea8f19d73a79d985ebfb8bfbff7a02c424360
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
Sona Kurazyan 2022-04-25 16:16:10 +02:00
parent 43b779ab04
commit 7d79b94db7
56 changed files with 810 additions and 723 deletions

View File

@ -76,6 +76,8 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
QString qt_accStripAmp(const QString &text); QString qt_accStripAmp(const QString &text);
QString qt_accHotKey(const QString &text); QString qt_accHotKey(const QString &text);
@ -517,9 +519,9 @@ QAccessibleAbstractScrollArea::elementType(QWidget *widget) const
return Self; return Self;
if (widget == abstractScrollArea()->viewport()) if (widget == abstractScrollArea()->viewport())
return Viewport; return Viewport;
if (widget->objectName() == QLatin1String("qt_scrollarea_hcontainer")) if (widget->objectName() == "qt_scrollarea_hcontainer"_L1)
return HorizontalContainer; return HorizontalContainer;
if (widget->objectName() == QLatin1String("qt_scrollarea_vcontainer")) if (widget->objectName() == "qt_scrollarea_vcontainer"_L1)
return VerticalContainer; return VerticalContainer;
if (widget == abstractScrollArea()->cornerWidget()) if (widget == abstractScrollArea()->cornerWidget())
return CornerWidget; return CornerWidget;

View File

@ -68,6 +68,8 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
static QList<QWidget*> childWidgets(const QWidget *widget) static QList<QWidget*> childWidgets(const QWidget *widget)
{ {
QList<QWidget*> widgets; QList<QWidget*> widgets;
@ -78,8 +80,8 @@ static QList<QWidget*> childWidgets(const QWidget *widget)
#if QT_CONFIG(menu) #if QT_CONFIG(menu)
&& !qobject_cast<QMenu*>(w) && !qobject_cast<QMenu*>(w)
#endif #endif
&& w->objectName() != QLatin1String("qt_rubberband") && w->objectName() != "qt_rubberband"_L1
&& w->objectName() != QLatin1String("qt_spinbox_lineedit")) && w->objectName() != "qt_spinbox_lineedit"_L1)
widgets.append(w); widgets.append(w);
} }
return widgets; return widgets;
@ -148,7 +150,7 @@ QString qt_accStripAmp(const QString &text)
if (ampIndex != -1) if (ampIndex != -1)
newText.remove(ampIndex, 1); newText.remove(ampIndex, 1);
return newText.replace(QLatin1String("&&"), QLatin1String("&")); return newText.replace("&&"_L1, "&"_L1);
} }
QString qt_accHotKey(const QString &text) QString qt_accHotKey(const QString &text)

View File

@ -60,6 +60,8 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
QAccessibleInterface *qAccessibleFactory(const QString &classname, QObject *object) QAccessibleInterface *qAccessibleFactory(const QString &classname, QObject *object)
{ {
QAccessibleInterface *iface = nullptr; QAccessibleInterface *iface = nullptr;
@ -77,154 +79,154 @@ QAccessibleInterface *qAccessibleFactory(const QString &classname, QObject *obje
if (false) { if (false) {
#if QT_CONFIG(lineedit) #if QT_CONFIG(lineedit)
} else if (classname == QLatin1String("QLineEdit")) { } else if (classname == "QLineEdit"_L1) {
if (widget->objectName() == QLatin1String("qt_spinbox_lineedit")) if (widget->objectName() == "qt_spinbox_lineedit"_L1)
iface = nullptr; iface = nullptr;
else else
iface = new QAccessibleLineEdit(widget); iface = new QAccessibleLineEdit(widget);
#endif #endif
#if QT_CONFIG(combobox) #if QT_CONFIG(combobox)
} else if (classname == QLatin1String("QComboBox")) { } else if (classname == "QComboBox"_L1) {
iface = new QAccessibleComboBox(widget); iface = new QAccessibleComboBox(widget);
#endif #endif
#if QT_CONFIG(spinbox) #if QT_CONFIG(spinbox)
} else if (classname == QLatin1String("QAbstractSpinBox")) { } else if (classname == "QAbstractSpinBox"_L1) {
iface = new QAccessibleAbstractSpinBox(widget); iface = new QAccessibleAbstractSpinBox(widget);
} else if (classname == QLatin1String("QSpinBox")) { } else if (classname == "QSpinBox"_L1) {
iface = new QAccessibleSpinBox(widget); iface = new QAccessibleSpinBox(widget);
} else if (classname == QLatin1String("QDoubleSpinBox")) { } else if (classname == "QDoubleSpinBox"_L1) {
iface = new QAccessibleDoubleSpinBox(widget); iface = new QAccessibleDoubleSpinBox(widget);
#endif #endif
#if QT_CONFIG(scrollbar) #if QT_CONFIG(scrollbar)
} else if (classname == QLatin1String("QScrollBar")) { } else if (classname == "QScrollBar"_L1) {
iface = new QAccessibleScrollBar(widget); iface = new QAccessibleScrollBar(widget);
#endif #endif
#if QT_CONFIG(slider) #if QT_CONFIG(slider)
} else if (classname == QLatin1String("QAbstractSlider")) { } else if (classname == "QAbstractSlider"_L1) {
iface = new QAccessibleAbstractSlider(widget); iface = new QAccessibleAbstractSlider(widget);
} else if (classname == QLatin1String("QSlider")) { } else if (classname == "QSlider"_L1) {
iface = new QAccessibleSlider(widget); iface = new QAccessibleSlider(widget);
#endif #endif
#if QT_CONFIG(toolbutton) #if QT_CONFIG(toolbutton)
} else if (classname == QLatin1String("QToolButton")) { } else if (classname == "QToolButton"_L1) {
iface = new QAccessibleToolButton(widget); iface = new QAccessibleToolButton(widget);
#endif // QT_CONFIG(toolbutton) #endif // QT_CONFIG(toolbutton)
#if QT_CONFIG(abstractbutton) #if QT_CONFIG(abstractbutton)
} else if (classname == QLatin1String("QCheckBox") } else if (classname == "QCheckBox"_L1
|| classname == QLatin1String("QRadioButton") || classname == "QRadioButton"_L1
|| classname == QLatin1String("QPushButton") || classname == "QPushButton"_L1
|| classname == QLatin1String("QAbstractButton")) { || classname == "QAbstractButton"_L1) {
iface = new QAccessibleButton(widget); iface = new QAccessibleButton(widget);
#endif #endif
} else if (classname == QLatin1String("QDialog")) { } else if (classname == "QDialog"_L1) {
iface = new QAccessibleWidget(widget, QAccessible::Dialog); iface = new QAccessibleWidget(widget, QAccessible::Dialog);
} else if (classname == QLatin1String("QMessageBox")) { } else if (classname == "QMessageBox"_L1) {
iface = new QAccessibleWidget(widget, QAccessible::AlertMessage); iface = new QAccessibleWidget(widget, QAccessible::AlertMessage);
#if QT_CONFIG(mainwindow) #if QT_CONFIG(mainwindow)
} else if (classname == QLatin1String("QMainWindow")) { } else if (classname == "QMainWindow"_L1) {
iface = new QAccessibleMainWindow(widget); iface = new QAccessibleMainWindow(widget);
#endif #endif
} else if (classname == QLatin1String("QLabel") || classname == QLatin1String("QLCDNumber")) { } else if (classname == "QLabel"_L1 || classname == "QLCDNumber"_L1) {
iface = new QAccessibleDisplay(widget); iface = new QAccessibleDisplay(widget);
#if QT_CONFIG(groupbox) #if QT_CONFIG(groupbox)
} else if (classname == QLatin1String("QGroupBox")) { } else if (classname == "QGroupBox"_L1) {
iface = new QAccessibleGroupBox(widget); iface = new QAccessibleGroupBox(widget);
#endif #endif
} else if (classname == QLatin1String("QStatusBar")) { } else if (classname == "QStatusBar"_L1) {
iface = new QAccessibleDisplay(widget); iface = new QAccessibleDisplay(widget);
#if QT_CONFIG(progressbar) #if QT_CONFIG(progressbar)
} else if (classname == QLatin1String("QProgressBar")) { } else if (classname == "QProgressBar"_L1) {
iface = new QAccessibleProgressBar(widget); iface = new QAccessibleProgressBar(widget);
#endif #endif
} else if (classname == QLatin1String("QToolBar")) { } else if (classname == "QToolBar"_L1) {
iface = new QAccessibleWidget(widget, QAccessible::ToolBar, widget->windowTitle()); iface = new QAccessibleWidget(widget, QAccessible::ToolBar, widget->windowTitle());
#if QT_CONFIG(menubar) #if QT_CONFIG(menubar)
} else if (classname == QLatin1String("QMenuBar")) { } else if (classname == "QMenuBar"_L1) {
iface = new QAccessibleMenuBar(widget); iface = new QAccessibleMenuBar(widget);
#endif #endif
#if QT_CONFIG(menu) #if QT_CONFIG(menu)
} else if (classname == QLatin1String("QMenu")) { } else if (classname == "QMenu"_L1) {
iface = new QAccessibleMenu(widget); iface = new QAccessibleMenu(widget);
#endif #endif
#if QT_CONFIG(treeview) #if QT_CONFIG(treeview)
} else if (classname == QLatin1String("QTreeView")) { } else if (classname == "QTreeView"_L1) {
iface = new QAccessibleTree(widget); iface = new QAccessibleTree(widget);
#endif // QT_CONFIG(treeview) #endif // QT_CONFIG(treeview)
#if QT_CONFIG(itemviews) #if QT_CONFIG(itemviews)
} else if (classname == QLatin1String("QTableView") || classname == QLatin1String("QListView")) { } else if (classname == "QTableView"_L1 || classname == "QListView"_L1) {
iface = new QAccessibleTable(widget); iface = new QAccessibleTable(widget);
// ### This should be cleaned up. We return the parent for the scrollarea to hide it. // ### This should be cleaned up. We return the parent for the scrollarea to hide it.
#endif // QT_CONFIG(itemviews) #endif // QT_CONFIG(itemviews)
#if QT_CONFIG(tabbar) #if QT_CONFIG(tabbar)
} else if (classname == QLatin1String("QTabBar")) { } else if (classname == "QTabBar"_L1) {
iface = new QAccessibleTabBar(widget); iface = new QAccessibleTabBar(widget);
#endif #endif
} else if (classname == QLatin1String("QSizeGrip")) { } else if (classname == "QSizeGrip"_L1) {
iface = new QAccessibleWidget(widget, QAccessible::Grip); iface = new QAccessibleWidget(widget, QAccessible::Grip);
#if QT_CONFIG(splitter) #if QT_CONFIG(splitter)
} else if (classname == QLatin1String("QSplitter")) { } else if (classname == "QSplitter"_L1) {
iface = new QAccessibleWidget(widget, QAccessible::Splitter); iface = new QAccessibleWidget(widget, QAccessible::Splitter);
} else if (classname == QLatin1String("QSplitterHandle")) { } else if (classname == "QSplitterHandle"_L1) {
iface = new QAccessibleWidget(widget, QAccessible::Grip); iface = new QAccessibleWidget(widget, QAccessible::Grip);
#endif #endif
#if QT_CONFIG(textedit) && !defined(QT_NO_CURSOR) #if QT_CONFIG(textedit) && !defined(QT_NO_CURSOR)
} else if (classname == QLatin1String("QTextEdit")) { } else if (classname == "QTextEdit"_L1) {
iface = new QAccessibleTextEdit(widget); iface = new QAccessibleTextEdit(widget);
} else if (classname == QLatin1String("QPlainTextEdit")) { } else if (classname == "QPlainTextEdit"_L1) {
iface = new QAccessiblePlainTextEdit(widget); iface = new QAccessiblePlainTextEdit(widget);
#endif #endif
} else if (classname == QLatin1String("QTipLabel")) { } else if (classname == "QTipLabel"_L1) {
iface = new QAccessibleDisplay(widget, QAccessible::ToolTip); iface = new QAccessibleDisplay(widget, QAccessible::ToolTip);
} else if (classname == QLatin1String("QFrame")) { } else if (classname == "QFrame"_L1) {
iface = new QAccessibleWidget(widget, QAccessible::Border); iface = new QAccessibleWidget(widget, QAccessible::Border);
#if QT_CONFIG(stackedwidget) #if QT_CONFIG(stackedwidget)
} else if (classname == QLatin1String("QStackedWidget")) { } else if (classname == "QStackedWidget"_L1) {
iface = new QAccessibleStackedWidget(widget); iface = new QAccessibleStackedWidget(widget);
#endif #endif
#if QT_CONFIG(toolbox) #if QT_CONFIG(toolbox)
} else if (classname == QLatin1String("QToolBox")) { } else if (classname == "QToolBox"_L1) {
iface = new QAccessibleToolBox(widget); iface = new QAccessibleToolBox(widget);
#endif #endif
#if QT_CONFIG(mdiarea) #if QT_CONFIG(mdiarea)
} else if (classname == QLatin1String("QMdiArea")) { } else if (classname == "QMdiArea"_L1) {
iface = new QAccessibleMdiArea(widget); iface = new QAccessibleMdiArea(widget);
} else if (classname == QLatin1String("QMdiSubWindow")) { } else if (classname == "QMdiSubWindow"_L1) {
iface = new QAccessibleMdiSubWindow(widget); iface = new QAccessibleMdiSubWindow(widget);
#endif #endif
#if QT_CONFIG(dialogbuttonbox) #if QT_CONFIG(dialogbuttonbox)
} else if (classname == QLatin1String("QDialogButtonBox")) { } else if (classname == "QDialogButtonBox"_L1) {
iface = new QAccessibleDialogButtonBox(widget); iface = new QAccessibleDialogButtonBox(widget);
#endif #endif
#if QT_CONFIG(dial) #if QT_CONFIG(dial)
} else if (classname == QLatin1String("QDial")) { } else if (classname == "QDial"_L1) {
iface = new QAccessibleDial(widget); iface = new QAccessibleDial(widget);
#endif #endif
#if QT_CONFIG(rubberband) #if QT_CONFIG(rubberband)
} else if (classname == QLatin1String("QRubberBand")) { } else if (classname == "QRubberBand"_L1) {
iface = new QAccessibleWidget(widget, QAccessible::Border); iface = new QAccessibleWidget(widget, QAccessible::Border);
#endif #endif
#if QT_CONFIG(textbrowser) && !defined(QT_NO_CURSOR) #if QT_CONFIG(textbrowser) && !defined(QT_NO_CURSOR)
} else if (classname == QLatin1String("QTextBrowser")) { } else if (classname == "QTextBrowser"_L1) {
iface = new QAccessibleTextBrowser(widget); iface = new QAccessibleTextBrowser(widget);
#endif #endif
#if QT_CONFIG(scrollarea) #if QT_CONFIG(scrollarea)
} else if (classname == QLatin1String("QAbstractScrollArea")) { } else if (classname == "QAbstractScrollArea"_L1) {
iface = new QAccessibleAbstractScrollArea(widget); iface = new QAccessibleAbstractScrollArea(widget);
} else if (classname == QLatin1String("QScrollArea")) { } else if (classname == "QScrollArea"_L1) {
iface = new QAccessibleScrollArea(widget); iface = new QAccessibleScrollArea(widget);
#endif #endif
#if QT_CONFIG(calendarwidget) #if QT_CONFIG(calendarwidget)
} else if (classname == QLatin1String("QCalendarWidget")) { } else if (classname == "QCalendarWidget"_L1) {
iface = new QAccessibleCalendarWidget(widget); iface = new QAccessibleCalendarWidget(widget);
#endif #endif
#if QT_CONFIG(dockwidget) #if QT_CONFIG(dockwidget)
} else if (classname == QLatin1String("QDockWidget")) { } else if (classname == "QDockWidget"_L1) {
iface = new QAccessibleDockWidget(widget); iface = new QAccessibleDockWidget(widget);
#endif #endif
} else if (classname == QLatin1String("QWidget")) { } else if (classname == "QWidget"_L1) {
iface = new QAccessibleWidget(widget); iface = new QAccessibleWidget(widget);
} else if (classname == QLatin1String("QWindowContainer")) { } else if (classname == "QWindowContainer"_L1) {
iface = new QAccessibleWindowContainer(widget); iface = new QAccessibleWindowContainer(widget);
} }

View File

@ -96,6 +96,8 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
QString qt_accStripAmp(const QString &text); QString qt_accStripAmp(const QString &text);
QString qt_accHotKey(const QString &text); QString qt_accHotKey(const QString &text);
@ -114,8 +116,8 @@ QList<QWidget*> childWidgets(const QWidget *widget)
#if QT_CONFIG(menu) #if QT_CONFIG(menu)
&& !qobject_cast<QMenu*>(w) && !qobject_cast<QMenu*>(w)
#endif #endif
&& objectName != QLatin1String("qt_rubberband") && objectName != "qt_rubberband"_L1
&& objectName != QLatin1String("qt_qmainwindow_extended_splitter")) { && objectName != "qt_qmainwindow_extended_splitter"_L1) {
widgets.append(w); widgets.append(w);
} }
} }
@ -432,7 +434,7 @@ QString QAccessibleMdiSubWindow::text(QAccessible::Text textType) const
{ {
if (textType == QAccessible::Name) { if (textType == QAccessible::Name) {
QString title = mdiSubWindow()->windowTitle(); QString title = mdiSubWindow()->windowTitle();
title.replace(QLatin1String("[*]"), QLatin1String("")); title.replace("[*]"_L1, ""_L1);
return title; return title;
} }
return QAccessibleWidget::text(textType); return QAccessibleWidget::text(textType);
@ -570,7 +572,7 @@ QCalendarWidget *QAccessibleCalendarWidget::calendarWidget() const
QAbstractItemView *QAccessibleCalendarWidget::calendarView() const QAbstractItemView *QAccessibleCalendarWidget::calendarView() const
{ {
for (QObject *child : calendarWidget()->children()) { for (QObject *child : calendarWidget()->children()) {
if (child->objectName() == QLatin1String("qt_calendar_calendarview")) if (child->objectName() == "qt_calendar_calendarview"_L1)
return static_cast<QAbstractItemView *>(child); return static_cast<QAbstractItemView *>(child);
} }
return nullptr; return nullptr;
@ -579,7 +581,7 @@ QAbstractItemView *QAccessibleCalendarWidget::calendarView() const
QWidget *QAccessibleCalendarWidget::navigationBar() const QWidget *QAccessibleCalendarWidget::navigationBar() const
{ {
for (QObject *child : calendarWidget()->children()) { for (QObject *child : calendarWidget()->children()) {
if (child->objectName() == QLatin1String("qt_calendar_navigationbar")) if (child->objectName() == "qt_calendar_navigationbar"_L1)
return static_cast<QWidget *>(child); return static_cast<QWidget *>(child);
} }
return nullptr; return nullptr;
@ -852,12 +854,12 @@ QString QAccessibleTextWidget::attributes(int offset, int *startOffset, int *end
AttributeFormatter attrs; AttributeFormatter attrs;
QString family = charFormatFont.families().value(0, QString()); QString family = charFormatFont.families().value(0, QString());
if (!family.isEmpty()) { if (!family.isEmpty()) {
family = family.replace(u'\\', QLatin1String("\\\\")); family = family.replace(u'\\', "\\\\"_L1);
family = family.replace(u':', QLatin1String("\\:")); family = family.replace(u':', "\\:"_L1);
family = family.replace(u',', QLatin1String("\\,")); family = family.replace(u',', "\\,"_L1);
family = family.replace(u'=', QLatin1String("\\=")); family = family.replace(u'=', "\\="_L1);
family = family.replace(u';', QLatin1String("\\;")); family = family.replace(u';', "\\;"_L1);
family = family.replace(u'\"', QLatin1String("\\\"")); family = family.replace(u'\"', "\\\""_L1);
attrs["font-family"] = u'"' + family + u'"'; attrs["font-family"] = u'"' + family + u'"';
} }

View File

@ -65,6 +65,8 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
#ifndef QT_NO_ACCESSIBILITY #ifndef QT_NO_ACCESSIBILITY
#if QT_CONFIG(spinbox) #if QT_CONFIG(spinbox)
@ -253,7 +255,7 @@ QAccessibleSpinBox::QAccessibleSpinBox(QWidget *w)
: QAccessibleAbstractSpinBox(w) : QAccessibleAbstractSpinBox(w)
{ {
Q_ASSERT(spinBox()); Q_ASSERT(spinBox());
addControllingSignal(QLatin1String("valueChanged(int)")); addControllingSignal("valueChanged(int)"_L1);
} }
/*! /*!
@ -270,7 +272,7 @@ QAccessibleDoubleSpinBox::QAccessibleDoubleSpinBox(QWidget *widget)
: QAccessibleAbstractSpinBox(widget) : QAccessibleAbstractSpinBox(widget)
{ {
Q_ASSERT(qobject_cast<QDoubleSpinBox *>(widget)); Q_ASSERT(qobject_cast<QDoubleSpinBox *>(widget));
addControllingSignal(QLatin1String("valueChanged(double)")); addControllingSignal("valueChanged(double)"_L1);
} }
/*! /*!
@ -307,7 +309,7 @@ QAccessibleScrollBar::QAccessibleScrollBar(QWidget *w)
: QAccessibleAbstractSlider(w, QAccessible::ScrollBar) : QAccessibleAbstractSlider(w, QAccessible::ScrollBar)
{ {
Q_ASSERT(scrollBar()); Q_ASSERT(scrollBar());
addControllingSignal(QLatin1String("valueChanged(int)")); addControllingSignal("valueChanged(int)"_L1);
} }
/*! Returns the scroll bar. */ /*! Returns the scroll bar. */
@ -342,7 +344,7 @@ QAccessibleSlider::QAccessibleSlider(QWidget *w)
: QAccessibleAbstractSlider(w) : QAccessibleAbstractSlider(w)
{ {
Q_ASSERT(slider()); Q_ASSERT(slider());
addControllingSignal(QLatin1String("valueChanged(int)")); addControllingSignal("valueChanged(int)"_L1);
} }
/*! Returns the slider. */ /*! Returns the slider. */
@ -410,7 +412,7 @@ QAccessibleDial::QAccessibleDial(QWidget *widget)
: QAccessibleAbstractSlider(widget, QAccessible::Dial) : QAccessibleAbstractSlider(widget, QAccessible::Dial)
{ {
Q_ASSERT(qobject_cast<QDial *>(widget)); Q_ASSERT(qobject_cast<QDial *>(widget));
addControllingSignal(QLatin1String("valueChanged(int)")); addControllingSignal("valueChanged(int)"_L1);
} }
QString QAccessibleDial::text(QAccessible::Text textType) const QString QAccessibleDial::text(QAccessible::Text textType) const

View File

@ -93,6 +93,8 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
#ifndef QT_NO_ACCESSIBILITY #ifndef QT_NO_ACCESSIBILITY
extern QList<QWidget*> childWidgets(const QWidget *widget); extern QList<QWidget*> childWidgets(const QWidget *widget);
@ -120,9 +122,9 @@ QAccessibleButton::QAccessibleButton(QWidget *w)
// FIXME: The checkable state of the button is dynamic, // FIXME: The checkable state of the button is dynamic,
// while we only update the controlling signal once :( // while we only update the controlling signal once :(
if (button()->isCheckable()) if (button()->isCheckable())
addControllingSignal(QLatin1String("toggled(bool)")); addControllingSignal("toggled(bool)"_L1);
else else
addControllingSignal(QLatin1String("clicked()")); addControllingSignal("clicked()"_L1);
} }
/*! Returns the button. */ /*! Returns the button. */
@ -687,8 +689,8 @@ QStringList QAccessibleGroupBox::keyBindingsForAction(const QString &) const
QAccessibleLineEdit::QAccessibleLineEdit(QWidget *w, const QString &name) QAccessibleLineEdit::QAccessibleLineEdit(QWidget *w, const QString &name)
: QAccessibleWidget(w, QAccessible::EditableText, name) : QAccessibleWidget(w, QAccessible::EditableText, name)
{ {
addControllingSignal(QLatin1String("textChanged(const QString&)")); addControllingSignal("textChanged(const QString&)"_L1);
addControllingSignal(QLatin1String("returnPressed()")); addControllingSignal("returnPressed()"_L1);
} }
/*! Returns the line edit. */ /*! Returns the line edit. */

View File

@ -82,6 +82,8 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
namespace { namespace {
class QColorLuminancePicker; class QColorLuminancePicker;
class QColorPicker; class QColorPicker;
@ -1666,7 +1668,7 @@ void QColorDialogPrivate::releaseColorPicking()
#endif #endif
q->releaseKeyboard(); q->releaseKeyboard();
q->setMouseTracking(false); q->setMouseTracking(false);
lblScreenColorInfo->setText(QLatin1String("\n")); lblScreenColorInfo->setText("\n"_L1);
addCusBt->setDisabled(false); addCusBt->setDisabled(false);
buttons->setDisabled(false); buttons->setDisabled(false);
screenColorPickerButton->setDisabled(false); screenColorPickerButton->setDisabled(false);
@ -1734,7 +1736,7 @@ void QColorDialogPrivate::initWidgets()
if (supportsColorPicking()) { if (supportsColorPicking()) {
screenColorPickerButton = new QPushButton(); screenColorPickerButton = new QPushButton();
leftLay->addWidget(screenColorPickerButton); leftLay->addWidget(screenColorPickerButton);
lblScreenColorInfo = new QLabel(QLatin1String("\n")); lblScreenColorInfo = new QLabel("\n"_L1);
leftLay->addWidget(lblScreenColorInfo); leftLay->addWidget(lblScreenColorInfo);
q->connect(screenColorPickerButton, SIGNAL(clicked()), SLOT(_q_pickScreenColor())); q->connect(screenColorPickerButton, SIGNAL(clicked()), SLOT(_q_pickScreenColor()));
} else { } else {

View File

@ -62,6 +62,8 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
namespace { namespace {
struct Message { struct Message {
QString content; QString content;
@ -188,11 +190,11 @@ static void jump(QtMsgType t, const QMessageLogContext & /*context*/, const QStr
if (!qtMessageHandler) if (!qtMessageHandler)
return; return;
QString rich = QLatin1String("<p><b>") + msgType2i18nString(t) + QLatin1String("</b></p>") QString rich = "<p><b>"_L1 + msgType2i18nString(t) + "</b></p>"_L1
+ Qt::convertFromPlainText(m, Qt::WhiteSpaceNormal); + Qt::convertFromPlainText(m, Qt::WhiteSpaceNormal);
// ### work around text engine quirk // ### work around text engine quirk
if (rich.endsWith(QLatin1String("</p>"))) if (rich.endsWith("</p>"_L1))
rich.chop(4); rich.chop(4);
if (!metFatal) { if (!metFatal) {

View File

@ -88,6 +88,8 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
Q_GLOBAL_STATIC(QUrl, lastVisitedDir) Q_GLOBAL_STATIC(QUrl, lastVisitedDir)
/*! /*!
@ -1351,7 +1353,7 @@ QStringList qt_make_filter_list(const QString &filter)
if (filter.isEmpty()) if (filter.isEmpty())
return QStringList(); return QStringList();
QString sep(QLatin1String(";;")); QString sep(";;"_L1);
if (!filter.contains(sep) && filter.contains(u'\n')) if (!filter.contains(sep) && filter.contains(u'\n'))
sep = u'\n'; sep = u'\n';
@ -1555,7 +1557,7 @@ static QString nameFilterForMime(const QString &mimeType)
return QFileDialog::tr("All files (*)"); return QFileDialog::tr("All files (*)");
} else { } else {
const QString patterns = mime.globPatterns().join(u' '); const QString patterns = mime.globPatterns().join(u' ');
return mime.comment() + QLatin1String(" (") + patterns + u')'; return mime.comment() + " ("_L1 + patterns + u')';
} }
} }
return QString(); return QString();
@ -1898,7 +1900,7 @@ void QFileDialogComboBox::setHistory(const QStringList &paths)
//On windows the popup display the "C:\", convert to nativeSeparators //On windows the popup display the "C:\", convert to nativeSeparators
const QUrl url = idx.isValid() const QUrl url = idx.isValid()
? QUrl::fromLocalFile(QDir::toNativeSeparators(idx.data(QFileSystemModel::FilePathRole).toString())) ? QUrl::fromLocalFile(QDir::toNativeSeparators(idx.data(QFileSystemModel::FilePathRole).toString()))
: QUrl(QLatin1String("file:")); : QUrl("file:"_L1);
if (url.isValid()) if (url.isValid())
list.append(url); list.append(url);
urlModel->setUrls(list); urlModel->setUrls(list);
@ -2730,7 +2732,7 @@ void QFileDialog::accept()
QString lineEditText = d->lineEdit()->text(); QString lineEditText = d->lineEdit()->text();
// "hidden feature" type .. and then enter, and it will move up a dir // "hidden feature" type .. and then enter, and it will move up a dir
// special case for ".." // special case for ".."
if (lineEditText == QLatin1String("..")) { if (lineEditText == ".."_L1) {
d->_q_navigateToParent(); d->_q_navigateToParent();
const QSignalBlocker blocker(d->qFileDialogUi->fileNameEdit); const QSignalBlocker blocker(d->qFileDialogUi->fileNameEdit);
d->lineEdit()->selectAll(); d->lineEdit()->selectAll();
@ -2821,37 +2823,37 @@ void QFileDialog::accept()
void QFileDialogPrivate::saveSettings() void QFileDialogPrivate::saveSettings()
{ {
Q_Q(QFileDialog); Q_Q(QFileDialog);
QSettings settings(QSettings::UserScope, QLatin1String("QtProject")); QSettings settings(QSettings::UserScope, "QtProject"_L1);
settings.beginGroup(QLatin1String("FileDialog")); settings.beginGroup("FileDialog"_L1);
if (usingWidgets()) { if (usingWidgets()) {
settings.setValue(QLatin1String("sidebarWidth"), qFileDialogUi->splitter->sizes().constFirst()); settings.setValue("sidebarWidth"_L1, qFileDialogUi->splitter->sizes().constFirst());
settings.setValue(QLatin1String("shortcuts"), QUrl::toStringList(qFileDialogUi->sidebar->urls())); settings.setValue("shortcuts"_L1, QUrl::toStringList(qFileDialogUi->sidebar->urls()));
settings.setValue(QLatin1String("treeViewHeader"), qFileDialogUi->treeView->header()->saveState()); settings.setValue("treeViewHeader"_L1, qFileDialogUi->treeView->header()->saveState());
} }
QStringList historyUrls; QStringList historyUrls;
const QStringList history = q->history(); const QStringList history = q->history();
historyUrls.reserve(history.size()); historyUrls.reserve(history.size());
for (const QString &path : history) for (const QString &path : history)
historyUrls << QUrl::fromLocalFile(path).toString(); historyUrls << QUrl::fromLocalFile(path).toString();
settings.setValue(QLatin1String("history"), historyUrls); settings.setValue("history"_L1, historyUrls);
settings.setValue(QLatin1String("lastVisited"), lastVisitedDir()->toString()); settings.setValue("lastVisited"_L1, lastVisitedDir()->toString());
const QMetaEnum &viewModeMeta = q->metaObject()->enumerator(q->metaObject()->indexOfEnumerator("ViewMode")); const QMetaEnum &viewModeMeta = q->metaObject()->enumerator(q->metaObject()->indexOfEnumerator("ViewMode"));
settings.setValue(QLatin1String("viewMode"), QLatin1String(viewModeMeta.key(q->viewMode()))); settings.setValue("viewMode"_L1, QLatin1String(viewModeMeta.key(q->viewMode())));
settings.setValue(QLatin1String("qtVersion"), QLatin1String(QT_VERSION_STR)); settings.setValue("qtVersion"_L1, QT_VERSION_STR ""_L1);
} }
bool QFileDialogPrivate::restoreFromSettings() bool QFileDialogPrivate::restoreFromSettings()
{ {
Q_Q(QFileDialog); Q_Q(QFileDialog);
QSettings settings(QSettings::UserScope, QLatin1String("QtProject")); QSettings settings(QSettings::UserScope, "QtProject"_L1);
if (!settings.childGroups().contains(QLatin1String("FileDialog"))) if (!settings.childGroups().contains("FileDialog"_L1))
return false; return false;
settings.beginGroup(QLatin1String("FileDialog")); settings.beginGroup("FileDialog"_L1);
q->setDirectoryUrl(lastVisitedDir()->isEmpty() ? settings.value(QLatin1String("lastVisited")).toUrl() : *lastVisitedDir()); q->setDirectoryUrl(lastVisitedDir()->isEmpty() ? settings.value("lastVisited"_L1).toUrl() : *lastVisitedDir());
QByteArray viewModeStr = settings.value(QLatin1String("viewMode")).toString().toLatin1(); QByteArray viewModeStr = settings.value("viewMode"_L1).toString().toLatin1();
const QMetaEnum &viewModeMeta = q->metaObject()->enumerator(q->metaObject()->indexOfEnumerator("ViewMode")); const QMetaEnum &viewModeMeta = q->metaObject()->enumerator(q->metaObject()->indexOfEnumerator("ViewMode"));
bool ok = false; bool ok = false;
int viewMode = viewModeMeta.keyToValue(viewModeStr.constData(), &ok); int viewMode = viewModeMeta.keyToValue(viewModeStr.constData(), &ok);
@ -2859,21 +2861,21 @@ bool QFileDialogPrivate::restoreFromSettings()
viewMode = QFileDialog::List; viewMode = QFileDialog::List;
q->setViewMode(static_cast<QFileDialog::ViewMode>(viewMode)); q->setViewMode(static_cast<QFileDialog::ViewMode>(viewMode));
sidebarUrls = QUrl::fromStringList(settings.value(QLatin1String("shortcuts")).toStringList()); sidebarUrls = QUrl::fromStringList(settings.value("shortcuts"_L1).toStringList());
headerData = settings.value(QLatin1String("treeViewHeader")).toByteArray(); headerData = settings.value("treeViewHeader"_L1).toByteArray();
if (!usingWidgets()) if (!usingWidgets())
return true; return true;
QStringList history; QStringList history;
const auto urlStrings = settings.value(QLatin1String("history")).toStringList(); const auto urlStrings = settings.value("history"_L1).toStringList();
for (const QString &urlStr : urlStrings) { for (const QString &urlStr : urlStrings) {
QUrl url(urlStr); QUrl url(urlStr);
if (url.isLocalFile()) if (url.isLocalFile())
history << url.toLocalFile(); history << url.toLocalFile();
} }
return restoreWidgetState(history, settings.value(QLatin1String("sidebarWidth"), -1).toInt()); return restoreWidgetState(history, settings.value("sidebarWidth"_L1, -1).toInt());
} }
#endif // settings #endif // settings
@ -2955,8 +2957,8 @@ void QFileDialogPrivate::init(const QFileDialogArgs &args)
// Try to restore from the FileDialog settings group; if it fails, fall back // Try to restore from the FileDialog settings group; if it fails, fall back
// to the pre-5.5 QByteArray serialized settings. // to the pre-5.5 QByteArray serialized settings.
if (!restoreFromSettings()) { if (!restoreFromSettings()) {
const QSettings settings(QSettings::UserScope, QLatin1String("QtProject")); const QSettings settings(QSettings::UserScope, "QtProject"_L1);
q->restoreState(settings.value(QLatin1String("Qt/filedialog")).toByteArray()); q->restoreState(settings.value("Qt/filedialog"_L1).toByteArray());
} }
#endif #endif
@ -2992,7 +2994,7 @@ void QFileDialogPrivate::createWidgets()
model = new QFileSystemModel(q); model = new QFileSystemModel(q);
model->setIconProvider(&defaultIconProvider); model->setIconProvider(&defaultIconProvider);
model->setFilter(options->filter()); model->setFilter(options->filter());
model->setObjectName(QLatin1String("qt_filesystem_model")); model->setObjectName("qt_filesystem_model"_L1);
if (QPlatformFileDialogHelper *helper = platformFileDialogHelper()) if (QPlatformFileDialogHelper *helper = platformFileDialogHelper())
model->setNameFilterDisables(helper->defaultNameFilterDisables()); model->setNameFilterDisables(helper->defaultNameFilterDisables());
else else
@ -3011,7 +3013,7 @@ void QFileDialogPrivate::createWidgets()
qFileDialogUi->setupUi(q); qFileDialogUi->setupUi(q);
QList<QUrl> initialBookmarks; QList<QUrl> initialBookmarks;
initialBookmarks << QUrl(QLatin1String("file:")) initialBookmarks << QUrl("file:"_L1)
<< QUrl::fromLocalFile(QDir::homePath()); << QUrl::fromLocalFile(QDir::homePath());
qFileDialogUi->sidebar->setModelAndUrls(model, initialBookmarks); qFileDialogUi->sidebar->setModelAndUrls(model, initialBookmarks);
QFileDialog::connect(qFileDialogUi->sidebar, SIGNAL(goToUrl(QUrl)), QFileDialog::connect(qFileDialogUi->sidebar, SIGNAL(goToUrl(QUrl)),
@ -3069,10 +3071,10 @@ void QFileDialogPrivate::createWidgets()
qFileDialogUi->treeView->setModel(model); qFileDialogUi->treeView->setModel(model);
QHeaderView *treeHeader = qFileDialogUi->treeView->header(); QHeaderView *treeHeader = qFileDialogUi->treeView->header();
QFontMetrics fm(q->font()); QFontMetrics fm(q->font());
treeHeader->resizeSection(0, fm.horizontalAdvance(QLatin1String("wwwwwwwwwwwwwwwwwwwwwwwwww"))); treeHeader->resizeSection(0, fm.horizontalAdvance("wwwwwwwwwwwwwwwwwwwwwwwwww"_L1));
treeHeader->resizeSection(1, fm.horizontalAdvance(QLatin1String("128.88 GB"))); treeHeader->resizeSection(1, fm.horizontalAdvance("128.88 GB"_L1));
treeHeader->resizeSection(2, fm.horizontalAdvance(QLatin1String("mp3Folder"))); treeHeader->resizeSection(2, fm.horizontalAdvance("mp3Folder"_L1));
treeHeader->resizeSection(3, fm.horizontalAdvance(QLatin1String("10/29/81 02:02PM"))); treeHeader->resizeSection(3, fm.horizontalAdvance("10/29/81 02:02PM"_L1));
treeHeader->setContextMenuPolicy(Qt::ActionsContextMenu); treeHeader->setContextMenuPolicy(Qt::ActionsContextMenu);
QActionGroup *showActionGroup = new QActionGroup(q); QActionGroup *showActionGroup = new QActionGroup(q);
@ -3119,8 +3121,8 @@ void QFileDialogPrivate::createWidgets()
// Try to restore from the FileDialog settings group; if it fails, fall back // Try to restore from the FileDialog settings group; if it fails, fall back
// to the pre-5.5 QByteArray serialized settings. // to the pre-5.5 QByteArray serialized settings.
if (!restoreFromSettings()) { if (!restoreFromSettings()) {
const QSettings settings(QSettings::UserScope, QLatin1String("QtProject")); const QSettings settings(QSettings::UserScope, "QtProject"_L1);
q->restoreState(settings.value(QLatin1String("Qt/filedialog")).toByteArray()); q->restoreState(settings.value("Qt/filedialog"_L1).toByteArray());
} }
#endif #endif
@ -3306,7 +3308,7 @@ void QFileDialogPrivate::createMenuActions()
// ### TODO add Desktop & Computer actions // ### TODO add Desktop & Computer actions
QAction *goToParent = new QAction(q); QAction *goToParent = new QAction(q);
goToParent->setObjectName(QLatin1String("qt_goto_parent_action")); goToParent->setObjectName("qt_goto_parent_action"_L1);
#ifndef QT_NO_SHORTCUT #ifndef QT_NO_SHORTCUT
goToParent->setShortcut(Qt::CTRL | Qt::Key_Up); goToParent->setShortcut(Qt::CTRL | Qt::Key_Up);
#endif #endif
@ -3315,21 +3317,21 @@ void QFileDialogPrivate::createMenuActions()
renameAction = new QAction(q); renameAction = new QAction(q);
renameAction->setEnabled(false); renameAction->setEnabled(false);
renameAction->setObjectName(QLatin1String("qt_rename_action")); renameAction->setObjectName("qt_rename_action"_L1);
QObject::connect(renameAction, SIGNAL(triggered()), q, SLOT(_q_renameCurrent())); QObject::connect(renameAction, SIGNAL(triggered()), q, SLOT(_q_renameCurrent()));
deleteAction = new QAction(q); deleteAction = new QAction(q);
deleteAction->setEnabled(false); deleteAction->setEnabled(false);
deleteAction->setObjectName(QLatin1String("qt_delete_action")); deleteAction->setObjectName("qt_delete_action"_L1);
QObject::connect(deleteAction, SIGNAL(triggered()), q, SLOT(_q_deleteCurrent())); QObject::connect(deleteAction, SIGNAL(triggered()), q, SLOT(_q_deleteCurrent()));
showHiddenAction = new QAction(q); showHiddenAction = new QAction(q);
showHiddenAction->setObjectName(QLatin1String("qt_show_hidden_action")); showHiddenAction->setObjectName("qt_show_hidden_action"_L1);
showHiddenAction->setCheckable(true); showHiddenAction->setCheckable(true);
QObject::connect(showHiddenAction, SIGNAL(triggered()), q, SLOT(_q_showHidden())); QObject::connect(showHiddenAction, SIGNAL(triggered()), q, SLOT(_q_showHidden()));
newFolderAction = new QAction(q); newFolderAction = new QAction(q);
newFolderAction->setObjectName(QLatin1String("qt_new_folder_action")); newFolderAction->setObjectName("qt_new_folder_action"_L1);
QObject::connect(newFolderAction, SIGNAL(triggered()), q, SLOT(_q_createDirectory())); QObject::connect(newFolderAction, SIGNAL(triggered()), q, SLOT(_q_createDirectory()));
} }
@ -3625,7 +3627,7 @@ void QFileDialogPrivate::_q_deleteCurrent()
void QFileDialogPrivate::_q_autoCompleteFileName(const QString &text) void QFileDialogPrivate::_q_autoCompleteFileName(const QString &text)
{ {
if (text.startsWith(QLatin1String("//")) || text.startsWith(u'\\')) { if (text.startsWith("//"_L1) || text.startsWith(u'\\')) {
qFileDialogUi->listView->selectionModel()->clearSelection(); qFileDialogUi->listView->selectionModel()->clearSelection();
return; return;
} }
@ -3667,7 +3669,7 @@ void QFileDialogPrivate::_q_updateOkButton()
const QStringList files = q->selectedFiles(); const QStringList files = q->selectedFiles();
QString lineEditText = lineEdit()->text(); QString lineEditText = lineEdit()->text();
if (lineEditText.startsWith(QLatin1String("//")) || lineEditText.startsWith(u'\\')) { if (lineEditText.startsWith("//"_L1) || lineEditText.startsWith(u'\\')) {
button->setEnabled(true); button->setEnabled(true);
updateOkButtonText(); updateOkButtonText();
return; return;
@ -3675,7 +3677,7 @@ void QFileDialogPrivate::_q_updateOkButton()
if (files.isEmpty()) { if (files.isEmpty()) {
enableButton = false; enableButton = false;
} else if (lineEditText == QLatin1String("..")) { } else if (lineEditText == ".."_L1) {
isOpenDirectory = true; isOpenDirectory = true;
} else { } else {
switch (fileMode) { switch (fileMode) {
@ -3700,7 +3702,7 @@ void QFileDialogPrivate::_q_updateOkButton()
fileDir = fn.mid(0, fn.lastIndexOf(u'/')); fileDir = fn.mid(0, fn.lastIndexOf(u'/'));
fileName = fn.mid(fileDir.length() + 1); fileName = fn.mid(fileDir.length() + 1);
} }
if (lineEditText.contains(QLatin1String(".."))) { if (lineEditText.contains(".."_L1)) {
fileDir = info.canonicalFilePath(); fileDir = info.canonicalFilePath();
fileName = info.fileName(); fileName = info.fileName();
} }
@ -4037,7 +4039,7 @@ void QFileDialogComboBox::showPopup()
idx = idx.parent(); idx = idx.parent();
} }
// add "my computer" // add "my computer"
list.append(QUrl(QLatin1String("file:"))); list.append(QUrl("file:"_L1));
urlModel->addUrls(list, 0); urlModel->addUrls(list, 0);
idx = model()->index(model()->rowCount() - 1, 0); idx = model()->index(model()->rowCount() - 1, 0);
@ -4212,9 +4214,9 @@ QStringList QFSCompleter::splitPath(const QString &path) const
QString pathCopy = QDir::toNativeSeparators(path); QString pathCopy = QDir::toNativeSeparators(path);
QChar sep = QDir::separator(); QChar sep = QDir::separator();
#if defined(Q_OS_WIN) #if defined(Q_OS_WIN)
if (pathCopy == QLatin1String("\\") || pathCopy == QLatin1String("\\\\")) if (pathCopy == "\\"_L1 || pathCopy == "\\\\"_L1)
return QStringList(pathCopy); return QStringList(pathCopy);
QString doubleSlash(QLatin1String("\\\\")); QString doubleSlash("\\\\"_L1);
if (pathCopy.startsWith(doubleSlash)) if (pathCopy.startsWith(doubleSlash))
pathCopy = pathCopy.mid(2); pathCopy = pathCopy.mid(2);
else else
@ -4264,9 +4266,7 @@ QStringList QFSCompleter::splitPath(const QString &path) const
#endif #endif
if (currentLocation.contains(sep) && path != currentLocation) { if (currentLocation.contains(sep) && path != currentLocation) {
QStringList currentLocationList = splitPath(currentLocation); QStringList currentLocationList = splitPath(currentLocation);
while (!currentLocationList.isEmpty() while (!currentLocationList.isEmpty() && parts.count() > 0 && parts.at(0) == ".."_L1) {
&& parts.count() > 0
&& parts.at(0) == QLatin1String("..")) {
parts.removeFirst(); parts.removeFirst();
currentLocationList.removeLast(); currentLocationList.removeLast();
} }

View File

@ -63,6 +63,8 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
class QFontListView : public QListView class QFontListView : public QListView
{ {
Q_OBJECT Q_OBJECT
@ -228,7 +230,7 @@ void QFontDialogPrivate::init()
sampleEdit->setAlignment(Qt::AlignCenter); sampleEdit->setAlignment(Qt::AlignCenter);
// Note that the sample text is *not* translated with tr(), as the // Note that the sample text is *not* translated with tr(), as the
// characters used depend on the charset encoding. // characters used depend on the charset encoding.
sampleEdit->setText(QLatin1String("AaBbYyZz")); sampleEdit->setText("AaBbYyZz"_L1);
hbox->addWidget(sampleEdit); hbox->addWidget(sampleEdit);
writingSystemCombo = new QComboBox(q); writingSystemCombo = new QComboBox(q);
@ -326,7 +328,7 @@ void QFontDialogPrivate::init()
familyList->setFocus(); familyList->setFocus();
retranslateStrings(); retranslateStrings();
sampleEdit->setObjectName(QLatin1String("qt_fontDialog_sampleEdit")); sampleEdit->setObjectName("qt_fontDialog_sampleEdit"_L1);
} }
/*! /*!
@ -583,20 +585,20 @@ void QFontDialogPrivate::updateStyles()
} }
} }
if (!found && first) { if (!found && first) {
if (cstyle.contains(QLatin1String("Italic"))) { if (cstyle.contains("Italic"_L1)) {
cstyle.replace(QLatin1String("Italic"), QLatin1String("Oblique")); cstyle.replace("Italic"_L1, "Oblique"_L1);
first = false; first = false;
goto redo; goto redo;
} else if (cstyle.contains(QLatin1String("Oblique"))) { } else if (cstyle.contains("Oblique"_L1)) {
cstyle.replace(QLatin1String("Oblique"), QLatin1String("Italic")); cstyle.replace("Oblique"_L1, "Italic"_L1);
first = false; first = false;
goto redo; goto redo;
} else if (cstyle.contains(QLatin1String("Regular"))) { } else if (cstyle.contains("Regular"_L1)) {
cstyle.replace(QLatin1String("Regular"), QLatin1String("Normal")); cstyle.replace("Regular"_L1, "Normal"_L1);
first = false; first = false;
goto redo; goto redo;
} else if (cstyle.contains(QLatin1String("Normal"))) { } else if (cstyle.contains("Normal"_L1)) {
cstyle.replace(QLatin1String("Normal"), QLatin1String("Regular")); cstyle.replace("Normal"_L1, "Regular"_L1);
first = false; first = false;
goto redo; goto redo;
} }

View File

@ -72,6 +72,8 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
#if defined(Q_OS_WIN) #if defined(Q_OS_WIN)
HMENU qt_getWindowsSystemMenu(const QWidget *w) HMENU qt_getWindowsSystemMenu(const QWidget *w)
{ {
@ -270,16 +272,16 @@ void QMessageBoxPrivate::init(const QString &title, const QString &text)
Q_Q(QMessageBox); Q_Q(QMessageBox);
label = new QLabel; label = new QLabel;
label->setObjectName(QLatin1String("qt_msgbox_label")); label->setObjectName("qt_msgbox_label"_L1);
label->setTextInteractionFlags(Qt::TextInteractionFlags(q->style()->styleHint(QStyle::SH_MessageBox_TextInteractionFlags, nullptr, q))); label->setTextInteractionFlags(Qt::TextInteractionFlags(q->style()->styleHint(QStyle::SH_MessageBox_TextInteractionFlags, nullptr, q)));
label->setAlignment(Qt::AlignVCenter | Qt::AlignLeft); label->setAlignment(Qt::AlignVCenter | Qt::AlignLeft);
label->setOpenExternalLinks(true); label->setOpenExternalLinks(true);
iconLabel = new QLabel(q); iconLabel = new QLabel(q);
iconLabel->setObjectName(QLatin1String("qt_msgboxex_icon_label")); iconLabel->setObjectName("qt_msgboxex_icon_label"_L1);
iconLabel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); iconLabel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
buttonBox = new QDialogButtonBox; buttonBox = new QDialogButtonBox;
buttonBox->setObjectName(QLatin1String("qt_msgbox_buttonbox")); buttonBox->setObjectName("qt_msgbox_buttonbox"_L1);
buttonBox->setCenterButtons(q->style()->styleHint(QStyle::SH_MessageBox_CenterButtons, nullptr, q)); buttonBox->setCenterButtons(q->style()->styleHint(QStyle::SH_MessageBox_CenterButtons, nullptr, q));
QObject::connect(buttonBox, SIGNAL(clicked(QAbstractButton*)), QObject::connect(buttonBox, SIGNAL(clicked(QAbstractButton*)),
q, SLOT(_q_buttonClicked(QAbstractButton*))); q, SLOT(_q_buttonClicked(QAbstractButton*)));
@ -1495,7 +1497,7 @@ void QMessageBox::keyPressEvent(QKeyEvent *e)
#if defined(Q_OS_WIN) #if defined(Q_OS_WIN)
if (e == QKeySequence::Copy) { if (e == QKeySequence::Copy) {
const QLatin1String separator("---------------------------\n"); const auto separator = "---------------------------\n"_L1;
QString textToCopy; QString textToCopy;
textToCopy += separator + windowTitle() + u'\n' + separator // title textToCopy += separator + windowTitle() + u'\n' + separator // title
+ d->label->text() + u'\n' + separator; // text + d->label->text() + u'\n' + separator; // text
@ -1505,7 +1507,7 @@ void QMessageBox::keyPressEvent(QKeyEvent *e)
const QList<QAbstractButton *> buttons = d->buttonBox->buttons(); const QList<QAbstractButton *> buttons = d->buttonBox->buttons();
for (const auto *button : buttons) for (const auto *button : buttons)
textToCopy += button->text() + QLatin1String(" "); textToCopy += button->text() + " "_L1;
textToCopy += u'\n' + separator; textToCopy += u'\n' + separator;
#if QT_CONFIG(textedit) #if QT_CONFIG(textedit)
if (d->detailsText) if (d->detailsText)
@ -1870,7 +1872,7 @@ void QMessageBox::aboutQt(QWidget *parent, const QString &title)
translatedTextAboutQtCaption = QMessageBox::tr( translatedTextAboutQtCaption = QMessageBox::tr(
"<h3>About Qt</h3>" "<h3>About Qt</h3>"
"<p>This program uses Qt version %1.</p>" "<p>This program uses Qt version %1.</p>"
).arg(QLatin1String(QT_VERSION_STR)); ).arg(QT_VERSION_STR ""_L1);
//: Leave this text untranslated or include a verbatim copy of it below //: Leave this text untranslated or include a verbatim copy of it below
//: and note that it is the authoritative version in case of doubt. //: and note that it is the authoritative version in case of doubt.
const QString translatedTextAboutQtText = QMessageBox::tr( const QString translatedTextAboutQtText = QMessageBox::tr(
@ -1904,7 +1906,7 @@ void QMessageBox::aboutQt(QWidget *parent, const QString &title)
msgBox->setText(translatedTextAboutQtCaption); msgBox->setText(translatedTextAboutQtCaption);
msgBox->setInformativeText(translatedTextAboutQtText); msgBox->setInformativeText(translatedTextAboutQtText);
QPixmap pm(QLatin1String(":/qt-project.org/qmessagebox/images/qtlogo-64.png")); QPixmap pm(":/qt-project.org/qmessagebox/images/qtlogo-64.png"_L1);
if (!pm.isNull()) if (!pm.isNull())
msgBox->setIconPixmap(pm); msgBox->setIconPixmap(pm);
@ -2565,7 +2567,7 @@ void QMessageBox::setInformativeText(const QString &text)
} else { } else {
if (!d->informativeLabel) { if (!d->informativeLabel) {
QLabel *label = new QLabel; QLabel *label = new QLabel;
label->setObjectName(QLatin1String("qt_msgbox_informativelabel")); label->setObjectName("qt_msgbox_informativelabel"_L1);
label->setTextInteractionFlags(Qt::TextInteractionFlags(style()->styleHint(QStyle::SH_MessageBox_TextInteractionFlags, nullptr, this))); label->setTextInteractionFlags(Qt::TextInteractionFlags(style()->styleHint(QStyle::SH_MessageBox_TextInteractionFlags, nullptr, this)));
label->setAlignment(Qt::AlignTop | Qt::AlignLeft); label->setAlignment(Qt::AlignTop | Qt::AlignLeft);
label->setOpenExternalLinks(true); label->setOpenExternalLinks(true);

View File

@ -53,6 +53,8 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
void QSideBarDelegate::initStyleOption(QStyleOptionViewItem *option, void QSideBarDelegate::initStyleOption(QStyleOptionViewItem *option,
const QModelIndex &index) const const QModelIndex &index) const
{ {
@ -82,7 +84,7 @@ QUrlModel::QUrlModel(QObject *parent) : QStandardItemModel(parent), showFullPath
*/ */
QStringList QUrlModel::mimeTypes() const QStringList QUrlModel::mimeTypes() const
{ {
return QStringList(QLatin1String("text/uri-list")); return QStringList("text/uri-list"_L1);
} }
/*! /*!
@ -247,7 +249,7 @@ void QUrlModel::addUrls(const QList<QUrl> &list, int row, bool move)
row = qMin(row, rowCount()); row = qMin(row, rowCount());
for (int i = list.count() - 1; i >= 0; --i) { for (int i = list.count() - 1; i >= 0; --i) {
QUrl url = list.at(i); QUrl url = list.at(i);
if (!url.isValid() || url.scheme() != QLatin1String("file")) if (!url.isValid() || url.scheme() != "file"_L1)
continue; continue;
//this makes sure the url is clean //this makes sure the url is clean
const QString cleanUrl = QDir::cleanPath(url.toLocalFile()); const QString cleanUrl = QDir::cleanPath(url.toLocalFile());

View File

@ -81,6 +81,8 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
// These fudge terms were needed a few places to obtain pixel-perfect results // These fudge terms were needed a few places to obtain pixel-perfect results
const int GapBetweenLogoAndRightEdge = 5; const int GapBetweenLogoAndRightEdge = 5;
const int ModernHeaderTopMargin = 2; const int ModernHeaderTopMargin = 2;
@ -383,7 +385,7 @@ void QWizardHeader::setup(const QWizardLayoutInfo &info, const QString &title,
logoLabel->setPixmap(logo); logoLabel->setPixmap(logo);
subTitleLabel->setTextFormat(subTitleFormat); subTitleLabel->setTextFormat(subTitleFormat);
subTitleLabel->setText(QLatin1String("Pq\nPq")); subTitleLabel->setText("Pq\nPq"_L1);
int desiredSubTitleHeight = subTitleLabel->sizeHint().height(); int desiredSubTitleHeight = subTitleLabel->sizeHint().height();
subTitleLabel->setText(subTitle); subTitleLabel->setText(subTitle);
@ -1049,7 +1051,7 @@ void QWizardPrivate::recreateLayout(const QWizardLayoutInfo &info)
if (aero) { if (aero) {
// ### hardcoded for now: // ### hardcoded for now:
titleFont = QFont(QLatin1String("Segoe UI"), 12); titleFont = QFont("Segoe UI"_L1, 12);
QPalette pal(titleLabel->palette()); QPalette pal(titleLabel->palette());
pal.setColor(QPalette::Text, QColor(0x00, 0x33, 0x99)); pal.setColor(QPalette::Text, QColor(0x00, 0x33, 0x99));
titleLabel->setPalette(pal); titleLabel->setPalette(pal);
@ -1365,11 +1367,11 @@ static QString object_name_for_button(QWizard::WizardButton which)
{ {
switch (which) { switch (which) {
case QWizard::CommitButton: case QWizard::CommitButton:
return QLatin1String("qt_wizard_") + QLatin1String("commit"); return "qt_wizard_commit"_L1;
case QWizard::FinishButton: case QWizard::FinishButton:
return QLatin1String("qt_wizard_") + QLatin1String("finish"); return "qt_wizard_finish"_L1;
case QWizard::CancelButton: case QWizard::CancelButton:
return QLatin1String("qt_wizard_") + QLatin1String("cancel"); return "qt_wizard_cancel"_L1;
case QWizard::BackButton: case QWizard::BackButton:
case QWizard::NextButton: case QWizard::NextButton:
case QWizard::HelpButton: case QWizard::HelpButton:
@ -1377,7 +1379,7 @@ static QString object_name_for_button(QWizard::WizardButton which)
case QWizard::CustomButton2: case QWizard::CustomButton2:
case QWizard::CustomButton3: case QWizard::CustomButton3:
// Make navigation buttons detectable as passive interactor in designer // Make navigation buttons detectable as passive interactor in designer
return QLatin1String("__qt__passive_wizardbutton") + QString::number(which); return "__qt__passive_wizardbutton"_L1 + QString::number(which);
case QWizard::Stretch: case QWizard::Stretch:
case QWizard::NoButton: case QWizard::NoButton:
//case QWizard::NStandardButtons: //case QWizard::NStandardButtons:

View File

@ -41,42 +41,44 @@
#include <QtGui> #include <QtGui>
using namespace Qt::StringLiterals;
//! [0] //! [0]
QCustomPixmapStyle::QCustomPixmapStyle() : QCustomPixmapStyle::QCustomPixmapStyle() :
QPixmapStyle() QPixmapStyle()
{ {
//! [1] //! [1]
addDescriptor(PB_Enabled, addDescriptor(PB_Enabled,
QLatin1String("://button/core_button_inactive.png"), "://button/core_button_inactive.png"_L1,
QMargins(13, 13, 13, 13), QMargins(13, 13, 13, 13),
QTileRules(Qt::RepeatTile, Qt::StretchTile)); QTileRules(Qt::RepeatTile, Qt::StretchTile));
//! [1] //! [1]
addDescriptor(PB_Checked, addDescriptor(PB_Checked,
QLatin1String("://button/core_button_enabled_selected.png"), "://button/core_button_enabled_selected.png"_L1,
QMargins(13, 13, 13, 13), QMargins(13, 13, 13, 13),
QTileRules(Qt::RepeatTile, Qt::StretchTile)); QTileRules(Qt::RepeatTile, Qt::StretchTile));
addDescriptor(PB_Pressed, addDescriptor(PB_Pressed,
QLatin1String("://button/core_button_pressed.png"), "://button/core_button_pressed.png"_L1,
QMargins(13, 13, 13, 13), QMargins(13, 13, 13, 13),
QTileRules(Qt::RepeatTile, Qt::StretchTile)); QTileRules(Qt::RepeatTile, Qt::StretchTile));
addDescriptor(PB_Disabled, addDescriptor(PB_Disabled,
QLatin1String("://button/core_button_disabled.png"), "://button/core_button_disabled.png"_L1,
QMargins(13, 13, 13, 13), QMargins(13, 13, 13, 13),
QTileRules(Qt::RepeatTile, Qt::StretchTile)); QTileRules(Qt::RepeatTile, Qt::StretchTile));
addDescriptor(PB_PressedDisabled, addDescriptor(PB_PressedDisabled,
QLatin1String("://button/core_button_disabled_selected.png"), "://button/core_button_disabled_selected.png"_L1,
QMargins(13, 13, 13, 13), QMargins(13, 13, 13, 13),
QTileRules(Qt::RepeatTile, Qt::StretchTile)); QTileRules(Qt::RepeatTile, Qt::StretchTile));
//! [2] //! [2]
addDescriptor(LE_Enabled, addDescriptor(LE_Enabled,
QLatin1String("://lineedit/core_textinput_bg.png"), "://lineedit/core_textinput_bg.png"_L1,
QMargins(8, 8, 8, 8)); QMargins(8, 8, 8, 8));
addDescriptor(LE_Disabled, addDescriptor(LE_Disabled,
QLatin1String("://lineedit/core_textinput_bg_disabled.png"), "://lineedit/core_textinput_bg_disabled.png"_L1,
QMargins(8, 8, 8, 8)); QMargins(8, 8, 8, 8));
addDescriptor(LE_Focused, addDescriptor(LE_Focused,
QLatin1String("://lineedit/core_textinput_bg_highlight.png"), "://lineedit/core_textinput_bg_highlight.png"_L1,
QMargins(8, 8, 8, 8)); QMargins(8, 8, 8, 8));
copyDescriptor(LE_Enabled, TE_Enabled); copyDescriptor(LE_Enabled, TE_Enabled);

View File

@ -51,6 +51,8 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
// To ensure that all variables inside the simplex solver are non-negative, // To ensure that all variables inside the simplex solver are non-negative,
// we limit the size of anchors in the interval [-limit, limit]. Then before // we limit the size of anchors in the interval [-limit, limit]. Then before
// sending them to the simplex solver we add "limit" as an offset, so that // sending them to the simplex solver we add "limit" as an offset, so that
@ -609,7 +611,7 @@ QSimplexConstraint *GraphPath::constraint(const GraphPath &path) const
#ifdef QT_DEBUG #ifdef QT_DEBUG
QString GraphPath::toString() const QString GraphPath::toString() const
{ {
QString string(QLatin1String("Path: ")); QString string("Path: "_L1);
for (AnchorData *edge : positives) for (AnchorData *edge : positives)
string += QString::fromLatin1(" (+++) %1").arg(edge->toString()); string += QString::fromLatin1(" (+++) %1").arg(edge->toString());

View File

@ -269,42 +269,44 @@ struct AnchorVertexPair : public AnchorVertex {
#ifdef QT_DEBUG #ifdef QT_DEBUG
inline QString AnchorVertex::toString() const inline QString AnchorVertex::toString() const
{ {
using namespace Qt::StringLiterals;
if (!m_item) if (!m_item)
return QString::fromLatin1("NULL_%1").arg(quintptr(this)); return QString::fromLatin1("NULL_%1").arg(quintptr(this));
QString edge; QString edge;
switch (m_edge) { switch (m_edge) {
case Qt::AnchorLeft: case Qt::AnchorLeft:
edge = QLatin1String("Left"); edge = "Left"_L1;
break; break;
case Qt::AnchorHorizontalCenter: case Qt::AnchorHorizontalCenter:
edge = QLatin1String("HorizontalCenter"); edge = "HorizontalCenter"_L1;
break; break;
case Qt::AnchorRight: case Qt::AnchorRight:
edge = QLatin1String("Right"); edge = "Right"_L1;
break; break;
case Qt::AnchorTop: case Qt::AnchorTop:
edge = QLatin1String("Top"); edge = "Top"_L1;
break; break;
case Qt::AnchorVerticalCenter: case Qt::AnchorVerticalCenter:
edge = QLatin1String("VerticalCenter"); edge = "VerticalCenter"_L1;
break; break;
case Qt::AnchorBottom: case Qt::AnchorBottom:
edge = QLatin1String("Bottom"); edge = "Bottom"_L1;
break; break;
default: default:
edge = QLatin1String("None"); edge = "None"_L1;
break; break;
} }
QString itemName; QString itemName;
if (m_item->isLayout()) { if (m_item->isLayout()) {
itemName = QLatin1String("layout"); itemName = "layout"_L1;
} else { } else {
if (QGraphicsItem *item = m_item->graphicsItem()) { if (QGraphicsItem *item = m_item->graphicsItem()) {
itemName = item->data(0).toString(); itemName = item->data(0).toString();
} }
} }
edge.insert(0, QLatin1String("%1_")); edge.insert(0, "%1_"_L1);
return edge.arg(itemName); return edge.arg(itemName);
} }
#endif #endif

View File

@ -67,6 +67,8 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
/*! /*!
\class QGraphicsWidget \class QGraphicsWidget
\brief The QGraphicsWidget class is the base class for all widget \brief The QGraphicsWidget class is the base class for all widget
@ -2401,7 +2403,7 @@ void QGraphicsWidget::dumpFocusChain()
qWarning("Found a focus chain that is not circular, (next == 0)"); qWarning("Found a focus chain that is not circular, (next == 0)");
break; break;
} }
qDebug() << i++ << QString::number(uint(next), 16) << next->className() << next->data(0) << QString::fromLatin1("focusItem:%1").arg(next->hasFocus() ? '1' : '0') << QLatin1String("next:") << next->d_func()->focusNext->data(0) << QLatin1String("prev:") << next->d_func()->focusPrev->data(0); qDebug() << i++ << QString::number(uint(next), 16) << next->className() << next->data(0) << QString::fromLatin1("focusItem:%1").arg(next->hasFocus() ? '1' : '0') << "next:"_L1 << next->d_func()->focusNext->data(0) << "prev:"_L1 << next->d_func()->focusPrev->data(0);
if (visited.contains(next)) { if (visited.contains(next)) {
qWarning("Already visited this node. However, I expected to dump until I found myself."); qWarning("Already visited this node. However, I expected to dump until I found myself.");
break; break;

View File

@ -46,6 +46,8 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
/*! /*!
\internal \internal
\class QSimplex \class QSimplex
@ -354,7 +356,7 @@ void QSimplex::dumpMatrix()
{ {
qDebug("---- Simplex Matrix ----\n"); qDebug("---- Simplex Matrix ----\n");
QString str(QLatin1String(" ")); QString str(" "_L1);
for (int j = 0; j < columns; ++j) for (int j = 0; j < columns; ++j)
str += QString::fromLatin1(" <%1 >").arg(j, 2); str += QString::fromLatin1(" <%1 >").arg(j, 2);
qDebug("%s", qPrintable(str)); qDebug("%s", qPrintable(str));

View File

@ -132,6 +132,8 @@ static void initResources()
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
// Helper macro for static functions to check on the existence of the application class. // Helper macro for static functions to check on the existence of the application class.
#define CHECK_QAPP_INSTANCE(...) \ #define CHECK_QAPP_INSTANCE(...) \
if (Q_LIKELY(QCoreApplication::instance())) { \ if (Q_LIKELY(QCoreApplication::instance())) { \
@ -411,10 +413,10 @@ void QApplicationPrivate::process_cmdline()
// obsolete argument // obsolete argument
#ifndef QT_NO_STYLE_STYLESHEET #ifndef QT_NO_STYLE_STYLESHEET
} else if (strcmp(arg, "-stylesheet") == 0 && i < argc -1) { } else if (strcmp(arg, "-stylesheet") == 0 && i < argc -1) {
styleSheet = QLatin1String("file:///"); styleSheet = "file:///"_L1;
styleSheet.append(QString::fromLocal8Bit(argv[++i])); styleSheet.append(QString::fromLocal8Bit(argv[++i]));
} else if (strncmp(arg, "-stylesheet=", 12) == 0) { } else if (strncmp(arg, "-stylesheet=", 12) == 0) {
styleSheet = QLatin1String("file:///"); styleSheet = "file:///"_L1;
styleSheet.append(QString::fromLocal8Bit(arg + 12)); styleSheet.append(QString::fromLocal8Bit(arg + 12));
#endif #endif
} else if (qstrcmp(arg, "-widgetcount") == 0) { } else if (qstrcmp(arg, "-widgetcount") == 0) {
@ -551,7 +553,7 @@ void QApplicationPrivate::initialize()
} else { } else {
qWarning("QApplication: invalid style override '%s' passed, ignoring it.\n" qWarning("QApplication: invalid style override '%s' passed, ignoring it.\n"
"\tAvailable styles: %s", qPrintable(styleOverride), "\tAvailable styles: %s", qPrintable(styleOverride),
qPrintable(QStyleFactory::keys().join(QLatin1String(", ")))); qPrintable(QStyleFactory::keys().join(", "_L1)));
} }
} }

View File

@ -62,6 +62,8 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
/*! /*!
\class QToolTip \class QToolTip
@ -372,7 +374,7 @@ void QTipLabel::placeTip(const QPoint &pos, QWidget *w)
//the stylesheet need to know the real parent //the stylesheet need to know the real parent
QTipLabel::instance->setProperty("_q_stylesheet_parent", QVariant::fromValue(w)); QTipLabel::instance->setProperty("_q_stylesheet_parent", QVariant::fromValue(w));
//we force the style to be the QStyleSheetStyle, and force to clear the cache as well. //we force the style to be the QStyleSheetStyle, and force to clear the cache as well.
QTipLabel::instance->setStyleSheet(QLatin1String("/* */")); QTipLabel::instance->setStyleSheet("/* */"_L1);
// Set up for cleaning up this later... // Set up for cleaning up this later...
QTipLabel::instance->styleSheetParent = w; QTipLabel::instance->styleSheetParent = w;
@ -492,7 +494,7 @@ void QToolTip::showText(const QPoint &pos, const QString &text, QWidget *w, cons
QWidgetPrivate::get(QTipLabel::instance)->setScreen(QTipLabel::getTipScreen(pos, w)); QWidgetPrivate::get(QTipLabel::instance)->setScreen(QTipLabel::getTipScreen(pos, w));
QTipLabel::instance->setTipRect(w, rect); QTipLabel::instance->setTipRect(w, rect);
QTipLabel::instance->placeTip(pos, w); QTipLabel::instance->placeTip(pos, w);
QTipLabel::instance->setObjectName(QLatin1String("qtooltip_label")); QTipLabel::instance->setObjectName("qtooltip_label"_L1);
#if QT_CONFIG(effects) #if QT_CONFIG(effects)
if (QApplication::isEffectEnabled(Qt::UI_FadeTooltip)) if (QApplication::isEffectEnabled(Qt::UI_FadeTooltip))

View File

@ -119,6 +119,7 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
using namespace QNativeInterface::Private; using namespace QNativeInterface::Private;
using namespace Qt::StringLiterals;
Q_LOGGING_CATEGORY(lcWidgetPainting, "qt.widgets.painting", QtWarningMsg); Q_LOGGING_CATEGORY(lcWidgetPainting, "qt.widgets.painting", QtWarningMsg);
@ -6021,7 +6022,7 @@ QString QWidget::windowTitle() const
if (!d->extra->topextra->caption.isEmpty()) if (!d->extra->topextra->caption.isEmpty())
return d->extra->topextra->caption; return d->extra->topextra->caption;
if (!d->extra->topextra->filePath.isEmpty()) if (!d->extra->topextra->filePath.isEmpty())
return QFileInfo(d->extra->topextra->filePath).fileName() + QLatin1String("[*]"); return QFileInfo(d->extra->topextra->filePath).fileName() + "[*]"_L1;
} }
return QString(); return QString();
} }
@ -6045,7 +6046,7 @@ QString qt_setWindowTitle_helperHelper(const QString &title, const QWidget *widg
if (cap.isEmpty()) if (cap.isEmpty())
return cap; return cap;
QLatin1String placeHolder("[*]"); const auto placeHolder = "[*]"_L1;
int index = cap.indexOf(placeHolder); int index = cap.indexOf(placeHolder);
// here the magic begins // here the magic begins
@ -6069,7 +6070,7 @@ QString qt_setWindowTitle_helperHelper(const QString &title, const QWidget *widg
index = cap.indexOf(placeHolder, index); index = cap.indexOf(placeHolder, index);
} }
cap.replace(QLatin1String("[*][*]"), placeHolder); cap.replace("[*][*]"_L1, placeHolder);
return cap; return cap;
} }
@ -11456,7 +11457,7 @@ void QWidgetPrivate::setWindowModified_helper()
return; return;
bool on = q->testAttribute(Qt::WA_WindowModified); bool on = q->testAttribute(Qt::WA_WindowModified);
if (!platformWindow->setWindowModified(on)) { if (!platformWindow->setWindowModified(on)) {
if (Q_UNLIKELY(on && !q->windowTitle().contains(QLatin1String("[*]")))) if (Q_UNLIKELY(on && !q->windowTitle().contains("[*]"_L1)))
qWarning("QWidget::setWindowModified: The window title does not contain a '[*]' placeholder"); qWarning("QWidget::setWindowModified: The window title does not contain a '[*]' placeholder");
setWindowTitle_helper(q->windowTitle()); setWindowTitle_helper(q->windowTitle());
setWindowIconText_helper(q->windowIconText()); setWindowIconText_helper(q->windowIconText());

View File

@ -55,6 +55,8 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
Q_WIDGETS_EXPORT extern bool qt_tab_all_widgets(); Q_WIDGETS_EXPORT extern bool qt_tab_all_widgets();
Q_WIDGETS_EXPORT QWidget *qt_button_down = nullptr; // widget got last button-down Q_WIDGETS_EXPORT QWidget *qt_button_down = nullptr; // widget got last button-down
@ -1159,8 +1161,8 @@ void QWidgetWindow::updateObjectName()
{ {
QString name = m_widget->objectName(); QString name = m_widget->objectName();
if (name.isEmpty()) if (name.isEmpty())
name = QString::fromUtf8(m_widget->metaObject()->className()) + QLatin1String("Class"); name = QString::fromUtf8(m_widget->metaObject()->className()) + "Class"_L1;
name += QLatin1String("Window"); name += "Window"_L1;
setObjectName(name); setObjectName(name);
} }

View File

@ -52,6 +52,8 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
class QWindowContainerPrivate : public QWidgetPrivate class QWindowContainerPrivate : public QWidgetPrivate
{ {
public: public:
@ -222,7 +224,7 @@ QWindowContainer::QWindowContainer(QWindow *embeddedWindow, QWidget *parent, Qt:
QString windowName = d->window->objectName(); QString windowName = d->window->objectName();
if (windowName.isEmpty()) if (windowName.isEmpty())
windowName = QString::fromUtf8(d->window->metaObject()->className()); windowName = QString::fromUtf8(d->window->metaObject()->className());
d->fakeParent.setObjectName(windowName + QLatin1String("ContainerFakeParent")); d->fakeParent.setObjectName(windowName + "ContainerFakeParent"_L1);
d->window->setParent(&d->fakeParent); d->window->setParent(&d->fakeParent);
d->window->setFlag(Qt::SubWindow); d->window->setFlag(Qt::SubWindow);

View File

@ -121,6 +121,8 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
static qreal qt_getDevicePixelRatio(const QWidget *widget) static qreal qt_getDevicePixelRatio(const QWidget *widget)
{ {
return widget ? widget->devicePixelRatio() : qApp->devicePixelRatio(); return widget ? widget->devicePixelRatio() : qApp->devicePixelRatio();
@ -732,7 +734,7 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q
QRect r = opt->rect; QRect r = opt->rect;
int size = qMin(r.height(), r.width()); int size = qMin(r.height(), r.width());
QPixmap pixmap; QPixmap pixmap;
QString pixmapName = QStyleHelper::uniqueName(QLatin1String("$qt_ia-") QString pixmapName = QStyleHelper::uniqueName("$qt_ia-"_L1
% QLatin1String(metaObject()->className()), opt, QSize(size, size)) % QLatin1String(metaObject()->className()), opt, QSize(size, size))
% HexString<uint>(pe); % HexString<uint>(pe);
if (!QPixmapCache::find(pixmapName, &pixmap)) { if (!QPixmapCache::find(pixmapName, &pixmap)) {
@ -2586,7 +2588,7 @@ QRect QCommonStyle::subElementRect(SubElement sr, const QStyleOption *opt,
const bool vertical = !(pb->state & QStyle::State_Horizontal); const bool vertical = !(pb->state & QStyle::State_Horizontal);
if (!vertical) { if (!vertical) {
if (pb->textVisible) if (pb->textVisible)
textw = qMax(pb->fontMetrics.horizontalAdvance(pb->text), pb->fontMetrics.horizontalAdvance(QLatin1String("100%"))) + 6; textw = qMax(pb->fontMetrics.horizontalAdvance(pb->text), pb->fontMetrics.horizontalAdvance("100%"_L1)) + 6;
} }
if ((pb->textAlignment & Qt::AlignCenter) == 0) { if ((pb->textAlignment & Qt::AlignCenter) == 0) {
@ -5468,145 +5470,139 @@ QPixmap QCommonStyle::standardPixmap(StandardPixmap sp, const QStyleOption *opti
switch (sp) { switch (sp) {
case SP_DialogYesButton: case SP_DialogYesButton:
case SP_DialogOkButton: case SP_DialogOkButton:
pixmap = QIcon::fromTheme(QLatin1String("dialog-ok")).pixmap(16); pixmap = QIcon::fromTheme("dialog-ok"_L1).pixmap(16);
break; break;
case SP_DialogApplyButton: case SP_DialogApplyButton:
pixmap = QIcon::fromTheme(QLatin1String("dialog-ok-apply")).pixmap(16); pixmap = QIcon::fromTheme("dialog-ok-apply"_L1).pixmap(16);
break; break;
case SP_DialogDiscardButton: case SP_DialogDiscardButton:
pixmap = QIcon::fromTheme(QLatin1String("edit-delete")).pixmap(16); pixmap = QIcon::fromTheme("edit-delete"_L1).pixmap(16);
break; break;
case SP_DialogCloseButton: case SP_DialogCloseButton:
pixmap = QIcon::fromTheme(QLatin1String("dialog-close")).pixmap(16); pixmap = QIcon::fromTheme("dialog-close"_L1).pixmap(16);
break; break;
case SP_DirHomeIcon: case SP_DirHomeIcon:
pixmap = QIcon::fromTheme(QLatin1String("user-home")).pixmap(16); pixmap = QIcon::fromTheme("user-home"_L1).pixmap(16);
break; break;
case SP_MessageBoxInformation: case SP_MessageBoxInformation:
pixmap = QIcon::fromTheme(QLatin1String("messagebox_info")).pixmap(16); pixmap = QIcon::fromTheme("messagebox_info"_L1).pixmap(16);
break; break;
case SP_MessageBoxWarning: case SP_MessageBoxWarning:
pixmap = QIcon::fromTheme(QLatin1String("messagebox_warning")).pixmap(16); pixmap = QIcon::fromTheme("messagebox_warning"_L1).pixmap(16);
break; break;
case SP_MessageBoxCritical: case SP_MessageBoxCritical:
pixmap = QIcon::fromTheme(QLatin1String("messagebox_critical")).pixmap(16); pixmap = QIcon::fromTheme("messagebox_critical"_L1).pixmap(16);
break; break;
case SP_MessageBoxQuestion: case SP_MessageBoxQuestion:
pixmap = QIcon::fromTheme(QLatin1String("help")).pixmap(16); pixmap = QIcon::fromTheme("help"_L1).pixmap(16);
break; break;
case SP_DialogOpenButton: case SP_DialogOpenButton:
case SP_DirOpenIcon: case SP_DirOpenIcon:
pixmap = QIcon::fromTheme(QLatin1String("folder-open")).pixmap(16); pixmap = QIcon::fromTheme("folder-open"_L1).pixmap(16);
break; break;
case SP_FileIcon: case SP_FileIcon:
pixmap = QIcon::fromTheme(QLatin1String("text-x-generic"), pixmap = QIcon::fromTheme("text-x-generic"_L1, QIcon::fromTheme("empty"_L1)).pixmap(16);
QIcon::fromTheme(QLatin1String("empty"))).pixmap(16);
break; break;
case SP_DirClosedIcon: case SP_DirClosedIcon:
case SP_DirIcon: case SP_DirIcon:
pixmap = QIcon::fromTheme(QLatin1String("folder")).pixmap(16); pixmap = QIcon::fromTheme("folder"_L1).pixmap(16);
break; break;
case SP_DriveFDIcon: case SP_DriveFDIcon:
pixmap = QIcon::fromTheme(QLatin1String("media-floppy"), pixmap = QIcon::fromTheme("media-floppy"_L1,
QIcon::fromTheme(QLatin1String("3floppy_unmount"))).pixmap(16); QIcon::fromTheme("3floppy_unmount"_L1)).pixmap(16);
break; break;
case SP_ComputerIcon: case SP_ComputerIcon:
pixmap = QIcon::fromTheme(QLatin1String("computer"), pixmap = QIcon::fromTheme("computer"_L1, QIcon::fromTheme("system"_L1)).pixmap(16);
QIcon::fromTheme(QLatin1String("system"))).pixmap(16);
break; break;
case SP_DesktopIcon: case SP_DesktopIcon:
pixmap = QIcon::fromTheme(QLatin1String("user-desktop"), pixmap = QIcon::fromTheme("user-desktop"_L1,
QIcon::fromTheme(QLatin1String("desktop"))).pixmap(16); QIcon::fromTheme("desktop"_L1)).pixmap(16);
break; break;
case SP_TrashIcon: case SP_TrashIcon:
pixmap = QIcon::fromTheme(QLatin1String("user-trash"), pixmap = QIcon::fromTheme("user-trash"_L1,
QIcon::fromTheme(QLatin1String("trashcan_empty"))).pixmap(16); QIcon::fromTheme("trashcan_empty"_L1)).pixmap(16);
break; break;
case SP_DriveCDIcon: case SP_DriveCDIcon:
case SP_DriveDVDIcon: case SP_DriveDVDIcon:
pixmap = QIcon::fromTheme(QLatin1String("media-optical"), pixmap = QIcon::fromTheme("media-optical"_L1,
QIcon::fromTheme(QLatin1String("cdrom_unmount"))).pixmap(16); QIcon::fromTheme("cdrom_unmount"_L1)).pixmap(16);
break; break;
case SP_DriveHDIcon: case SP_DriveHDIcon:
pixmap = QIcon::fromTheme(QLatin1String("drive-harddisk"), pixmap = QIcon::fromTheme("drive-harddisk"_L1,
QIcon::fromTheme(QLatin1String("hdd_unmount"))).pixmap(16); QIcon::fromTheme("hdd_unmount"_L1)).pixmap(16);
break; break;
case SP_FileDialogToParent: case SP_FileDialogToParent:
pixmap = QIcon::fromTheme(QLatin1String("go-up"), pixmap = QIcon::fromTheme("go-up"_L1, QIcon::fromTheme("up"_L1)).pixmap(16);
QIcon::fromTheme(QLatin1String("up"))).pixmap(16);
break; break;
case SP_FileDialogNewFolder: case SP_FileDialogNewFolder:
pixmap = QIcon::fromTheme(QLatin1String("folder_new")).pixmap(16); pixmap = QIcon::fromTheme("folder_new"_L1).pixmap(16);
break; break;
case SP_ArrowUp: case SP_ArrowUp:
pixmap = QIcon::fromTheme(QLatin1String("go-up"), pixmap = QIcon::fromTheme("go-up"_L1,
QIcon::fromTheme(QLatin1String("up"))).pixmap(16); QIcon::fromTheme("up"_L1)).pixmap(16);
break; break;
case SP_ArrowDown: case SP_ArrowDown:
pixmap = QIcon::fromTheme(QLatin1String("go-down"), pixmap = QIcon::fromTheme("go-down"_L1, QIcon::fromTheme("down"_L1)).pixmap(16);
QIcon::fromTheme(QLatin1String("down"))).pixmap(16);
break; break;
case SP_ArrowRight: case SP_ArrowRight:
pixmap = QIcon::fromTheme(QLatin1String("go-next"), pixmap = QIcon::fromTheme("go-next"_L1, QIcon::fromTheme("forward"_L1)).pixmap(16);
QIcon::fromTheme(QLatin1String("forward"))).pixmap(16);
break; break;
case SP_ArrowLeft: case SP_ArrowLeft:
pixmap = QIcon::fromTheme(QLatin1String("go-previous"), pixmap = QIcon::fromTheme("go-previous"_L1, QIcon::fromTheme("back"_L1)).pixmap(16);
QIcon::fromTheme(QLatin1String("back"))).pixmap(16);
break; break;
case SP_FileDialogDetailedView: case SP_FileDialogDetailedView:
pixmap = QIcon::fromTheme(QLatin1String("view_detailed")).pixmap(16); pixmap = QIcon::fromTheme("view_detailed"_L1).pixmap(16);
break; break;
case SP_FileDialogListView: case SP_FileDialogListView:
pixmap = QIcon::fromTheme(QLatin1String("view_icon")).pixmap(16); pixmap = QIcon::fromTheme("view_icon"_L1).pixmap(16);
break; break;
case SP_BrowserReload: case SP_BrowserReload:
pixmap = QIcon::fromTheme(QLatin1String("reload")).pixmap(16); pixmap = QIcon::fromTheme("reload"_L1).pixmap(16);
break; break;
case SP_BrowserStop: case SP_BrowserStop:
pixmap = QIcon::fromTheme(QLatin1String("process-stop")).pixmap(16); pixmap = QIcon::fromTheme("process-stop"_L1).pixmap(16);
break; break;
case SP_MediaPlay: case SP_MediaPlay:
pixmap = QIcon::fromTheme(QLatin1String("media-playback-start")).pixmap(16); pixmap = QIcon::fromTheme("media-playback-start"_L1).pixmap(16);
break; break;
case SP_MediaPause: case SP_MediaPause:
pixmap = QIcon::fromTheme(QLatin1String("media-playback-pause")).pixmap(16); pixmap = QIcon::fromTheme("media-playback-pause"_L1).pixmap(16);
break; break;
case SP_MediaStop: case SP_MediaStop:
pixmap = QIcon::fromTheme(QLatin1String("media-playback-stop")).pixmap(16); pixmap = QIcon::fromTheme("media-playback-stop"_L1).pixmap(16);
break; break;
case SP_MediaSeekForward: case SP_MediaSeekForward:
pixmap = QIcon::fromTheme(QLatin1String("media-seek-forward")).pixmap(16); pixmap = QIcon::fromTheme("media-seek-forward"_L1).pixmap(16);
break; break;
case SP_MediaSeekBackward: case SP_MediaSeekBackward:
pixmap = QIcon::fromTheme(QLatin1String("media-seek-backward")).pixmap(16); pixmap = QIcon::fromTheme("media-seek-backward"_L1).pixmap(16);
break; break;
case SP_MediaSkipForward: case SP_MediaSkipForward:
pixmap = QIcon::fromTheme(QLatin1String("media-skip-forward")).pixmap(16); pixmap = QIcon::fromTheme("media-skip-forward"_L1).pixmap(16);
break; break;
case SP_MediaSkipBackward: case SP_MediaSkipBackward:
pixmap = QIcon::fromTheme(QLatin1String("media-skip-backward")).pixmap(16); pixmap = QIcon::fromTheme("media-skip-backward"_L1).pixmap(16);
break; break;
case SP_DialogResetButton: case SP_DialogResetButton:
pixmap = QIcon::fromTheme(QLatin1String("edit-clear")).pixmap(24); pixmap = QIcon::fromTheme("edit-clear"_L1).pixmap(24);
break; break;
case SP_DialogHelpButton: case SP_DialogHelpButton:
pixmap = QIcon::fromTheme(QLatin1String("help-contents")).pixmap(24); pixmap = QIcon::fromTheme("help-contents"_L1).pixmap(24);
break; break;
case SP_DialogNoButton: case SP_DialogNoButton:
case SP_DialogCancelButton: case SP_DialogCancelButton:
pixmap = QIcon::fromTheme(QLatin1String("dialog-cancel"), pixmap = QIcon::fromTheme("dialog-cancel"_L1,
QIcon::fromTheme(QLatin1String("process-stop"))).pixmap(24); QIcon::fromTheme("process-stop"_L1)).pixmap(24);
break; break;
case SP_DialogSaveButton: case SP_DialogSaveButton:
pixmap = QIcon::fromTheme(QLatin1String("document-save")).pixmap(24); pixmap = QIcon::fromTheme("document-save"_L1).pixmap(24);
break; break;
case SP_FileLinkIcon: case SP_FileLinkIcon:
pixmap = QIcon::fromTheme(QLatin1String("emblem-symbolic-link")).pixmap(16); pixmap = QIcon::fromTheme("emblem-symbolic-link"_L1).pixmap(16);
if (!pixmap.isNull()) { if (!pixmap.isNull()) {
QPixmap fileIcon = QIcon::fromTheme(QLatin1String("text-x-generic")).pixmap(16); QPixmap fileIcon = QIcon::fromTheme("text-x-generic"_L1).pixmap(16);
if (fileIcon.isNull()) if (fileIcon.isNull())
fileIcon = QIcon::fromTheme(QLatin1String("empty")).pixmap(16); fileIcon = QIcon::fromTheme("empty"_L1).pixmap(16);
if (!fileIcon.isNull()) { if (!fileIcon.isNull()) {
QPainter painter(&fileIcon); QPainter painter(&fileIcon);
painter.drawPixmap(0, 0, 16, 16, pixmap); painter.drawPixmap(0, 0, 16, 16, pixmap);
@ -5615,9 +5611,9 @@ QPixmap QCommonStyle::standardPixmap(StandardPixmap sp, const QStyleOption *opti
} }
break; break;
case SP_DirLinkIcon: case SP_DirLinkIcon:
pixmap = QIcon::fromTheme(QLatin1String("emblem-symbolic-link")).pixmap(16); pixmap = QIcon::fromTheme("emblem-symbolic-link"_L1).pixmap(16);
if (!pixmap.isNull()) { if (!pixmap.isNull()) {
QPixmap dirIcon = QIcon::fromTheme(QLatin1String("folder")).pixmap(16); QPixmap dirIcon = QIcon::fromTheme("folder"_L1).pixmap(16);
if (!dirIcon.isNull()) { if (!dirIcon.isNull()) {
QPainter painter(&dirIcon); QPainter painter(&dirIcon);
painter.drawPixmap(0, 0, 16, 16, pixmap); painter.drawPixmap(0, 0, 16, 16, pixmap);
@ -5663,103 +5659,103 @@ QPixmap QCommonStyle::standardPixmap(StandardPixmap sp, const QStyleOption *opti
return proxy()->standardPixmap(SP_ArrowRight, option, widget); return proxy()->standardPixmap(SP_ArrowRight, option, widget);
return proxy()->standardPixmap(SP_ArrowLeft, option, widget); return proxy()->standardPixmap(SP_ArrowLeft, option, widget);
case SP_ArrowLeft: case SP_ArrowLeft:
return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/left-16.png")); return QPixmap(":/qt-project.org/styles/commonstyle/images/left-16.png"_L1);
case SP_ArrowRight: case SP_ArrowRight:
return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/right-16.png")); return QPixmap(":/qt-project.org/styles/commonstyle/images/right-16.png"_L1);
case SP_ArrowUp: case SP_ArrowUp:
return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/up-16.png")); return QPixmap(":/qt-project.org/styles/commonstyle/images/up-16.png"_L1);
case SP_ArrowDown: case SP_ArrowDown:
return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/down-16.png")); return QPixmap(":/qt-project.org/styles/commonstyle/images/down-16.png"_L1);
case SP_FileDialogToParent: case SP_FileDialogToParent:
return proxy()->standardPixmap(SP_ArrowUp, option, widget); return proxy()->standardPixmap(SP_ArrowUp, option, widget);
case SP_FileDialogNewFolder: case SP_FileDialogNewFolder:
return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/newdirectory-16.png")); return QPixmap(":/qt-project.org/styles/commonstyle/images/newdirectory-16.png"_L1);
case SP_FileDialogDetailedView: case SP_FileDialogDetailedView:
return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/viewdetailed-16.png")); return QPixmap(":/qt-project.org/styles/commonstyle/images/viewdetailed-16.png"_L1);
case SP_FileDialogInfoView: case SP_FileDialogInfoView:
return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/fileinfo-16.png")); return QPixmap(":/qt-project.org/styles/commonstyle/images/fileinfo-16.png"_L1);
case SP_FileDialogContentsView: case SP_FileDialogContentsView:
return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/filecontents-16.png")); return QPixmap(":/qt-project.org/styles/commonstyle/images/filecontents-16.png"_L1);
case SP_FileDialogListView: case SP_FileDialogListView:
return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/viewlist-16.png")); return QPixmap(":/qt-project.org/styles/commonstyle/images/viewlist-16.png"_L1);
case SP_FileDialogBack: case SP_FileDialogBack:
return proxy()->standardPixmap(SP_ArrowBack, option, widget); return proxy()->standardPixmap(SP_ArrowBack, option, widget);
case SP_DriveHDIcon: case SP_DriveHDIcon:
return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/harddrive-16.png")); return QPixmap(":/qt-project.org/styles/commonstyle/images/harddrive-16.png"_L1);
case SP_TrashIcon: case SP_TrashIcon:
return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/trash-16.png")); return QPixmap(":/qt-project.org/styles/commonstyle/images/trash-16.png"_L1);
case SP_DriveFDIcon: case SP_DriveFDIcon:
return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/floppy-16.png")); return QPixmap(":/qt-project.org/styles/commonstyle/images/floppy-16.png"_L1);
case SP_DriveNetIcon: case SP_DriveNetIcon:
return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/networkdrive-16.png")); return QPixmap(":/qt-project.org/styles/commonstyle/images/networkdrive-16.png"_L1);
case SP_DesktopIcon: case SP_DesktopIcon:
return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/desktop-16.png")); return QPixmap(":/qt-project.org/styles/commonstyle/images/desktop-16.png"_L1);
case SP_ComputerIcon: case SP_ComputerIcon:
return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/computer-16.png")); return QPixmap(":/qt-project.org/styles/commonstyle/images/computer-16.png"_L1);
case SP_DriveCDIcon: case SP_DriveCDIcon:
return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/cdr-16.png")); return QPixmap(":/qt-project.org/styles/commonstyle/images/cdr-16.png"_L1);
case SP_DriveDVDIcon: case SP_DriveDVDIcon:
return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/dvd-16.png")); return QPixmap(":/qt-project.org/styles/commonstyle/images/dvd-16.png"_L1);
case SP_DirHomeIcon: case SP_DirHomeIcon:
case SP_DirOpenIcon: case SP_DirOpenIcon:
return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/diropen-16.png")); return QPixmap(":/qt-project.org/styles/commonstyle/images/diropen-16.png"_L1);
case SP_DirIcon: case SP_DirIcon:
case SP_DirClosedIcon: case SP_DirClosedIcon:
return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/dirclosed-16.png")); return QPixmap(":/qt-project.org/styles/commonstyle/images/dirclosed-16.png"_L1);
case SP_DirLinkIcon: case SP_DirLinkIcon:
return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/dirlink-16.png")); return QPixmap(":/qt-project.org/styles/commonstyle/images/dirlink-16.png"_L1);
case SP_FileIcon: case SP_FileIcon:
return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/file-16.png")); return QPixmap(":/qt-project.org/styles/commonstyle/images/file-16.png"_L1);
case SP_FileLinkIcon: case SP_FileLinkIcon:
return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/filelink-16.png")); return QPixmap(":/qt-project.org/styles/commonstyle/images/filelink-16.png"_L1);
case SP_DialogOkButton: case SP_DialogOkButton:
return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-ok-16.png")); return QPixmap(":/qt-project.org/styles/commonstyle/images/standardbutton-ok-16.png"_L1);
case SP_DialogCancelButton: case SP_DialogCancelButton:
return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-cancel-16.png")); return QPixmap(":/qt-project.org/styles/commonstyle/images/standardbutton-cancel-16.png"_L1);
case SP_DialogHelpButton: case SP_DialogHelpButton:
return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-help-16.png")); return QPixmap(":/qt-project.org/styles/commonstyle/images/standardbutton-help-16.png"_L1);
case SP_DialogOpenButton: case SP_DialogOpenButton:
return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-open-16.png")); return QPixmap(":/qt-project.org/styles/commonstyle/images/standardbutton-open-16.png"_L1);
case SP_DialogSaveButton: case SP_DialogSaveButton:
return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-save-16.png")); return QPixmap(":/qt-project.org/styles/commonstyle/images/standardbutton-save-16.png"_L1);
case SP_DialogCloseButton: case SP_DialogCloseButton:
return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-close-16.png")); return QPixmap(":/qt-project.org/styles/commonstyle/images/standardbutton-close-16.png"_L1);
case SP_DialogApplyButton: case SP_DialogApplyButton:
return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-apply-16.png")); return QPixmap(":/qt-project.org/styles/commonstyle/images/standardbutton-apply-16.png"_L1);
case SP_DialogResetButton: case SP_DialogResetButton:
return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-clear-16.png")); return QPixmap(":/qt-project.org/styles/commonstyle/images/standardbutton-clear-16.png"_L1);
case SP_DialogDiscardButton: case SP_DialogDiscardButton:
return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-delete-16.png")); return QPixmap(":/qt-project.org/styles/commonstyle/images/standardbutton-delete-16.png"_L1);
case SP_DialogYesButton: case SP_DialogYesButton:
return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-yes-16.png")); return QPixmap(":/qt-project.org/styles/commonstyle/images/standardbutton-yes-16.png"_L1);
case SP_DialogNoButton: case SP_DialogNoButton:
return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-no-16.png")); return QPixmap(":/qt-project.org/styles/commonstyle/images/standardbutton-no-16.png"_L1);
case SP_BrowserReload: case SP_BrowserReload:
return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/refresh-24.png")); return QPixmap(":/qt-project.org/styles/commonstyle/images/refresh-24.png"_L1);
case SP_BrowserStop: case SP_BrowserStop:
return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/stop-24.png")); return QPixmap(":/qt-project.org/styles/commonstyle/images/stop-24.png"_L1);
case SP_MediaPlay: case SP_MediaPlay:
return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-play-32.png")); return QPixmap(":/qt-project.org/styles/commonstyle/images/media-play-32.png"_L1);
case SP_MediaPause: case SP_MediaPause:
return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-pause-32.png")); return QPixmap(":/qt-project.org/styles/commonstyle/images/media-pause-32.png"_L1);
case SP_MediaStop: case SP_MediaStop:
return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-stop-32.png")); return QPixmap(":/qt-project.org/styles/commonstyle/images/media-stop-32.png"_L1);
case SP_MediaSeekForward: case SP_MediaSeekForward:
return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-seek-forward-32.png")); return QPixmap(":/qt-project.org/styles/commonstyle/images/media-seek-forward-32.png"_L1);
case SP_MediaSeekBackward: case SP_MediaSeekBackward:
return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-seek-backward-32.png")); return QPixmap(":/qt-project.org/styles/commonstyle/images/media-seek-backward-32.png"_L1);
case SP_MediaSkipForward: case SP_MediaSkipForward:
return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-skip-forward-32.png")); return QPixmap(":/qt-project.org/styles/commonstyle/images/media-skip-forward-32.png"_L1);
case SP_MediaSkipBackward: case SP_MediaSkipBackward:
return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-skip-backward-32.png")); return QPixmap(":/qt-project.org/styles/commonstyle/images/media-skip-backward-32.png"_L1);
case SP_MediaVolume: case SP_MediaVolume:
return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-volume-16.png")); return QPixmap(":/qt-project.org/styles/commonstyle/images/media-volume-16.png"_L1);
case SP_MediaVolumeMuted: case SP_MediaVolumeMuted:
return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-volume-muted-16.png")); return QPixmap(":/qt-project.org/styles/commonstyle/images/media-volume-muted-16.png"_L1);
case SP_LineEditClearButton: case SP_LineEditClearButton:
return QPixmap(clearText16IconPath()); return QPixmap(clearText16IconPath());
case SP_TabCloseButton: case SP_TabCloseButton:
return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-closetab-16.png")); return QPixmap(":/qt-project.org/styles/commonstyle/images/standardbutton-closetab-16.png"_L1);
#endif // QT_NO_IMAGEFORMAT_PNG #endif // QT_NO_IMAGEFORMAT_PNG
default: default:
break; break;
@ -5883,134 +5879,132 @@ QIcon QCommonStyle::standardIcon(StandardPixmap standardIcon, const QStyleOption
if (QGuiApplication::desktopSettingsAware() && !QIcon::themeName().isEmpty()) { if (QGuiApplication::desktopSettingsAware() && !QIcon::themeName().isEmpty()) {
switch (standardIcon) { switch (standardIcon) {
case SP_DirHomeIcon: case SP_DirHomeIcon:
icon = QIcon::fromTheme(QLatin1String("user-home")); icon = QIcon::fromTheme("user-home"_L1);
break; break;
case SP_MessageBoxInformation: case SP_MessageBoxInformation:
icon = QIcon::fromTheme(QLatin1String("dialog-information")); icon = QIcon::fromTheme("dialog-information"_L1);
break; break;
case SP_MessageBoxWarning: case SP_MessageBoxWarning:
icon = QIcon::fromTheme(QLatin1String("dialog-warning")); icon = QIcon::fromTheme("dialog-warning"_L1);
break; break;
case SP_MessageBoxCritical: case SP_MessageBoxCritical:
icon = QIcon::fromTheme(QLatin1String("dialog-error")); icon = QIcon::fromTheme("dialog-error"_L1);
break; break;
case SP_MessageBoxQuestion: case SP_MessageBoxQuestion:
icon = QIcon::fromTheme(QLatin1String("dialog-question")); icon = QIcon::fromTheme("dialog-question"_L1);
break; break;
case SP_DialogOpenButton: case SP_DialogOpenButton:
case SP_DirOpenIcon: case SP_DirOpenIcon:
icon = QIcon::fromTheme(QLatin1String("folder-open")); icon = QIcon::fromTheme("folder-open"_L1);
break; break;
case SP_DialogSaveButton: case SP_DialogSaveButton:
icon = QIcon::fromTheme(QLatin1String("document-save")); icon = QIcon::fromTheme("document-save"_L1);
break; break;
case SP_DialogApplyButton: case SP_DialogApplyButton:
icon = QIcon::fromTheme(QLatin1String("dialog-ok-apply")); icon = QIcon::fromTheme("dialog-ok-apply"_L1);
break; break;
case SP_DialogYesButton: case SP_DialogYesButton:
case SP_DialogOkButton: case SP_DialogOkButton:
icon = QIcon::fromTheme(QLatin1String("dialog-ok")); icon = QIcon::fromTheme("dialog-ok"_L1);
break; break;
case SP_DialogDiscardButton: case SP_DialogDiscardButton:
icon = QIcon::fromTheme(QLatin1String("edit-delete")); icon = QIcon::fromTheme("edit-delete"_L1);
break; break;
case SP_DialogResetButton: case SP_DialogResetButton:
icon = QIcon::fromTheme(QLatin1String("edit-clear")); icon = QIcon::fromTheme("edit-clear"_L1);
break; break;
case SP_DialogHelpButton: case SP_DialogHelpButton:
icon = QIcon::fromTheme(QLatin1String("help-contents")); icon = QIcon::fromTheme("help-contents"_L1);
break; break;
case SP_FileIcon: case SP_FileIcon:
icon = QIcon::fromTheme(QLatin1String("text-x-generic")); icon = QIcon::fromTheme("text-x-generic"_L1);
break; break;
case SP_DirClosedIcon: case SP_DirClosedIcon:
case SP_DirIcon: case SP_DirIcon:
icon = QIcon::fromTheme(QLatin1String("folder")); icon = QIcon::fromTheme("folder"_L1);
break; break;
case SP_DriveFDIcon: case SP_DriveFDIcon:
icon = QIcon::fromTheme(QLatin1String("floppy_unmount")); icon = QIcon::fromTheme("floppy_unmount"_L1);
break; break;
case SP_ComputerIcon: case SP_ComputerIcon:
icon = QIcon::fromTheme(QLatin1String("computer"), icon = QIcon::fromTheme("computer"_L1, QIcon::fromTheme("system"_L1));
QIcon::fromTheme(QLatin1String("system")));
break; break;
case SP_DesktopIcon: case SP_DesktopIcon:
icon = QIcon::fromTheme(QLatin1String("user-desktop")); icon = QIcon::fromTheme("user-desktop"_L1);
break; break;
case SP_TrashIcon: case SP_TrashIcon:
icon = QIcon::fromTheme(QLatin1String("user-trash")); icon = QIcon::fromTheme("user-trash"_L1);
break; break;
case SP_DriveCDIcon: case SP_DriveCDIcon:
case SP_DriveDVDIcon: case SP_DriveDVDIcon:
icon = QIcon::fromTheme(QLatin1String("media-optical")); icon = QIcon::fromTheme("media-optical"_L1);
break; break;
case SP_DriveHDIcon: case SP_DriveHDIcon:
icon = QIcon::fromTheme(QLatin1String("drive-harddisk")); icon = QIcon::fromTheme("drive-harddisk"_L1);
break; break;
case SP_FileDialogToParent: case SP_FileDialogToParent:
icon = QIcon::fromTheme(QLatin1String("go-up")); icon = QIcon::fromTheme("go-up"_L1);
break; break;
case SP_FileDialogNewFolder: case SP_FileDialogNewFolder:
icon = QIcon::fromTheme(QLatin1String("folder-new")); icon = QIcon::fromTheme("folder-new"_L1);
break; break;
case SP_ArrowUp: case SP_ArrowUp:
icon = QIcon::fromTheme(QLatin1String("go-up")); icon = QIcon::fromTheme("go-up"_L1);
break; break;
case SP_ArrowDown: case SP_ArrowDown:
icon = QIcon::fromTheme(QLatin1String("go-down")); icon = QIcon::fromTheme("go-down"_L1);
break; break;
case SP_ArrowRight: case SP_ArrowRight:
icon = QIcon::fromTheme(QLatin1String("go-next")); icon = QIcon::fromTheme("go-next"_L1);
break; break;
case SP_ArrowLeft: case SP_ArrowLeft:
icon = QIcon::fromTheme(QLatin1String("go-previous")); icon = QIcon::fromTheme("go-previous"_L1);
break; break;
case SP_DialogNoButton: case SP_DialogNoButton:
case SP_DialogCancelButton: case SP_DialogCancelButton:
icon = QIcon::fromTheme(QLatin1String("dialog-cancel"), icon = QIcon::fromTheme("dialog-cancel"_L1, QIcon::fromTheme("process-stop"_L1));
QIcon::fromTheme(QLatin1String("process-stop")));
break; break;
case SP_DialogCloseButton: case SP_DialogCloseButton:
icon = QIcon::fromTheme(QLatin1String("window-close")); icon = QIcon::fromTheme("window-close"_L1);
break; break;
case SP_FileDialogDetailedView: case SP_FileDialogDetailedView:
icon = QIcon::fromTheme(QLatin1String("view-list-details")); icon = QIcon::fromTheme("view-list-details"_L1);
break; break;
case SP_FileDialogListView: case SP_FileDialogListView:
icon = QIcon::fromTheme(QLatin1String("view-list-icons")); icon = QIcon::fromTheme("view-list-icons"_L1);
break; break;
case SP_BrowserReload: case SP_BrowserReload:
icon = QIcon::fromTheme(QLatin1String("view-refresh")); icon = QIcon::fromTheme("view-refresh"_L1);
break; break;
case SP_BrowserStop: case SP_BrowserStop:
icon = QIcon::fromTheme(QLatin1String("process-stop")); icon = QIcon::fromTheme("process-stop"_L1);
break; break;
case SP_MediaPlay: case SP_MediaPlay:
icon = QIcon::fromTheme(QLatin1String("media-playback-start")); icon = QIcon::fromTheme("media-playback-start"_L1);
break; break;
case SP_MediaPause: case SP_MediaPause:
icon = QIcon::fromTheme(QLatin1String("media-playback-pause")); icon = QIcon::fromTheme("media-playback-pause"_L1);
break; break;
case SP_MediaStop: case SP_MediaStop:
icon = QIcon::fromTheme(QLatin1String("media-playback-stop")); icon = QIcon::fromTheme("media-playback-stop"_L1);
break; break;
case SP_MediaSeekForward: case SP_MediaSeekForward:
icon = QIcon::fromTheme(QLatin1String("media-seek-forward")); icon = QIcon::fromTheme("media-seek-forward"_L1);
break; break;
case SP_MediaSeekBackward: case SP_MediaSeekBackward:
icon = QIcon::fromTheme(QLatin1String("media-seek-backward")); icon = QIcon::fromTheme("media-seek-backward"_L1);
break; break;
case SP_MediaSkipForward: case SP_MediaSkipForward:
icon = QIcon::fromTheme(QLatin1String("media-skip-forward")); icon = QIcon::fromTheme("media-skip-forward"_L1);
break; break;
case SP_MediaSkipBackward: case SP_MediaSkipBackward:
icon = QIcon::fromTheme(QLatin1String("media-skip-backward")); icon = QIcon::fromTheme("media-skip-backward"_L1);
break; break;
case SP_MediaVolume: case SP_MediaVolume:
icon = QIcon::fromTheme(QLatin1String("audio-volume-medium")); icon = QIcon::fromTheme("audio-volume-medium"_L1);
break; break;
case SP_MediaVolumeMuted: case SP_MediaVolumeMuted:
icon = QIcon::fromTheme(QLatin1String("audio-volume-muted")); icon = QIcon::fromTheme("audio-volume-muted"_L1);
break; break;
case SP_ArrowForward: case SP_ArrowForward:
if (rtl) if (rtl)
@ -6022,7 +6016,7 @@ QIcon QCommonStyle::standardIcon(StandardPixmap standardIcon, const QStyleOption
return QCommonStyle::standardIcon(SP_ArrowLeft, option, widget); return QCommonStyle::standardIcon(SP_ArrowLeft, option, widget);
case SP_FileLinkIcon: case SP_FileLinkIcon:
{ {
QIcon linkIcon = QIcon::fromTheme(QLatin1String("emblem-symbolic-link")); QIcon linkIcon = QIcon::fromTheme("emblem-symbolic-link"_L1);
if (!linkIcon.isNull()) { if (!linkIcon.isNull()) {
QIcon baseIcon = QCommonStyle::standardIcon(SP_FileIcon, option, widget); QIcon baseIcon = QCommonStyle::standardIcon(SP_FileIcon, option, widget);
const QList<QSize> sizes = baseIcon.availableSizes(QIcon::Normal, QIcon::Off); const QList<QSize> sizes = baseIcon.availableSizes(QIcon::Normal, QIcon::Off);
@ -6039,7 +6033,7 @@ QIcon QCommonStyle::standardIcon(StandardPixmap standardIcon, const QStyleOption
break; break;
case SP_DirLinkIcon: case SP_DirLinkIcon:
{ {
QIcon linkIcon = QIcon::fromTheme(QLatin1String("emblem-symbolic-link")); QIcon linkIcon = QIcon::fromTheme("emblem-symbolic-link"_L1);
if (!linkIcon.isNull()) { if (!linkIcon.isNull()) {
QIcon baseIcon = QCommonStyle::standardIcon(SP_DirIcon, option, widget); QIcon baseIcon = QCommonStyle::standardIcon(SP_DirIcon, option, widget);
const QList<QSize> sizes = baseIcon.availableSizes(QIcon::Normal, QIcon::Off); const QList<QSize> sizes = baseIcon.availableSizes(QIcon::Normal, QIcon::Off);
@ -6114,7 +6108,7 @@ QIcon QCommonStyle::standardIcon(StandardPixmap standardIcon, const QStyleOption
const QList<QSize> sizes = theme->themeHint(QPlatformTheme::IconPixmapSizes).value<QList<QSize> >(); const QList<QSize> sizes = theme->themeHint(QPlatformTheme::IconPixmapSizes).value<QList<QSize> >();
for (const QSize &size : sizes) { for (const QSize &size : sizes) {
QPixmap mainIcon; QPixmap mainIcon;
const QString cacheKey = QLatin1String("qt_mac_constructQIconFromIconRef") + QString::number(standardIcon) + QString::number(size.width()); const QString cacheKey = "qt_mac_constructQIconFromIconRef"_L1 + QString::number(standardIcon) + QString::number(size.width());
if (standardIcon >= QStyle::SP_CustomBase) { if (standardIcon >= QStyle::SP_CustomBase) {
mainIcon = theme->standardPixmap(sp, QSizeF(size)); mainIcon = theme->standardPixmap(sp, QSizeF(size));
} else if (QPixmapCache::find(cacheKey, &mainIcon) == false) { } else if (QPixmapCache::find(cacheKey, &mainIcon) == false) {
@ -6158,88 +6152,88 @@ QIcon QCommonStyle::standardIcon(StandardPixmap standardIcon, const QStyleOption
titleBarSizes, sizeof(titleBarSizes)/sizeof(titleBarSizes[0]), icon); titleBarSizes, sizeof(titleBarSizes)/sizeof(titleBarSizes[0]), icon);
break; break;
case SP_FileDialogNewFolder: case SP_FileDialogNewFolder:
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/newdirectory-16.png"), QSize(16, 16)); icon.addFile(":/qt-project.org/styles/commonstyle/images/newdirectory-16.png"_L1, QSize(16, 16));
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/newdirectory-32.png"), QSize(32, 32)); icon.addFile(":/qt-project.org/styles/commonstyle/images/newdirectory-32.png"_L1, QSize(32, 32));
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/newdirectory-128.png"), QSize(128, 128)); icon.addFile(":/qt-project.org/styles/commonstyle/images/newdirectory-128.png"_L1, QSize(128, 128));
break; break;
case SP_FileDialogBack: case SP_FileDialogBack:
return QCommonStyle::standardIcon(SP_ArrowBack, option, widget); return QCommonStyle::standardIcon(SP_ArrowBack, option, widget);
case SP_FileDialogToParent: case SP_FileDialogToParent:
return QCommonStyle::standardIcon(SP_ArrowUp, option, widget); return QCommonStyle::standardIcon(SP_ArrowUp, option, widget);
case SP_FileDialogDetailedView: case SP_FileDialogDetailedView:
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/viewdetailed-16.png"), QSize(16, 16)); icon.addFile(":/qt-project.org/styles/commonstyle/images/viewdetailed-16.png"_L1, QSize(16, 16));
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/viewdetailed-32.png"), QSize(32, 32)); icon.addFile(":/qt-project.org/styles/commonstyle/images/viewdetailed-32.png"_L1, QSize(32, 32));
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/viewdetailed-128.png"), QSize(128, 128)); icon.addFile(":/qt-project.org/styles/commonstyle/images/viewdetailed-128.png"_L1, QSize(128, 128));
break; break;
case SP_FileDialogInfoView: case SP_FileDialogInfoView:
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/fileinfo-16.png"), QSize(16, 16)); icon.addFile(":/qt-project.org/styles/commonstyle/images/fileinfo-16.png"_L1, QSize(16, 16));
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/fileinfo-32.png"), QSize(32, 32)); icon.addFile(":/qt-project.org/styles/commonstyle/images/fileinfo-32.png"_L1, QSize(32, 32));
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/fileinfo-128.png"), QSize(128, 128)); icon.addFile(":/qt-project.org/styles/commonstyle/images/fileinfo-128.png"_L1, QSize(128, 128));
break; break;
case SP_FileDialogContentsView: case SP_FileDialogContentsView:
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/filecontents-16.png"), QSize(16, 16)); icon.addFile(":/qt-project.org/styles/commonstyle/images/filecontents-16.png"_L1, QSize(16, 16));
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/filecontents-32.png"), QSize(32, 32)); icon.addFile(":/qt-project.org/styles/commonstyle/images/filecontents-32.png"_L1, QSize(32, 32));
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/filecontents-128.png"), QSize(128, 128)); icon.addFile(":/qt-project.org/styles/commonstyle/images/filecontents-128.png"_L1, QSize(128, 128));
break; break;
case SP_FileDialogListView: case SP_FileDialogListView:
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/viewlist-16.png"), QSize(16, 16)); icon.addFile(":/qt-project.org/styles/commonstyle/images/viewlist-16.png"_L1, QSize(16, 16));
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/viewlist-32.png"), QSize(32, 32)); icon.addFile(":/qt-project.org/styles/commonstyle/images/viewlist-32.png"_L1, QSize(32, 32));
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/viewlist-128.png"), QSize(128, 128)); icon.addFile(":/qt-project.org/styles/commonstyle/images/viewlist-128.png"_L1, QSize(128, 128));
break; break;
case SP_DialogOkButton: case SP_DialogOkButton:
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-ok-16.png"), QSize(16, 16)); icon.addFile(":/qt-project.org/styles/commonstyle/images/standardbutton-ok-16.png"_L1, QSize(16, 16));
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-ok-32.png"), QSize(32, 32)); icon.addFile(":/qt-project.org/styles/commonstyle/images/standardbutton-ok-32.png"_L1, QSize(32, 32));
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-ok-128.png"), QSize(128, 128)); icon.addFile(":/qt-project.org/styles/commonstyle/images/standardbutton-ok-128.png"_L1, QSize(128, 128));
break; break;
case SP_DialogCancelButton: case SP_DialogCancelButton:
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-cancel-16.png"), QSize(16, 16)); icon.addFile(":/qt-project.org/styles/commonstyle/images/standardbutton-cancel-16.png"_L1, QSize(16, 16));
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-cancel-32.png"), QSize(32, 32)); icon.addFile(":/qt-project.org/styles/commonstyle/images/standardbutton-cancel-32.png"_L1, QSize(32, 32));
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-cancel-128.png"), QSize(128, 128)); icon.addFile(":/qt-project.org/styles/commonstyle/images/standardbutton-cancel-128.png"_L1, QSize(128, 128));
break; break;
case SP_DialogHelpButton: case SP_DialogHelpButton:
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-help-16.png"), QSize(16, 16)); icon.addFile(":/qt-project.org/styles/commonstyle/images/standardbutton-help-16.png"_L1, QSize(16, 16));
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-help-32.png"), QSize(32, 32)); icon.addFile(":/qt-project.org/styles/commonstyle/images/standardbutton-help-32.png"_L1, QSize(32, 32));
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-help-128.png"), QSize(128, 128)); icon.addFile(":/qt-project.org/styles/commonstyle/images/standardbutton-help-128.png"_L1, QSize(128, 128));
break; break;
case SP_DialogOpenButton: case SP_DialogOpenButton:
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-open-16.png"), QSize(16, 16)); icon.addFile(":/qt-project.org/styles/commonstyle/images/standardbutton-open-16.png"_L1, QSize(16, 16));
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-open-32.png"), QSize(32, 32)); icon.addFile(":/qt-project.org/styles/commonstyle/images/standardbutton-open-32.png"_L1, QSize(32, 32));
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-open-128.png"), QSize(128, 128)); icon.addFile(":/qt-project.org/styles/commonstyle/images/standardbutton-open-128.png"_L1, QSize(128, 128));
break; break;
case SP_DialogSaveButton: case SP_DialogSaveButton:
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-save-16.png"), QSize(16, 16)); icon.addFile(":/qt-project.org/styles/commonstyle/images/standardbutton-save-16.png"_L1, QSize(16, 16));
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-save-32.png"), QSize(32, 32)); icon.addFile(":/qt-project.org/styles/commonstyle/images/standardbutton-save-32.png"_L1, QSize(32, 32));
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-save-128.png"), QSize(128, 128)); icon.addFile(":/qt-project.org/styles/commonstyle/images/standardbutton-save-128.png"_L1, QSize(128, 128));
break; break;
case SP_DialogCloseButton: case SP_DialogCloseButton:
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-close-16.png"), QSize(16, 16)); icon.addFile(":/qt-project.org/styles/commonstyle/images/standardbutton-close-16.png"_L1, QSize(16, 16));
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-close-32.png"), QSize(32, 32)); icon.addFile(":/qt-project.org/styles/commonstyle/images/standardbutton-close-32.png"_L1, QSize(32, 32));
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-close-128.png"), QSize(128, 128)); icon.addFile(":/qt-project.org/styles/commonstyle/images/standardbutton-close-128.png"_L1, QSize(128, 128));
break; break;
case SP_DialogApplyButton: case SP_DialogApplyButton:
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-apply-16.png"), QSize(16, 16)); icon.addFile(":/qt-project.org/styles/commonstyle/images/standardbutton-apply-16.png"_L1, QSize(16, 16));
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-apply-32.png"), QSize(32, 32)); icon.addFile(":/qt-project.org/styles/commonstyle/images/standardbutton-apply-32.png"_L1, QSize(32, 32));
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-apply-128.png"), QSize(128, 128)); icon.addFile(":/qt-project.org/styles/commonstyle/images/standardbutton-apply-128.png"_L1, QSize(128, 128));
break; break;
case SP_DialogResetButton: case SP_DialogResetButton:
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-clear-16.png"), QSize(16, 16)); icon.addFile(":/qt-project.org/styles/commonstyle/images/standardbutton-clear-16.png"_L1, QSize(16, 16));
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-clear-32.png"), QSize(32, 32)); icon.addFile(":/qt-project.org/styles/commonstyle/images/standardbutton-clear-32.png"_L1, QSize(32, 32));
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-clear-128.png"), QSize(128, 128)); icon.addFile(":/qt-project.org/styles/commonstyle/images/standardbutton-clear-128.png"_L1, QSize(128, 128));
break; break;
case SP_DialogDiscardButton: case SP_DialogDiscardButton:
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-delete-16.png"), QSize(16, 16)); icon.addFile(":/qt-project.org/styles/commonstyle/images/standardbutton-delete-16.png"_L1, QSize(16, 16));
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-delete-32.png"), QSize(32, 32)); icon.addFile(":/qt-project.org/styles/commonstyle/images/standardbutton-delete-32.png"_L1, QSize(32, 32));
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-delete-128.png"), QSize(128, 128)); icon.addFile(":/qt-project.org/styles/commonstyle/images/standardbutton-delete-128.png"_L1, QSize(128, 128));
break; break;
case SP_DialogYesButton: case SP_DialogYesButton:
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-yes-16.png"), QSize(16, 16)); icon.addFile(":/qt-project.org/styles/commonstyle/images/standardbutton-yes-16.png"_L1, QSize(16, 16));
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-yes-32.png"), QSize(32, 32)); icon.addFile(":/qt-project.org/styles/commonstyle/images/standardbutton-yes-32.png"_L1, QSize(32, 32));
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-yes-128.png"), QSize(128, 128)); icon.addFile(":/qt-project.org/styles/commonstyle/images/standardbutton-yes-128.png"_L1, QSize(128, 128));
break; break;
case SP_DialogNoButton: case SP_DialogNoButton:
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-no-16.png"), QSize(16, 16)); icon.addFile(":/qt-project.org/styles/commonstyle/images/standardbutton-no-16.png"_L1, QSize(16, 16));
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-no-32.png"), QSize(32, 32)); icon.addFile(":/qt-project.org/styles/commonstyle/images/standardbutton-no-32.png"_L1, QSize(32, 32));
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-no-128.png"), QSize(128, 128)); icon.addFile(":/qt-project.org/styles/commonstyle/images/standardbutton-no-128.png"_L1, QSize(128, 128));
break; break;
case SP_ArrowForward: case SP_ArrowForward:
if (rtl) if (rtl)
@ -6250,106 +6244,106 @@ QIcon QCommonStyle::standardIcon(StandardPixmap standardIcon, const QStyleOption
return QCommonStyle::standardIcon(SP_ArrowRight, option, widget); return QCommonStyle::standardIcon(SP_ArrowRight, option, widget);
return QCommonStyle::standardIcon(SP_ArrowLeft, option, widget); return QCommonStyle::standardIcon(SP_ArrowLeft, option, widget);
case SP_ArrowLeft: case SP_ArrowLeft:
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/left-16.png"), QSize(16, 16)); icon.addFile(":/qt-project.org/styles/commonstyle/images/left-16.png"_L1, QSize(16, 16));
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/left-32.png"), QSize(32, 32)); icon.addFile(":/qt-project.org/styles/commonstyle/images/left-32.png"_L1, QSize(32, 32));
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/left-128.png"), QSize(128, 128)); icon.addFile(":/qt-project.org/styles/commonstyle/images/left-128.png"_L1, QSize(128, 128));
break; break;
case SP_ArrowRight: case SP_ArrowRight:
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/right-16.png"), QSize(16, 16)); icon.addFile(":/qt-project.org/styles/commonstyle/images/right-16.png"_L1, QSize(16, 16));
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/right-32.png"), QSize(32, 32)); icon.addFile(":/qt-project.org/styles/commonstyle/images/right-32.png"_L1, QSize(32, 32));
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/right-128.png"), QSize(128, 128)); icon.addFile(":/qt-project.org/styles/commonstyle/images/right-128.png"_L1, QSize(128, 128));
break; break;
case SP_ArrowUp: case SP_ArrowUp:
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/up-16.png"), QSize(16, 16)); icon.addFile(":/qt-project.org/styles/commonstyle/images/up-16.png"_L1, QSize(16, 16));
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/up-32.png"), QSize(32, 32)); icon.addFile(":/qt-project.org/styles/commonstyle/images/up-32.png"_L1, QSize(32, 32));
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/up-128.png"), QSize(128, 128)); icon.addFile(":/qt-project.org/styles/commonstyle/images/up-128.png"_L1, QSize(128, 128));
break; break;
case SP_ArrowDown: case SP_ArrowDown:
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/down-16.png"), QSize(16, 16)); icon.addFile(":/qt-project.org/styles/commonstyle/images/down-16.png"_L1, QSize(16, 16));
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/down-32.png"), QSize(32, 32)); icon.addFile(":/qt-project.org/styles/commonstyle/images/down-32.png"_L1, QSize(32, 32));
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/down-128.png"), QSize(128, 128)); icon.addFile(":/qt-project.org/styles/commonstyle/images/down-128.png"_L1, QSize(128, 128));
break; break;
case SP_DirHomeIcon: case SP_DirHomeIcon:
case SP_DirIcon: case SP_DirIcon:
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/dirclosed-16.png"), icon.addFile(":/qt-project.org/styles/commonstyle/images/dirclosed-16.png"_L1,
QSize(), QIcon::Normal, QIcon::Off); QSize(), QIcon::Normal, QIcon::Off);
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/diropen-16.png"), icon.addFile(":/qt-project.org/styles/commonstyle/images/diropen-16.png"_L1,
QSize(), QIcon::Normal, QIcon::On); QSize(), QIcon::Normal, QIcon::On);
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/dirclosed-32.png"), icon.addFile(":/qt-project.org/styles/commonstyle/images/dirclosed-32.png"_L1,
QSize(32, 32), QIcon::Normal, QIcon::Off); QSize(32, 32), QIcon::Normal, QIcon::Off);
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/diropen-32.png"), icon.addFile(":/qt-project.org/styles/commonstyle/images/diropen-32.png"_L1,
QSize(32, 32), QIcon::Normal, QIcon::On); QSize(32, 32), QIcon::Normal, QIcon::On);
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/dirclosed-128.png"), icon.addFile(":/qt-project.org/styles/commonstyle/images/dirclosed-128.png"_L1,
QSize(128, 128), QIcon::Normal, QIcon::Off); QSize(128, 128), QIcon::Normal, QIcon::Off);
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/diropen-128.png"), icon.addFile(":/qt-project.org/styles/commonstyle/images/diropen-128.png"_L1,
QSize(128, 128), QIcon::Normal, QIcon::On); QSize(128, 128), QIcon::Normal, QIcon::On);
break; break;
case SP_DriveCDIcon: case SP_DriveCDIcon:
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/cdr-16.png"), QSize(16, 16)); icon.addFile(":/qt-project.org/styles/commonstyle/images/cdr-16.png"_L1, QSize(16, 16));
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/cdr-32.png"), QSize(32, 32)); icon.addFile(":/qt-project.org/styles/commonstyle/images/cdr-32.png"_L1, QSize(32, 32));
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/cdr-128.png"), QSize(128, 128)); icon.addFile(":/qt-project.org/styles/commonstyle/images/cdr-128.png"_L1, QSize(128, 128));
break; break;
case SP_DriveDVDIcon: case SP_DriveDVDIcon:
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/dvd-16.png"), QSize(16, 16)); icon.addFile(":/qt-project.org/styles/commonstyle/images/dvd-16.png"_L1, QSize(16, 16));
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/dvd-32.png"), QSize(32, 32)); icon.addFile(":/qt-project.org/styles/commonstyle/images/dvd-32.png"_L1, QSize(32, 32));
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/dvd-128.png"), QSize(128, 128)); icon.addFile(":/qt-project.org/styles/commonstyle/images/dvd-128.png"_L1, QSize(128, 128));
break; break;
case SP_FileIcon: case SP_FileIcon:
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/file-16.png"), QSize(16, 16)); icon.addFile(":/qt-project.org/styles/commonstyle/images/file-16.png"_L1, QSize(16, 16));
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/file-32.png"), QSize(32, 32)); icon.addFile(":/qt-project.org/styles/commonstyle/images/file-32.png"_L1, QSize(32, 32));
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/file-128.png"), QSize(128, 128)); icon.addFile(":/qt-project.org/styles/commonstyle/images/file-128.png"_L1, QSize(128, 128));
break; break;
case SP_FileLinkIcon: case SP_FileLinkIcon:
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/filelink-16.png"), QSize(16, 16)); icon.addFile(":/qt-project.org/styles/commonstyle/images/filelink-16.png"_L1, QSize(16, 16));
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/filelink-32.png"), QSize(32, 32)); icon.addFile(":/qt-project.org/styles/commonstyle/images/filelink-32.png"_L1, QSize(32, 32));
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/filelink-128.png"), QSize(128, 128)); icon.addFile(":/qt-project.org/styles/commonstyle/images/filelink-128.png"_L1, QSize(128, 128));
break; break;
case SP_TrashIcon: case SP_TrashIcon:
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/trash-16.png"), QSize(16, 16)); icon.addFile(":/qt-project.org/styles/commonstyle/images/trash-16.png"_L1, QSize(16, 16));
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/trash-32.png"), QSize(32, 32)); icon.addFile(":/qt-project.org/styles/commonstyle/images/trash-32.png"_L1, QSize(32, 32));
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/trash-128.png"), QSize(128, 128)); icon.addFile(":/qt-project.org/styles/commonstyle/images/trash-128.png"_L1, QSize(128, 128));
break; break;
case SP_BrowserReload: case SP_BrowserReload:
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/refresh-24.png"), QSize(24, 24)); icon.addFile(":/qt-project.org/styles/commonstyle/images/refresh-24.png"_L1, QSize(24, 24));
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/refresh-32.png"), QSize(32, 32)); icon.addFile(":/qt-project.org/styles/commonstyle/images/refresh-32.png"_L1, QSize(32, 32));
break; break;
case SP_BrowserStop: case SP_BrowserStop:
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/stop-24.png"), QSize(24, 24)); icon.addFile(":/qt-project.org/styles/commonstyle/images/stop-24.png"_L1, QSize(24, 24));
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/stop-32.png"), QSize(32, 32)); icon.addFile(":/qt-project.org/styles/commonstyle/images/stop-32.png"_L1, QSize(32, 32));
break; break;
case SP_MediaPlay: case SP_MediaPlay:
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-play-16.png"), QSize(16, 16)); icon.addFile(":/qt-project.org/styles/commonstyle/images/media-play-16.png"_L1, QSize(16, 16));
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-play-32.png"), QSize(32, 32)); icon.addFile(":/qt-project.org/styles/commonstyle/images/media-play-32.png"_L1, QSize(32, 32));
break; break;
case SP_MediaPause: case SP_MediaPause:
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-pause-16.png"), QSize(16, 16)); icon.addFile(":/qt-project.org/styles/commonstyle/images/media-pause-16.png"_L1, QSize(16, 16));
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-pause-32.png"), QSize(32, 32)); icon.addFile(":/qt-project.org/styles/commonstyle/images/media-pause-32.png"_L1, QSize(32, 32));
break; break;
case SP_MediaStop: case SP_MediaStop:
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-stop-16.png"), QSize(16, 16)); icon.addFile(":/qt-project.org/styles/commonstyle/images/media-stop-16.png"_L1, QSize(16, 16));
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-stop-32.png"), QSize(32, 32)); icon.addFile(":/qt-project.org/styles/commonstyle/images/media-stop-32.png"_L1, QSize(32, 32));
break; break;
case SP_MediaSeekForward: case SP_MediaSeekForward:
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-seek-forward-16.png"), QSize(16, 16)); icon.addFile(":/qt-project.org/styles/commonstyle/images/media-seek-forward-16.png"_L1, QSize(16, 16));
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-seek-forward-32.png"), QSize(32, 32)); icon.addFile(":/qt-project.org/styles/commonstyle/images/media-seek-forward-32.png"_L1, QSize(32, 32));
break; break;
case SP_MediaSeekBackward: case SP_MediaSeekBackward:
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-seek-backward-16.png"), QSize(16, 16)); icon.addFile(":/qt-project.org/styles/commonstyle/images/media-seek-backward-16.png"_L1, QSize(16, 16));
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-seek-backward-32.png"), QSize(32, 32)); icon.addFile(":/qt-project.org/styles/commonstyle/images/media-seek-backward-32.png"_L1, QSize(32, 32));
break; break;
case SP_MediaSkipForward: case SP_MediaSkipForward:
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-skip-forward-16.png"), QSize(16, 16)); icon.addFile(":/qt-project.org/styles/commonstyle/images/media-skip-forward-16.png"_L1, QSize(16, 16));
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-skip-forward-32.png"), QSize(32, 32)); icon.addFile(":/qt-project.org/styles/commonstyle/images/media-skip-forward-32.png"_L1, QSize(32, 32));
break; break;
case SP_MediaSkipBackward: case SP_MediaSkipBackward:
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-skip-backward-16.png"), QSize(16, 16)); icon.addFile(":/qt-project.org/styles/commonstyle/images/media-skip-backward-16.png"_L1, QSize(16, 16));
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-skip-backward-32.png"), QSize(32, 32)); icon.addFile(":/qt-project.org/styles/commonstyle/images/media-skip-backward-32.png"_L1, QSize(32, 32));
break; break;
case SP_MediaVolume: case SP_MediaVolume:
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-volume-16.png"), QSize(16, 16)); icon.addFile(":/qt-project.org/styles/commonstyle/images/media-volume-16.png"_L1, QSize(16, 16));
break; break;
case SP_MediaVolumeMuted: case SP_MediaVolumeMuted:
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-volume-muted-16.png"), QSize(16, 16)); icon.addFile(":/qt-project.org/styles/commonstyle/images/media-volume-muted-16.png"_L1, QSize(16, 16));
break; break;
case SP_TitleBarCloseButton: case SP_TitleBarCloseButton:
addIconFiles(iconResourcePrefix() + QStringLiteral("closedock-"), addIconFiles(iconResourcePrefix() + QStringLiteral("closedock-"),
@ -6359,7 +6353,7 @@ QIcon QCommonStyle::standardIcon(StandardPixmap standardIcon, const QStyleOption
# ifndef QT_NO_IMAGEFORMAT_XPM # ifndef QT_NO_IMAGEFORMAT_XPM
icon.addPixmap(titleBarMenuCachedPixmapFromXPM()); icon.addPixmap(titleBarMenuCachedPixmapFromXPM());
# endif # endif
icon.addFile(QLatin1String(":/qt-project.org/qmessagebox/images/qtlogo-64.png")); icon.addFile(":/qt-project.org/qmessagebox/images/qtlogo-64.png"_L1);
break; break;
case SP_TitleBarNormalButton: case SP_TitleBarNormalButton:
addIconFiles(iconResourcePrefix() + QStringLiteral("normalizedockup-"), addIconFiles(iconResourcePrefix() + QStringLiteral("normalizedockup-"),

View File

@ -93,6 +93,7 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
using namespace QStyleHelper; using namespace QStyleHelper;
enum Direction { enum Direction {
@ -259,7 +260,7 @@ static void qt_fusion_draw_arrow(Qt::ArrowType type, QPainter *painter, const QS
const int size = qMin(arrowMax, rectMax); const int size = qMin(arrowMax, rectMax);
QPixmap cachePixmap; QPixmap cachePixmap;
QString cacheKey = QStyleHelper::uniqueName(QLatin1String("fusion-arrow"), option, rect.size()) QString cacheKey = QStyleHelper::uniqueName("fusion-arrow"_L1, option, rect.size())
% HexString<uint>(type) % HexString<uint>(type)
% HexString<uint>(color.rgba()); % HexString<uint>(color.rgba());
if (!QPixmapCache::find(cacheKey, &cachePixmap)) { if (!QPixmapCache::find(cacheKey, &cachePixmap)) {
@ -390,7 +391,7 @@ QFusionStylePrivate::QFusionStylePrivate()
*/ */
QFusionStyle::QFusionStyle() : QCommonStyle(*new QFusionStylePrivate) QFusionStyle::QFusionStyle() : QCommonStyle(*new QFusionStylePrivate)
{ {
setObjectName(QLatin1String("Fusion")); setObjectName("Fusion"_L1);
} }
/*! /*!
@ -470,7 +471,7 @@ void QFusionStyle::drawPrimitive(PrimitiveElement elem,
// No frame drawn // No frame drawn
case PE_FrameGroupBox: case PE_FrameGroupBox:
{ {
QPixmap pixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/fusion_groupbox.png")); QPixmap pixmap(":/qt-project.org/styles/commonstyle/images/fusion_groupbox.png"_L1);
int topMargin = 0; int topMargin = 0;
auto control = qobject_cast<const QGroupBox *>(widget); auto control = qobject_cast<const QGroupBox *>(widget);
if (control && !control->isCheckable() && control->title().isEmpty()) { if (control && !control->isCheckable() && control->title().isEmpty()) {
@ -1271,7 +1272,7 @@ void QFusionStyle::drawControl(ControlElement element, const QStyleOption *optio
// Draws the header in tables. // Draws the header in tables.
if (const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(option)) { if (const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(option)) {
const QStyleOptionHeaderV2 *headerV2 = qstyleoption_cast<const QStyleOptionHeaderV2 *>(option); const QStyleOptionHeaderV2 *headerV2 = qstyleoption_cast<const QStyleOptionHeaderV2 *>(option);
QString pixmapName = QStyleHelper::uniqueName(QLatin1String("headersection"), option, option->rect.size()); QString pixmapName = QStyleHelper::uniqueName("headersection"_L1, option, option->rect.size());
pixmapName += QString::number(- int(header->position)); pixmapName += QString::number(- int(header->position));
pixmapName += QString::number(- int(header->orientation)); pixmapName += QString::number(- int(header->orientation));
if (headerV2) if (headerV2)
@ -1988,7 +1989,7 @@ void QFusionStyle::drawComplexControl(ComplexControl control, const QStyleOption
case CC_SpinBox: case CC_SpinBox:
if (const QStyleOptionSpinBox *spinBox = qstyleoption_cast<const QStyleOptionSpinBox *>(option)) { if (const QStyleOptionSpinBox *spinBox = qstyleoption_cast<const QStyleOptionSpinBox *>(option)) {
QPixmap cache; QPixmap cache;
QString pixmapName = QStyleHelper::uniqueName(QLatin1String("spinbox"), spinBox, spinBox->rect.size()); QString pixmapName = QStyleHelper::uniqueName("spinbox"_L1, spinBox, spinBox->rect.size());
if (!QPixmapCache::find(pixmapName, &cache)) { if (!QPixmapCache::find(pixmapName, &cache)) {
cache = styleCachePixmap(spinBox->rect.size()); cache = styleCachePixmap(spinBox->rect.size());
@ -2698,15 +2699,15 @@ void QFusionStyle::drawComplexControl(ComplexControl control, const QStyleOption
bool sunken = comboBox->state & State_On; // play dead, if combobox has no items bool sunken = comboBox->state & State_On; // play dead, if combobox has no items
bool isEnabled = (comboBox->state & State_Enabled); bool isEnabled = (comboBox->state & State_Enabled);
QPixmap cache; QPixmap cache;
QString pixmapName = QStyleHelper::uniqueName(QLatin1String("combobox"), option, comboBox->rect.size()); QString pixmapName = QStyleHelper::uniqueName("combobox"_L1, option, comboBox->rect.size());
if (sunken) if (sunken)
pixmapName += QLatin1String("-sunken"); pixmapName += "-sunken"_L1;
if (comboBox->editable) if (comboBox->editable)
pixmapName += QLatin1String("-editable"); pixmapName += "-editable"_L1;
if (isEnabled) if (isEnabled)
pixmapName += QLatin1String("-enabled"); pixmapName += "-enabled"_L1;
if (!comboBox->frame) if (!comboBox->frame)
pixmapName += QLatin1String("-frameless"); pixmapName += "-frameless"_L1;
if (!QPixmapCache::find(pixmapName, &cache)) { if (!QPixmapCache::find(pixmapName, &cache)) {
cache = styleCachePixmap(comboBox->rect.size()); cache = styleCachePixmap(comboBox->rect.size());
@ -2819,7 +2820,7 @@ void QFusionStyle::drawComplexControl(ComplexControl control, const QStyleOption
grooveColor.setHsv(buttonColor.hue(), grooveColor.setHsv(buttonColor.hue(),
qMin(255, (int)(buttonColor.saturation())), qMin(255, (int)(buttonColor.saturation())),
qMin(255, (int)(buttonColor.value()*0.9))); qMin(255, (int)(buttonColor.value()*0.9)));
QString groovePixmapName = QStyleHelper::uniqueName(QLatin1String("slider_groove"), option, groove.size()); QString groovePixmapName = QStyleHelper::uniqueName("slider_groove"_L1, option, groove.size());
QRect pixmapRect(0, 0, groove.width(), groove.height()); QRect pixmapRect(0, 0, groove.width(), groove.height());
// draw background groove // draw background groove
@ -2850,7 +2851,7 @@ void QFusionStyle::drawComplexControl(ComplexControl control, const QStyleOption
// draw blue groove highlight // draw blue groove highlight
QRect clipRect; QRect clipRect;
groovePixmapName += QLatin1String("_blue"); groovePixmapName += "_blue"_L1;
if (!QPixmapCache::find(groovePixmapName, &cache)) { if (!QPixmapCache::find(groovePixmapName, &cache)) {
cache = styleCachePixmap(pixmapRect.size()); cache = styleCachePixmap(pixmapRect.size());
cache.fill(Qt::transparent); cache.fill(Qt::transparent);
@ -2957,7 +2958,7 @@ void QFusionStyle::drawComplexControl(ComplexControl control, const QStyleOption
} }
// draw handle // draw handle
if ((option->subControls & SC_SliderHandle) ) { if ((option->subControls & SC_SliderHandle) ) {
QString handlePixmapName = QStyleHelper::uniqueName(QLatin1String("slider_handle"), option, handle.size()); QString handlePixmapName = QStyleHelper::uniqueName("slider_handle"_L1, option, handle.size());
if (!QPixmapCache::find(handlePixmapName, &cache)) { if (!QPixmapCache::find(handlePixmapName, &cache)) {
cache = styleCachePixmap(handle.size()); cache = styleCachePixmap(handle.size());
cache.fill(Qt::transparent); cache.fill(Qt::transparent);

View File

@ -48,6 +48,8 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
/*! /*!
\class QProxyStyle \class QProxyStyle
@ -106,7 +108,7 @@ void QProxyStylePrivate::ensureBaseStyle() const
baseStyle = QStyleFactory::create(QApplicationPrivate::desktopStyleKey()); baseStyle = QStyleFactory::create(QApplicationPrivate::desktopStyleKey());
if (!baseStyle) // Fallback to windows style if (!baseStyle) // Fallback to windows style
baseStyle = QStyleFactory::create(QLatin1String("windows")); baseStyle = QStyleFactory::create("windows"_L1);
baseStyle->setProxy(const_cast<QProxyStyle*>(q)); baseStyle->setProxy(const_cast<QProxyStyle*>(q));
baseStyle->setParent(const_cast<QProxyStyle*>(q)); // Take ownership baseStyle->setParent(const_cast<QProxyStyle*>(q)); // Take ownership

View File

@ -50,8 +50,10 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
(QStyleFactoryInterface_iid, QLatin1String("/styles"), Qt::CaseInsensitive)) (QStyleFactoryInterface_iid, "/styles"_L1, Qt::CaseInsensitive))
/*! /*!
\class QStyleFactory \class QStyleFactory
@ -91,17 +93,17 @@ QStyle *QStyleFactory::create(const QString& key)
QStyle *ret = nullptr; QStyle *ret = nullptr;
QString style = key.toLower(); QString style = key.toLower();
#if QT_CONFIG(style_windows) #if QT_CONFIG(style_windows)
if (style == QLatin1String("windows")) if (style == "windows"_L1)
ret = new QWindowsStyle; ret = new QWindowsStyle;
else else
#endif #endif
#if QT_CONFIG(style_fusion) #if QT_CONFIG(style_fusion)
if (style == QLatin1String("fusion")) if (style == "fusion"_L1)
ret = new QFusionStyle; ret = new QFusionStyle;
else else
#endif #endif
#if defined(Q_OS_MACOS) && QT_DEPRECATED_SINCE(6, 0) #if defined(Q_OS_MACOS) && QT_DEPRECATED_SINCE(6, 0)
if (style == QLatin1String("macintosh")) { if (style == "macintosh"_L1) {
qWarning() << "The style key 'macintosh' is deprecated. Please use 'macos' instead."; qWarning() << "The style key 'macintosh' is deprecated. Please use 'macos' instead.";
style = QStringLiteral("macos"); style = QStringLiteral("macos");
} else } else
@ -132,12 +134,12 @@ QStringList QStyleFactory::keys()
for (PluginKeyMap::const_iterator it = keyMap.constBegin(); it != cend; ++it) for (PluginKeyMap::const_iterator it = keyMap.constBegin(); it != cend; ++it)
list.append(it.value()); list.append(it.value());
#if QT_CONFIG(style_windows) #if QT_CONFIG(style_windows)
if (!list.contains(QLatin1String("Windows"))) if (!list.contains("Windows"_L1))
list << QLatin1String("Windows"); list << "Windows"_L1;
#endif #endif
#if QT_CONFIG(style_fusion) #if QT_CONFIG(style_fusion)
if (!list.contains(QLatin1String("Fusion"))) if (!list.contains("Fusion"_L1))
list << QLatin1String("Fusion"); list << "Fusion"_L1;
#endif #endif
return list; return list;
} }

View File

@ -806,9 +806,9 @@ QHash<QStyle::SubControl, QRect> QStyleSheetStyle::titleBarLayout(const QWidget
const bool isMaximized = tb->titleBarState & Qt::WindowMaximized; const bool isMaximized = tb->titleBarState & Qt::WindowMaximized;
QRenderRule subRule = renderRule(w, tb); QRenderRule subRule = renderRule(w, tb);
QRect cr = subRule.contentsRect(tb->rect); QRect cr = subRule.contentsRect(tb->rect);
QList<QVariant> layout = subRule.styleHint(QLatin1String("button-layout")).toList(); QList<QVariant> layout = subRule.styleHint("button-layout"_L1).toList();
if (layout.isEmpty()) if (layout.isEmpty())
layout = subControlLayout(QLatin1String("I(T)HSmMX")); layout = subControlLayout("I(T)HSmMX"_L1);
int offsets[3] = { 0, 0, 0 }; int offsets[3] = { 0, 0, 0 };
enum Where { Left, Right, Center, NoWhere } where = Left; enum Where { Left, Right, Center, NoWhere } where = Left;
@ -1024,7 +1024,7 @@ QRenderRule::QRenderRule(const QList<Declaration> &declarations, const QObject *
int cuts[4]; int cuts[4];
decl.borderImageValue(&uri, cuts, &horizStretch, &vertStretch); decl.borderImageValue(&uri, cuts, &horizStretch, &vertStretch);
if (uri.isEmpty() || uri == QLatin1String("none")) { if (uri.isEmpty() || uri == "none"_L1) {
if (bd && bd->bi) if (bd && bd->bi)
bd->bi->pixmap = QPixmap(); bd->bi->pixmap = QPixmap();
} else { } else {
@ -1046,7 +1046,7 @@ QRenderRule::QRenderRule(const QList<Declaration> &declarations, const QObject *
int role = decl.d->values.at(0).variant.toInt(); int role = decl.d->values.at(0).variant.toInt();
if (role >= Value_FirstColorRole && role <= Value_LastColorRole) if (role >= Value_FirstColorRole && role <= Value_LastColorRole)
defaultBackground = palette.color((QPalette::ColorRole)(role-Value_FirstColorRole)); defaultBackground = palette.color((QPalette::ColorRole)(role-Value_FirstColorRole));
} else if (decl.d->property.startsWith(QLatin1String("qproperty-"), Qt::CaseInsensitive)) { } else if (decl.d->property.startsWith("qproperty-"_L1, Qt::CaseInsensitive)) {
// intentionally left blank... // intentionally left blank...
} else if (decl.d->propertyId == UnknownProperty) { } else if (decl.d->propertyId == UnknownProperty) {
bool knownStyleHint = false; bool knownStyleHint = false;
@ -1055,11 +1055,11 @@ QRenderRule::QRenderRule(const QList<Declaration> &declarations, const QObject *
if (decl.d->property.compare(styleHint) == 0) { if (decl.d->property.compare(styleHint) == 0) {
QString hintName = QString(styleHint); QString hintName = QString(styleHint);
QVariant hintValue; QVariant hintValue;
if (hintName.endsWith(QLatin1String("alignment"))) { if (hintName.endsWith("alignment"_L1)) {
hintValue = (int) decl.alignmentValue(); hintValue = (int) decl.alignmentValue();
} else if (hintName.endsWith(QLatin1String("color"))) { } else if (hintName.endsWith("color"_L1)) {
hintValue = (int) decl.colorValue().rgba(); hintValue = (int) decl.colorValue().rgba();
} else if (hintName.endsWith(QLatin1String("size"))) { } else if (hintName.endsWith("size"_L1)) {
// Check only for the 'em' case // Check only for the 'em' case
const QString valueString = decl.d->values.at(0).variant.toString(); const QString valueString = decl.d->values.at(0).variant.toString();
const bool isEmSize = valueString.endsWith(u"em", Qt::CaseInsensitive); const bool isEmSize = valueString.endsWith(u"em", Qt::CaseInsensitive);
@ -1089,9 +1089,9 @@ QRenderRule::QRenderRule(const QList<Declaration> &declarations, const QObject *
// Normal case where we receive a 'px' or 'pt' unit // Normal case where we receive a 'px' or 'pt' unit
hintValue = decl.sizeValue(); hintValue = decl.sizeValue();
} }
} else if (hintName.endsWith(QLatin1String("icon"))) { } else if (hintName.endsWith("icon"_L1)) {
hintValue = decl.iconValue(); hintValue = decl.iconValue();
} else if (hintName == QLatin1String("button-layout") } else if (hintName == "button-layout"_L1
&& decl.d->values.count() != 0 && decl.d->values.at(0).type == Value::String) { && decl.d->values.count() != 0 && decl.d->values.at(0).type == Value::String) {
hintValue = subControlLayout(decl.d->values.at(0).variant.toString()); hintValue = subControlLayout(decl.d->values.at(0).variant.toString());
} else { } else {
@ -1563,7 +1563,7 @@ public:
const QMetaObject *metaObject = OBJECT_PTR(node)->metaObject(); const QMetaObject *metaObject = OBJECT_PTR(node)->metaObject();
#if QT_CONFIG(tooltip) #if QT_CONFIG(tooltip)
if (qstrcmp(metaObject->className(), "QTipLabel") == 0) if (qstrcmp(metaObject->className(), "QTipLabel") == 0)
return QStringList(QLatin1String("QToolTip")); return QStringList("QToolTip"_L1);
#endif #endif
QStringList result; QStringList result;
do { do {
@ -1629,7 +1629,7 @@ public:
const QMetaObject *metaObject = OBJECT_PTR(node)->metaObject(); const QMetaObject *metaObject = OBJECT_PTR(node)->metaObject();
#if QT_CONFIG(tooltip) #if QT_CONFIG(tooltip)
if (qstrcmp(metaObject->className(), "QTipLabel") == 0) if (qstrcmp(metaObject->className(), "QTipLabel") == 0)
return nodeName == QLatin1String("QToolTip"); return nodeName == "QToolTip"_L1;
#endif #endif
do { do {
const ushort *uc = (const ushort *)nodeName.constData(); const ushort *uc = (const ushort *)nodeName.constData();
@ -1694,7 +1694,7 @@ QList<QCss::StyleRule> QStyleSheetStyle::styleRules(const QObject *obj) const
QHash<const void *, StyleSheet>::const_iterator appCacheIt = styleSheetCaches->styleSheetCache.constFind(qApp); QHash<const void *, StyleSheet>::const_iterator appCacheIt = styleSheetCaches->styleSheetCache.constFind(qApp);
if (appCacheIt == styleSheetCaches->styleSheetCache.constEnd()) { if (appCacheIt == styleSheetCaches->styleSheetCache.constEnd()) {
QString ss = qApp->styleSheet(); QString ss = qApp->styleSheet();
if (ss.startsWith(QLatin1String("file:///"))) if (ss.startsWith("file:///"_L1))
ss.remove(0, 8); ss.remove(0, 8);
parser.init(ss, qApp->styleSheet() != ss); parser.init(ss, qApp->styleSheet() != ss);
if (Q_UNLIKELY(!parser.parse(&appSs))) if (Q_UNLIKELY(!parser.parse(&appSs)))
@ -1718,7 +1718,7 @@ QList<QCss::StyleRule> QStyleSheetStyle::styleRules(const QObject *obj) const
if (objCacheIt == styleSheetCaches->styleSheetCache.constEnd()) { if (objCacheIt == styleSheetCaches->styleSheetCache.constEnd()) {
parser.init(styleSheet); parser.init(styleSheet);
if (!parser.parse(&ss)) { if (!parser.parse(&ss)) {
parser.init(QLatin1String("* {") + styleSheet + u'}'); parser.init("* {"_L1 + styleSheet + u'}');
if (Q_UNLIKELY(!parser.parse(&ss))) if (Q_UNLIKELY(!parser.parse(&ss)))
qWarning() << "Could not parse stylesheet of object" << o; qWarning() << "Could not parse stylesheet of object" << o;
} }
@ -1855,9 +1855,9 @@ static void qt_check_if_internal_object(const QObject **obj, int *element)
Q_UNUSED(element); Q_UNUSED(element);
#else #else
if (*obj && qstrcmp((*obj)->metaObject()->className(), "QDockWidgetTitleButton") == 0) { if (*obj && qstrcmp((*obj)->metaObject()->className(), "QDockWidgetTitleButton") == 0) {
if ((*obj)->objectName() == QLatin1String("qt_dockwidget_closebutton")) { if ((*obj)->objectName() == "qt_dockwidget_closebutton"_L1) {
*element = PseudoElement_DockWidgetCloseButton; *element = PseudoElement_DockWidgetCloseButton;
} else if ((*obj)->objectName() == QLatin1String("qt_dockwidget_floatbutton")) { } else if ((*obj)->objectName() == "qt_dockwidget_floatbutton"_L1) {
*element = PseudoElement_DockWidgetFloatButton; *element = PseudoElement_DockWidgetFloatButton;
} }
*obj = (*obj)->parent(); *obj = (*obj)->parent();
@ -2673,7 +2673,7 @@ void QStyleSheetStyle::setProperties(QWidget *w)
QDuplicateTracker<QString> propertySet(decls.size()); QDuplicateTracker<QString> propertySet(decls.size());
for (int i = decls.count() - 1; i >= 0; --i) { for (int i = decls.count() - 1; i >= 0; --i) {
const QString property = decls.at(i).d->property; const QString property = decls.at(i).d->property;
if (!property.startsWith(QLatin1String("qproperty-"), Qt::CaseInsensitive)) if (!property.startsWith("qproperty-"_L1, Qt::CaseInsensitive))
continue; continue;
if (!propertySet.hasSeen(property)) if (!propertySet.hasSeen(property))
finals.append(i); finals.append(i);
@ -3510,9 +3510,9 @@ void QStyleSheetStyle::drawComplexControl(ComplexControl cc, const QStyleOptionC
if (hasStyleRule(w, PseudoElement_MdiCloseButton) if (hasStyleRule(w, PseudoElement_MdiCloseButton)
|| hasStyleRule(w, PseudoElement_MdiNormalButton) || hasStyleRule(w, PseudoElement_MdiNormalButton)
|| hasStyleRule(w, PseudoElement_MdiMinButton)) { || hasStyleRule(w, PseudoElement_MdiMinButton)) {
QList<QVariant> layout = rule.styleHint(QLatin1String("button-layout")).toList(); QList<QVariant> layout = rule.styleHint("button-layout"_L1).toList();
if (layout.isEmpty()) if (layout.isEmpty())
layout = subControlLayout(QLatin1String("mNX")); layout = subControlLayout("mNX"_L1);
QStyleOptionComplex optCopy(*opt); QStyleOptionComplex optCopy(*opt);
optCopy.subControls = { }; optCopy.subControls = { };
@ -5170,9 +5170,8 @@ int QStyleSheetStyle::pixelMetric(PixelMetric m, const QStyleOption *opt, const
case PM_MessageBoxIconSize: case PM_MessageBoxIconSize:
case PM_ButtonIconSize: case PM_ButtonIconSize:
case PM_SmallIconSize: case PM_SmallIconSize:
if (rule.hasStyleHint(QLatin1String("icon-size"))) { if (rule.hasStyleHint("icon-size"_L1))
return rule.styleHint(QLatin1String("icon-size")).toSize().width(); return rule.styleHint("icon-size"_L1).toSize().width();
}
break; break;
case PM_DockWidgetTitleMargin: { case PM_DockWidgetTitleMargin: {
@ -5458,9 +5457,9 @@ QSize QStyleSheetStyle::sizeFromContents(ContentsType ct, const QStyleOption *op
&& !hasStyleRule(w, PseudoElement_MdiMinButton)) && !hasStyleRule(w, PseudoElement_MdiMinButton))
break; break;
QList<QVariant> layout = rule.styleHint(QLatin1String("button-layout")).toList(); QList<QVariant> layout = rule.styleHint("button-layout"_L1).toList();
if (layout.isEmpty()) if (layout.isEmpty())
layout = subControlLayout(QLatin1String("mNX")); layout = subControlLayout("mNX"_L1);
int width = 0, height = 0; int width = 0, height = 0;
for (int i = 0; i < layout.count(); i++) { for (int i = 0; i < layout.count(); i++) {
@ -5505,62 +5504,62 @@ QSize QStyleSheetStyle::sizeFromContents(ContentsType ct, const QStyleOption *op
static QLatin1String propertyNameForStandardPixmap(QStyle::StandardPixmap sp) static QLatin1String propertyNameForStandardPixmap(QStyle::StandardPixmap sp)
{ {
switch (sp) { switch (sp) {
case QStyle::SP_TitleBarMenuButton: return QLatin1String("titlebar-menu-icon"); case QStyle::SP_TitleBarMenuButton: return "titlebar-menu-icon"_L1;
case QStyle::SP_TitleBarMinButton: return QLatin1String("titlebar-minimize-icon"); case QStyle::SP_TitleBarMinButton: return "titlebar-minimize-icon"_L1;
case QStyle::SP_TitleBarMaxButton: return QLatin1String("titlebar-maximize-icon"); case QStyle::SP_TitleBarMaxButton: return "titlebar-maximize-icon"_L1;
case QStyle::SP_TitleBarCloseButton: return QLatin1String("titlebar-close-icon"); case QStyle::SP_TitleBarCloseButton: return "titlebar-close-icon"_L1;
case QStyle::SP_TitleBarNormalButton: return QLatin1String("titlebar-normal-icon"); case QStyle::SP_TitleBarNormalButton: return "titlebar-normal-icon"_L1;
case QStyle::SP_TitleBarShadeButton: return QLatin1String("titlebar-shade-icon"); case QStyle::SP_TitleBarShadeButton: return "titlebar-shade-icon"_L1;
case QStyle::SP_TitleBarUnshadeButton: return QLatin1String("titlebar-unshade-icon"); case QStyle::SP_TitleBarUnshadeButton: return "titlebar-unshade-icon"_L1;
case QStyle::SP_TitleBarContextHelpButton: return QLatin1String("titlebar-contexthelp-icon"); case QStyle::SP_TitleBarContextHelpButton: return "titlebar-contexthelp-icon"_L1;
case QStyle::SP_DockWidgetCloseButton: return QLatin1String("dockwidget-close-icon"); case QStyle::SP_DockWidgetCloseButton: return "dockwidget-close-icon"_L1;
case QStyle::SP_MessageBoxInformation: return QLatin1String("messagebox-information-icon"); case QStyle::SP_MessageBoxInformation: return "messagebox-information-icon"_L1;
case QStyle::SP_MessageBoxWarning: return QLatin1String("messagebox-warning-icon"); case QStyle::SP_MessageBoxWarning: return "messagebox-warning-icon"_L1;
case QStyle::SP_MessageBoxCritical: return QLatin1String("messagebox-critical-icon"); case QStyle::SP_MessageBoxCritical: return "messagebox-critical-icon"_L1;
case QStyle::SP_MessageBoxQuestion: return QLatin1String("messagebox-question-icon"); case QStyle::SP_MessageBoxQuestion: return "messagebox-question-icon"_L1;
case QStyle::SP_DesktopIcon: return QLatin1String("desktop-icon"); case QStyle::SP_DesktopIcon: return "desktop-icon"_L1;
case QStyle::SP_TrashIcon: return QLatin1String("trash-icon"); case QStyle::SP_TrashIcon: return "trash-icon"_L1;
case QStyle::SP_ComputerIcon: return QLatin1String("computer-icon"); case QStyle::SP_ComputerIcon: return "computer-icon"_L1;
case QStyle::SP_DriveFDIcon: return QLatin1String("floppy-icon"); case QStyle::SP_DriveFDIcon: return "floppy-icon"_L1;
case QStyle::SP_DriveHDIcon: return QLatin1String("harddisk-icon"); case QStyle::SP_DriveHDIcon: return "harddisk-icon"_L1;
case QStyle::SP_DriveCDIcon: return QLatin1String("cd-icon"); case QStyle::SP_DriveCDIcon: return "cd-icon"_L1;
case QStyle::SP_DriveDVDIcon: return QLatin1String("dvd-icon"); case QStyle::SP_DriveDVDIcon: return "dvd-icon"_L1;
case QStyle::SP_DriveNetIcon: return QLatin1String("network-icon"); case QStyle::SP_DriveNetIcon: return "network-icon"_L1;
case QStyle::SP_DirOpenIcon: return QLatin1String("directory-open-icon"); case QStyle::SP_DirOpenIcon: return "directory-open-icon"_L1;
case QStyle::SP_DirClosedIcon: return QLatin1String("directory-closed-icon"); case QStyle::SP_DirClosedIcon: return "directory-closed-icon"_L1;
case QStyle::SP_DirLinkIcon: return QLatin1String("directory-link-icon"); case QStyle::SP_DirLinkIcon: return "directory-link-icon"_L1;
case QStyle::SP_FileIcon: return QLatin1String("file-icon"); case QStyle::SP_FileIcon: return "file-icon"_L1;
case QStyle::SP_FileLinkIcon: return QLatin1String("file-link-icon"); case QStyle::SP_FileLinkIcon: return "file-link-icon"_L1;
case QStyle::SP_FileDialogStart: return QLatin1String("filedialog-start-icon"); case QStyle::SP_FileDialogStart: return "filedialog-start-icon"_L1;
case QStyle::SP_FileDialogEnd: return QLatin1String("filedialog-end-icon"); case QStyle::SP_FileDialogEnd: return "filedialog-end-icon"_L1;
case QStyle::SP_FileDialogToParent: return QLatin1String("filedialog-parent-directory-icon"); case QStyle::SP_FileDialogToParent: return "filedialog-parent-directory-icon"_L1;
case QStyle::SP_FileDialogNewFolder: return QLatin1String("filedialog-new-directory-icon"); case QStyle::SP_FileDialogNewFolder: return "filedialog-new-directory-icon"_L1;
case QStyle::SP_FileDialogDetailedView: return QLatin1String("filedialog-detailedview-icon"); case QStyle::SP_FileDialogDetailedView: return "filedialog-detailedview-icon"_L1;
case QStyle::SP_FileDialogInfoView: return QLatin1String("filedialog-infoview-icon"); case QStyle::SP_FileDialogInfoView: return "filedialog-infoview-icon"_L1;
case QStyle::SP_FileDialogContentsView: return QLatin1String("filedialog-contentsview-icon"); case QStyle::SP_FileDialogContentsView: return "filedialog-contentsview-icon"_L1;
case QStyle::SP_FileDialogListView: return QLatin1String("filedialog-listview-icon"); case QStyle::SP_FileDialogListView: return "filedialog-listview-icon"_L1;
case QStyle::SP_FileDialogBack: return QLatin1String("filedialog-backward-icon"); case QStyle::SP_FileDialogBack: return "filedialog-backward-icon"_L1;
case QStyle::SP_DirIcon: return QLatin1String("directory-icon"); case QStyle::SP_DirIcon: return "directory-icon"_L1;
case QStyle::SP_DialogOkButton: return QLatin1String("dialog-ok-icon"); case QStyle::SP_DialogOkButton: return "dialog-ok-icon"_L1;
case QStyle::SP_DialogCancelButton: return QLatin1String("dialog-cancel-icon"); case QStyle::SP_DialogCancelButton: return "dialog-cancel-icon"_L1;
case QStyle::SP_DialogHelpButton: return QLatin1String("dialog-help-icon"); case QStyle::SP_DialogHelpButton: return "dialog-help-icon"_L1;
case QStyle::SP_DialogOpenButton: return QLatin1String("dialog-open-icon"); case QStyle::SP_DialogOpenButton: return "dialog-open-icon"_L1;
case QStyle::SP_DialogSaveButton: return QLatin1String("dialog-save-icon"); case QStyle::SP_DialogSaveButton: return "dialog-save-icon"_L1;
case QStyle::SP_DialogCloseButton: return QLatin1String("dialog-close-icon"); case QStyle::SP_DialogCloseButton: return "dialog-close-icon"_L1;
case QStyle::SP_DialogApplyButton: return QLatin1String("dialog-apply-icon"); case QStyle::SP_DialogApplyButton: return "dialog-apply-icon"_L1;
case QStyle::SP_DialogResetButton: return QLatin1String("dialog-reset-icon"); case QStyle::SP_DialogResetButton: return "dialog-reset-icon"_L1;
case QStyle::SP_DialogDiscardButton: return QLatin1String("dialog-discard-icon"); case QStyle::SP_DialogDiscardButton: return "dialog-discard-icon"_L1;
case QStyle::SP_DialogYesButton: return QLatin1String("dialog-yes-icon"); case QStyle::SP_DialogYesButton: return "dialog-yes-icon"_L1;
case QStyle::SP_DialogNoButton: return QLatin1String("dialog-no-icon"); case QStyle::SP_DialogNoButton: return "dialog-no-icon"_L1;
case QStyle::SP_ArrowUp: return QLatin1String("uparrow-icon"); case QStyle::SP_ArrowUp: return "uparrow-icon"_L1;
case QStyle::SP_ArrowDown: return QLatin1String("downarrow-icon"); case QStyle::SP_ArrowDown: return "downarrow-icon"_L1;
case QStyle::SP_ArrowLeft: return QLatin1String("leftarrow-icon"); case QStyle::SP_ArrowLeft: return "leftarrow-icon"_L1;
case QStyle::SP_ArrowRight: return QLatin1String("rightarrow-icon"); case QStyle::SP_ArrowRight: return "rightarrow-icon"_L1;
case QStyle::SP_ArrowBack: return QLatin1String("backward-icon"); case QStyle::SP_ArrowBack: return "backward-icon"_L1;
case QStyle::SP_ArrowForward: return QLatin1String("forward-icon"); case QStyle::SP_ArrowForward: return "forward-icon"_L1;
case QStyle::SP_DirHomeIcon: return QLatin1String("home-icon"); case QStyle::SP_DirHomeIcon: return "home-icon"_L1;
case QStyle::SP_LineEditClearButton: return QLatin1String("lineedit-clear-button-icon"); case QStyle::SP_LineEditClearButton: return "lineedit-clear-button-icon"_L1;
default: return QLatin1String(""); default: return ""_L1;
} }
} }
@ -5616,25 +5615,25 @@ int QStyleSheetStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWi
QRenderRule rule = renderRule(w, opt); QRenderRule rule = renderRule(w, opt);
QString s; QString s;
switch (sh) { switch (sh) {
case SH_LineEdit_PasswordCharacter: s = QLatin1String("lineedit-password-character"); break; case SH_LineEdit_PasswordCharacter: s = "lineedit-password-character"_L1; break;
case SH_LineEdit_PasswordMaskDelay: s = QLatin1String("lineedit-password-mask-delay"); break; case SH_LineEdit_PasswordMaskDelay: s = "lineedit-password-mask-delay"_L1; break;
case SH_DitherDisabledText: s = QLatin1String("dither-disabled-text"); break; case SH_DitherDisabledText: s = "dither-disabled-text"_L1; break;
case SH_EtchDisabledText: s = QLatin1String("etch-disabled-text"); break; case SH_EtchDisabledText: s = "etch-disabled-text"_L1; break;
case SH_ItemView_ActivateItemOnSingleClick: s = QLatin1String("activate-on-singleclick"); break; case SH_ItemView_ActivateItemOnSingleClick: s = "activate-on-singleclick"_L1; break;
case SH_ItemView_ShowDecorationSelected: s = QLatin1String("show-decoration-selected"); break; case SH_ItemView_ShowDecorationSelected: s = "show-decoration-selected"_L1; break;
case SH_Table_GridLineColor: s = QLatin1String("gridline-color"); break; case SH_Table_GridLineColor: s = "gridline-color"_L1; break;
case SH_DialogButtonLayout: s = QLatin1String("button-layout"); break; case SH_DialogButtonLayout: s = "button-layout"_L1; break;
case SH_ToolTipLabel_Opacity: s = QLatin1String("opacity"); break; case SH_ToolTipLabel_Opacity: s = "opacity"_L1; break;
case SH_ComboBox_Popup: s = QLatin1String("combobox-popup"); break; case SH_ComboBox_Popup: s = "combobox-popup"_L1; break;
case SH_ComboBox_ListMouseTracking: s = QLatin1String("combobox-list-mousetracking"); break; case SH_ComboBox_ListMouseTracking: s = "combobox-list-mousetracking"_L1; break;
case SH_MenuBar_AltKeyNavigation: s = QLatin1String("menubar-altkey-navigation"); break; case SH_MenuBar_AltKeyNavigation: s = "menubar-altkey-navigation"_L1; break;
case SH_Menu_Scrollable: s = QLatin1String("menu-scrollable"); break; case SH_Menu_Scrollable: s = "menu-scrollable"_L1; break;
case SH_DrawMenuBarSeparator: s = QLatin1String("menubar-separator"); break; case SH_DrawMenuBarSeparator: s = "menubar-separator"_L1; break;
case SH_MenuBar_MouseTracking: s = QLatin1String("mouse-tracking"); break; case SH_MenuBar_MouseTracking: s = "mouse-tracking"_L1; break;
case SH_SpinBox_ClickAutoRepeatRate: s = QLatin1String("spinbox-click-autorepeat-rate"); break; case SH_SpinBox_ClickAutoRepeatRate: s = "spinbox-click-autorepeat-rate"_L1; break;
case SH_SpinControls_DisableOnBounds: s = QLatin1String("spincontrol-disable-on-bounds"); break; case SH_SpinControls_DisableOnBounds: s = "spincontrol-disable-on-bounds"_L1; break;
case SH_MessageBox_TextInteractionFlags: s = QLatin1String("messagebox-text-interaction-flags"); break; case SH_MessageBox_TextInteractionFlags: s = "messagebox-text-interaction-flags"_L1; break;
case SH_ToolButton_PopupDelay: s = QLatin1String("toolbutton-popup-delay"); break; case SH_ToolButton_PopupDelay: s = "toolbutton-popup-delay"_L1; break;
case SH_ToolBox_SelectedPageTitleBold: case SH_ToolBox_SelectedPageTitleBold:
if (renderRule(w, opt, PseudoElement_ToolBoxTab).hasFont) if (renderRule(w, opt, PseudoElement_ToolBoxTab).hasFont)
return 0; return 0;
@ -5643,12 +5642,12 @@ int QStyleSheetStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWi
if (rule.hasPalette() && rule.palette()->foreground.style() != Qt::NoBrush) if (rule.hasPalette() && rule.palette()->foreground.style() != Qt::NoBrush)
return rule.palette()->foreground.color().rgba(); return rule.palette()->foreground.color().rgba();
break; break;
case SH_ScrollView_FrameOnlyAroundContents: s = QLatin1String("scrollview-frame-around-contents"); break; case SH_ScrollView_FrameOnlyAroundContents: s = "scrollview-frame-around-contents"_L1; break;
case SH_ScrollBar_ContextMenu: s = QLatin1String("scrollbar-contextmenu"); break; case SH_ScrollBar_ContextMenu: s = "scrollbar-contextmenu"_L1; break;
case SH_ScrollBar_LeftClickAbsolutePosition: s = QLatin1String("scrollbar-leftclick-absolute-position"); break; case SH_ScrollBar_LeftClickAbsolutePosition: s = "scrollbar-leftclick-absolute-position"_L1; break;
case SH_ScrollBar_MiddleClickAbsolutePosition: s = QLatin1String("scrollbar-middleclick-absolute-position"); break; case SH_ScrollBar_MiddleClickAbsolutePosition: s = "scrollbar-middleclick-absolute-position"_L1; break;
case SH_ScrollBar_RollBetweenButtons: s = QLatin1String("scrollbar-roll-between-buttons"); break; case SH_ScrollBar_RollBetweenButtons: s = "scrollbar-roll-between-buttons"_L1; break;
case SH_ScrollBar_ScrollWhenPointerLeavesControl: s = QLatin1String("scrollbar-scroll-when-pointer-leaves-control"); break; case SH_ScrollBar_ScrollWhenPointerLeavesControl: s = "scrollbar-scroll-when-pointer-leaves-control"_L1; break;
case SH_TabBar_Alignment: case SH_TabBar_Alignment:
#if QT_CONFIG(tabwidget) #if QT_CONFIG(tabwidget)
if (qobject_cast<const QTabWidget *>(w)) { if (qobject_cast<const QTabWidget *>(w)) {
@ -5657,7 +5656,7 @@ int QStyleSheetStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWi
return rule.position()->position; return rule.position()->position;
} }
#endif // QT_CONFIG(tabwidget) #endif // QT_CONFIG(tabwidget)
s = QLatin1String("alignment"); s = "alignment"_L1;
break; break;
#if QT_CONFIG(tabbar) #if QT_CONFIG(tabbar)
case SH_TabBar_CloseButtonPosition: case SH_TabBar_CloseButtonPosition:
@ -5671,8 +5670,8 @@ int QStyleSheetStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWi
} }
break; break;
#endif #endif
case SH_TabBar_ElideMode: s = QLatin1String("tabbar-elide-mode"); break; case SH_TabBar_ElideMode: s = "tabbar-elide-mode"_L1; break;
case SH_TabBar_PreferNoArrows: s = QLatin1String("tabbar-prefer-no-arrows"); break; case SH_TabBar_PreferNoArrows: s = "tabbar-prefer-no-arrows"_L1; break;
case SH_ComboBox_PopupFrameStyle: case SH_ComboBox_PopupFrameStyle:
#if QT_CONFIG(combobox) #if QT_CONFIG(combobox)
if (qobject_cast<const QComboBox *>(w)) { if (qobject_cast<const QComboBox *>(w)) {
@ -5686,8 +5685,8 @@ int QStyleSheetStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWi
} }
#endif // QT_CONFIG(combobox) #endif // QT_CONFIG(combobox)
break; break;
case SH_DialogButtonBox_ButtonsHaveIcons: s = QLatin1String("dialogbuttonbox-buttons-have-icons"); break; case SH_DialogButtonBox_ButtonsHaveIcons: s = "dialogbuttonbox-buttons-have-icons"_L1; break;
case SH_Workspace_FillSpaceOnMaximize: s = QLatin1String("mdi-fill-space-on-maximize"); break; case SH_Workspace_FillSpaceOnMaximize: s = "mdi-fill-space-on-maximize"_L1; break;
case SH_TitleBar_NoBorder: case SH_TitleBar_NoBorder:
if (rule.hasBorder()) if (rule.hasBorder())
return !rule.border()->borders[LeftEdge]; return !rule.border()->borders[LeftEdge];
@ -5698,10 +5697,10 @@ int QStyleSheetStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWi
return 1; return 1;
break; break;
} }
case SH_ItemView_ArrowKeysNavigateIntoChildren: s = QLatin1String("arrow-keys-navigate-into-children"); break; case SH_ItemView_ArrowKeysNavigateIntoChildren: s = "arrow-keys-navigate-into-children"_L1; break;
case SH_ItemView_PaintAlternatingRowColorsForEmptyArea: s = QLatin1String("paint-alternating-row-colors-for-empty-area"); break; case SH_ItemView_PaintAlternatingRowColorsForEmptyArea: s = "paint-alternating-row-colors-for-empty-area"_L1; break;
case SH_TitleBar_ShowToolTipsOnButtons: s = QLatin1String("titlebar-show-tooltips-on-buttons"); break; case SH_TitleBar_ShowToolTipsOnButtons: s = "titlebar-show-tooltips-on-buttons"_L1; break;
case SH_Widget_Animation_Duration: s = QLatin1String("widget-animation-duration"); break; case SH_Widget_Animation_Duration: s = "widget-animation-duration"_L1; break;
case SH_ScrollBar_Transient: case SH_ScrollBar_Transient:
if (!rule.hasNativeBorder() || rule.hasBox()) if (!rule.hasNativeBorder() || rule.hasBox())
return 0; return 0;
@ -6024,9 +6023,9 @@ QRect QStyleSheetStyle::subControlRect(ComplexControl cc, const QStyleOptionComp
if (hasStyleRule(w, PseudoElement_MdiCloseButton) if (hasStyleRule(w, PseudoElement_MdiCloseButton)
|| hasStyleRule(w, PseudoElement_MdiNormalButton) || hasStyleRule(w, PseudoElement_MdiNormalButton)
|| hasStyleRule(w, PseudoElement_MdiMinButton)) { || hasStyleRule(w, PseudoElement_MdiMinButton)) {
QList<QVariant> layout = rule.styleHint(QLatin1String("button-layout")).toList(); QList<QVariant> layout = rule.styleHint("button-layout"_L1).toList();
if (layout.isEmpty()) if (layout.isEmpty())
layout = subControlLayout(QLatin1String("mNX")); layout = subControlLayout("mNX"_L1);
int x = 0, width = 0; int x = 0, width = 0;
QRenderRule subRule; QRenderRule subRule;
@ -6350,7 +6349,7 @@ void QStyleSheetStyle::updateStyleSheetFont(QWidget* w) const
{ {
// Qt's fontDialog relies on the font of the sample edit for its selection, // Qt's fontDialog relies on the font of the sample edit for its selection,
// we should never override it. // we should never override it.
if (w->objectName() == QLatin1String("qt_fontDialog_sampleEdit")) if (w->objectName() == "qt_fontDialog_sampleEdit"_L1)
return; return;
QWidget *container = containerWidget(w); QWidget *container = containerWidget(w);
@ -6448,7 +6447,7 @@ Qt::Alignment QStyleSheetStyle::resolveAlignment(Qt::LayoutDirection layDir, Qt:
// (and hence has the correct object name). // (and hence has the correct object name).
bool QStyleSheetStyle::isNaturalChild(const QObject *obj) bool QStyleSheetStyle::isNaturalChild(const QObject *obj)
{ {
if (obj->objectName().startsWith(QLatin1String("qt_"))) if (obj->objectName().startsWith("qt_"_L1))
return true; return true;
return false; return false;

View File

@ -54,6 +54,7 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
using namespace QCss; using namespace QCss;
// This is the class name of the selector. // This is the class name of the selector.
@ -164,19 +165,19 @@ StyleSheet QStyleSheetStyle::getDefaultStyleSheet() const
-qt-style-features: background-color; -qt-style-features: background-color;
}*/ }*/
{ {
SET_ELEMENT_NAME(QLatin1String("QLineEdit")); SET_ELEMENT_NAME("QLineEdit"_L1);
ADD_BASIC_SELECTOR; ADD_BASIC_SELECTOR;
ADD_SELECTOR; ADD_SELECTOR;
SET_PROPERTY(QLatin1String("-qt-background-role"), QtBackgroundRole); SET_PROPERTY("-qt-background-role"_L1, QtBackgroundRole);
ADD_VALUE(Value::KnownIdentifier, Value_Base); ADD_VALUE(Value::KnownIdentifier, Value_Base);
ADD_DECLARATION; ADD_DECLARATION;
SET_PROPERTY(QLatin1String("border"), Border); SET_PROPERTY("border"_L1, Border);
ADD_VALUE(Value::KnownIdentifier, Value_Native); ADD_VALUE(Value::KnownIdentifier, Value_Native);
ADD_DECLARATION; ADD_DECLARATION;
SET_PROPERTY(QLatin1String("-qt-style-features"), QtStyleFeatures); SET_PROPERTY("-qt-style-features"_L1, QtStyleFeatures);
ADD_VALUE(Value::Identifier, QString::fromLatin1("background-color")); ADD_VALUE(Value::Identifier, QString::fromLatin1("background-color"));
ADD_DECLARATION; ADD_DECLARATION;
@ -187,12 +188,12 @@ StyleSheet QStyleSheetStyle::getDefaultStyleSheet() const
border: none; border: none;
}*/ }*/
{ {
SET_ELEMENT_NAME(QLatin1String("QLineEdit")); SET_ELEMENT_NAME("QLineEdit"_L1);
ADD_PSEUDO(QLatin1String("no-frame"), PseudoClass_Frameless); ADD_PSEUDO("no-frame"_L1, PseudoClass_Frameless);
ADD_BASIC_SELECTOR; ADD_BASIC_SELECTOR;
ADD_SELECTOR; ADD_SELECTOR;
SET_PROPERTY(QLatin1String("border"), Border); SET_PROPERTY("border"_L1, Border);
ADD_VALUE(Value::KnownIdentifier, Value_None); ADD_VALUE(Value::KnownIdentifier, Value_None);
ADD_DECLARATION; ADD_DECLARATION;
@ -203,11 +204,11 @@ StyleSheet QStyleSheetStyle::getDefaultStyleSheet() const
border: native; border: native;
}*/ }*/
{ {
SET_ELEMENT_NAME(QLatin1String("QFrame")); SET_ELEMENT_NAME("QFrame"_L1);
ADD_BASIC_SELECTOR; ADD_BASIC_SELECTOR;
ADD_SELECTOR; ADD_SELECTOR;
SET_PROPERTY(QLatin1String("border"), Border); SET_PROPERTY("border"_L1, Border);
ADD_VALUE(Value::KnownIdentifier, Value_Native); ADD_VALUE(Value::KnownIdentifier, Value_Native);
ADD_DECLARATION; ADD_DECLARATION;
@ -219,19 +220,19 @@ StyleSheet QStyleSheetStyle::getDefaultStyleSheet() const
border-image: none; border-image: none;
}*/ }*/
{ {
SET_ELEMENT_NAME(QLatin1String("QLabel")); SET_ELEMENT_NAME("QLabel"_L1);
ADD_BASIC_SELECTOR; ADD_BASIC_SELECTOR;
ADD_SELECTOR; ADD_SELECTOR;
SET_ELEMENT_NAME(QLatin1String("QToolBox")); SET_ELEMENT_NAME("QToolBox"_L1);
ADD_BASIC_SELECTOR; ADD_BASIC_SELECTOR;
ADD_SELECTOR; ADD_SELECTOR;
SET_PROPERTY(QLatin1String("background"), Background); SET_PROPERTY("background"_L1, Background);
ADD_VALUE(Value::KnownIdentifier, Value_None); ADD_VALUE(Value::KnownIdentifier, Value_None);
ADD_DECLARATION; ADD_DECLARATION;
SET_PROPERTY(QLatin1String("border-image"), BorderImage); SET_PROPERTY("border-image"_L1, BorderImage);
ADD_VALUE(Value::KnownIdentifier, Value_None); ADD_VALUE(Value::KnownIdentifier, Value_None);
ADD_DECLARATION; ADD_DECLARATION;
@ -242,11 +243,11 @@ StyleSheet QStyleSheetStyle::getDefaultStyleSheet() const
border: native; border: native;
}*/ }*/
{ {
SET_ELEMENT_NAME(QLatin1String("QGroupBox")); SET_ELEMENT_NAME("QGroupBox"_L1);
ADD_BASIC_SELECTOR; ADD_BASIC_SELECTOR;
ADD_SELECTOR; ADD_SELECTOR;
SET_PROPERTY(QLatin1String("border"), Border); SET_PROPERTY("border"_L1, Border);
ADD_VALUE(Value::KnownIdentifier, Value_Native); ADD_VALUE(Value::KnownIdentifier, Value_Native);
ADD_DECLARATION; ADD_DECLARATION;
@ -259,15 +260,15 @@ StyleSheet QStyleSheetStyle::getDefaultStyleSheet() const
border: native; border: native;
}*/ }*/
{ {
SET_ELEMENT_NAME(QLatin1String("QToolTip")); SET_ELEMENT_NAME("QToolTip"_L1);
ADD_BASIC_SELECTOR; ADD_BASIC_SELECTOR;
ADD_SELECTOR; ADD_SELECTOR;
SET_PROPERTY(QLatin1String("-qt-background-role"), QtBackgroundRole); SET_PROPERTY("-qt-background-role"_L1, QtBackgroundRole);
ADD_VALUE(Value::KnownIdentifier, Value_Window); ADD_VALUE(Value::KnownIdentifier, Value_Window);
ADD_DECLARATION; ADD_DECLARATION;
SET_PROPERTY(QLatin1String("border"), Border); SET_PROPERTY("border"_L1, Border);
ADD_VALUE(Value::KnownIdentifier, Value_Native); ADD_VALUE(Value::KnownIdentifier, Value_Native);
ADD_DECLARATION; ADD_DECLARATION;
@ -279,20 +280,20 @@ StyleSheet QStyleSheetStyle::getDefaultStyleSheet() const
-qt-style-features: background-color; //only for not pixmap based styles -qt-style-features: background-color; //only for not pixmap based styles
}*/ }*/
{ {
SET_ELEMENT_NAME(QLatin1String("QPushButton")); SET_ELEMENT_NAME("QPushButton"_L1);
ADD_BASIC_SELECTOR; ADD_BASIC_SELECTOR;
ADD_SELECTOR; ADD_SELECTOR;
SET_ELEMENT_NAME(QLatin1String("QToolButton")); SET_ELEMENT_NAME("QToolButton"_L1);
ADD_BASIC_SELECTOR; ADD_BASIC_SELECTOR;
ADD_SELECTOR; ADD_SELECTOR;
SET_PROPERTY(QLatin1String("border-style"), BorderStyles); SET_PROPERTY("border-style"_L1, BorderStyles);
ADD_VALUE(Value::KnownIdentifier, Value_Native); ADD_VALUE(Value::KnownIdentifier, Value_Native);
ADD_DECLARATION; ADD_DECLARATION;
if (!styleIsPixmapBased) { if (!styleIsPixmapBased) {
SET_PROPERTY(QLatin1String("-qt-style-features"), QtStyleFeatures); SET_PROPERTY("-qt-style-features"_L1, QtStyleFeatures);
ADD_VALUE(Value::Identifier, QString::fromLatin1("background-color")); ADD_VALUE(Value::Identifier, QString::fromLatin1("background-color"));
ADD_DECLARATION; ADD_DECLARATION;
} }
@ -309,22 +310,22 @@ StyleSheet QStyleSheetStyle::getDefaultStyleSheet() const
}*/ }*/
{ {
SET_ELEMENT_NAME(QLatin1String("QComboBox")); SET_ELEMENT_NAME("QComboBox"_L1);
ADD_BASIC_SELECTOR; ADD_BASIC_SELECTOR;
ADD_SELECTOR; ADD_SELECTOR;
SET_PROPERTY(QLatin1String("border"), Border); SET_PROPERTY("border"_L1, Border);
ADD_VALUE(Value::KnownIdentifier, Value_Native); ADD_VALUE(Value::KnownIdentifier, Value_Native);
ADD_DECLARATION; ADD_DECLARATION;
if (!styleIsPixmapBased) { if (!styleIsPixmapBased) {
SET_PROPERTY(QLatin1String("-qt-style-features"), QtStyleFeatures); SET_PROPERTY("-qt-style-features"_L1, QtStyleFeatures);
ADD_VALUE(Value::Identifier, QString::fromLatin1("background-color")); ADD_VALUE(Value::Identifier, QString::fromLatin1("background-color"));
ADD_VALUE(Value::Identifier, QString::fromLatin1("background-gradient")); ADD_VALUE(Value::Identifier, QString::fromLatin1("background-gradient"));
ADD_DECLARATION; ADD_DECLARATION;
} }
SET_PROPERTY(QLatin1String("-qt-background-role"), QtBackgroundRole); SET_PROPERTY("-qt-background-role"_L1, QtBackgroundRole);
ADD_VALUE(Value::KnownIdentifier, Value_Base); ADD_VALUE(Value::KnownIdentifier, Value_Base);
ADD_DECLARATION; ADD_DECLARATION;
@ -339,12 +340,12 @@ StyleSheet QStyleSheetStyle::getDefaultStyleSheet() const
}*/ }*/
if (baseStyle()->inherits("QPlastiqueStyle") || baseStyle()->inherits("QCleanlooksStyle") || baseStyle()->inherits("QFusionStyle")) if (baseStyle()->inherits("QPlastiqueStyle") || baseStyle()->inherits("QCleanlooksStyle") || baseStyle()->inherits("QFusionStyle"))
{ {
SET_ELEMENT_NAME(QLatin1String("QComboBox")); SET_ELEMENT_NAME("QComboBox"_L1);
ADD_ATTRIBUTE_SELECTOR(QLatin1String("readOnly"), QLatin1String("true"), AttributeSelector::MatchEqual); ADD_ATTRIBUTE_SELECTOR("readOnly"_L1, "true"_L1, AttributeSelector::MatchEqual);
ADD_BASIC_SELECTOR; ADD_BASIC_SELECTOR;
ADD_SELECTOR; ADD_SELECTOR;
SET_PROPERTY(QLatin1String("-qt-background-role"), QtBackgroundRole); SET_PROPERTY("-qt-background-role"_L1, QtBackgroundRole);
ADD_VALUE(Value::KnownIdentifier, Value_Button); ADD_VALUE(Value::KnownIdentifier, Value_Button);
ADD_DECLARATION; ADD_DECLARATION;
@ -357,19 +358,19 @@ StyleSheet QStyleSheetStyle::getDefaultStyleSheet() const
-qt-background-role: base; -qt-background-role: base;
}*/ }*/
{ {
SET_ELEMENT_NAME(QLatin1String("QAbstractSpinBox")); SET_ELEMENT_NAME("QAbstractSpinBox"_L1);
ADD_BASIC_SELECTOR; ADD_BASIC_SELECTOR;
ADD_SELECTOR; ADD_SELECTOR;
SET_PROPERTY(QLatin1String("border"), Border); SET_PROPERTY("border"_L1, Border);
ADD_VALUE(Value::KnownIdentifier, Value_Native); ADD_VALUE(Value::KnownIdentifier, Value_Native);
ADD_DECLARATION; ADD_DECLARATION;
SET_PROPERTY(QLatin1String("-qt-style-features"), QtStyleFeatures); SET_PROPERTY("-qt-style-features"_L1, QtStyleFeatures);
ADD_VALUE(Value::Identifier, QString::fromLatin1("background-color")); ADD_VALUE(Value::Identifier, QString::fromLatin1("background-color"));
ADD_DECLARATION; ADD_DECLARATION;
SET_PROPERTY(QLatin1String("-qt-background-role"), QtBackgroundRole); SET_PROPERTY("-qt-background-role"_L1, QtBackgroundRole);
ADD_VALUE(Value::KnownIdentifier, Value_Base); ADD_VALUE(Value::KnownIdentifier, Value_Base);
ADD_DECLARATION; ADD_DECLARATION;
@ -380,11 +381,11 @@ StyleSheet QStyleSheetStyle::getDefaultStyleSheet() const
-qt-background-role: window; -qt-background-role: window;
}*/ }*/
{ {
SET_ELEMENT_NAME(QLatin1String("QMenu")); SET_ELEMENT_NAME("QMenu"_L1);
ADD_BASIC_SELECTOR; ADD_BASIC_SELECTOR;
ADD_SELECTOR; ADD_SELECTOR;
SET_PROPERTY(QLatin1String("-qt-background-role"), QtBackgroundRole); SET_PROPERTY("-qt-background-role"_L1, QtBackgroundRole);
ADD_VALUE(Value::KnownIdentifier, Value_Window); ADD_VALUE(Value::KnownIdentifier, Value_Window);
ADD_DECLARATION; ADD_DECLARATION;
@ -394,12 +395,12 @@ StyleSheet QStyleSheetStyle::getDefaultStyleSheet() const
-qt-style-features: background-color; -qt-style-features: background-color;
}*/ }*/
if (!styleIsPixmapBased) { if (!styleIsPixmapBased) {
SET_ELEMENT_NAME(QLatin1String("QMenu")); SET_ELEMENT_NAME("QMenu"_L1);
ADD_PSEUDO(QLatin1String("item"), PseudoClass_Unknown); ADD_PSEUDO("item"_L1, PseudoClass_Unknown);
ADD_BASIC_SELECTOR; ADD_BASIC_SELECTOR;
ADD_SELECTOR; ADD_SELECTOR;
SET_PROPERTY(QLatin1String("-qt-style-features"), QtStyleFeatures); SET_PROPERTY("-qt-style-features"_L1, QtStyleFeatures);
ADD_VALUE(Value::Identifier, QString::fromLatin1("background-color")); ADD_VALUE(Value::Identifier, QString::fromLatin1("background-color"));
ADD_DECLARATION; ADD_DECLARATION;
@ -410,11 +411,11 @@ StyleSheet QStyleSheetStyle::getDefaultStyleSheet() const
-qt-background-role: window; -qt-background-role: window;
}*/ }*/
{ {
SET_ELEMENT_NAME(QLatin1String("QHeaderView")); SET_ELEMENT_NAME("QHeaderView"_L1);
ADD_BASIC_SELECTOR; ADD_BASIC_SELECTOR;
ADD_SELECTOR; ADD_SELECTOR;
SET_PROPERTY(QLatin1String("-qt-background-role"), QtBackgroundRole); SET_PROPERTY("-qt-background-role"_L1, QtBackgroundRole);
ADD_VALUE(Value::KnownIdentifier, Value_Window); ADD_VALUE(Value::KnownIdentifier, Value_Window);
ADD_DECLARATION; ADD_DECLARATION;
@ -427,27 +428,27 @@ StyleSheet QStyleSheetStyle::getDefaultStyleSheet() const
border: native; border: native;
}*/ }*/
{ {
SET_ELEMENT_NAME(QLatin1String("QTableCornerButton")); SET_ELEMENT_NAME("QTableCornerButton"_L1);
ADD_PSEUDO(QLatin1String("section"), PseudoClass_Unknown); ADD_PSEUDO("section"_L1, PseudoClass_Unknown);
ADD_BASIC_SELECTOR; ADD_BASIC_SELECTOR;
ADD_SELECTOR; ADD_SELECTOR;
SET_ELEMENT_NAME(QLatin1String("QHeaderView")); SET_ELEMENT_NAME("QHeaderView"_L1);
ADD_PSEUDO(QLatin1String("section"), PseudoClass_Unknown); ADD_PSEUDO("section"_L1, PseudoClass_Unknown);
ADD_BASIC_SELECTOR; ADD_BASIC_SELECTOR;
ADD_SELECTOR; ADD_SELECTOR;
SET_PROPERTY(QLatin1String("-qt-background-role"), QtBackgroundRole); SET_PROPERTY("-qt-background-role"_L1, QtBackgroundRole);
ADD_VALUE(Value::KnownIdentifier, Value_Button); ADD_VALUE(Value::KnownIdentifier, Value_Button);
ADD_DECLARATION; ADD_DECLARATION;
if (!styleIsPixmapBased) { if (!styleIsPixmapBased) {
SET_PROPERTY(QLatin1String("-qt-style-features"), QtStyleFeatures); SET_PROPERTY("-qt-style-features"_L1, QtStyleFeatures);
ADD_VALUE(Value::Identifier, QString::fromLatin1("background-color")); ADD_VALUE(Value::Identifier, QString::fromLatin1("background-color"));
ADD_DECLARATION; ADD_DECLARATION;
} }
SET_PROPERTY(QLatin1String("border"), Border); SET_PROPERTY("border"_L1, Border);
ADD_VALUE(Value::KnownIdentifier, Value_Native); ADD_VALUE(Value::KnownIdentifier, Value_Native);
ADD_DECLARATION; ADD_DECLARATION;
@ -458,11 +459,11 @@ StyleSheet QStyleSheetStyle::getDefaultStyleSheet() const
-qt-background-role: base; -qt-background-role: base;
}*/ }*/
{ {
SET_ELEMENT_NAME(QLatin1String("QProgressBar")); SET_ELEMENT_NAME("QProgressBar"_L1);
ADD_BASIC_SELECTOR; ADD_BASIC_SELECTOR;
ADD_SELECTOR; ADD_SELECTOR;
SET_PROPERTY(QLatin1String("-qt-background-role"), QtBackgroundRole); SET_PROPERTY("-qt-background-role"_L1, QtBackgroundRole);
ADD_VALUE(Value::KnownIdentifier, Value_Base); ADD_VALUE(Value::KnownIdentifier, Value_Base);
ADD_DECLARATION; ADD_DECLARATION;
@ -473,11 +474,11 @@ StyleSheet QStyleSheetStyle::getDefaultStyleSheet() const
-qt-background-role: window; -qt-background-role: window;
}*/ }*/
{ {
SET_ELEMENT_NAME(QLatin1String("QScrollBar")); SET_ELEMENT_NAME("QScrollBar"_L1);
ADD_BASIC_SELECTOR; ADD_BASIC_SELECTOR;
ADD_SELECTOR; ADD_SELECTOR;
SET_PROPERTY(QLatin1String("-qt-background-role"), QtBackgroundRole); SET_PROPERTY("-qt-background-role"_L1, QtBackgroundRole);
ADD_VALUE(Value::KnownIdentifier, Value_Window); ADD_VALUE(Value::KnownIdentifier, Value_Window);
ADD_DECLARATION; ADD_DECLARATION;
@ -488,11 +489,11 @@ StyleSheet QStyleSheetStyle::getDefaultStyleSheet() const
border: native; border: native;
}*/ }*/
{ {
SET_ELEMENT_NAME(QLatin1String("QDockWidget")); SET_ELEMENT_NAME("QDockWidget"_L1);
ADD_BASIC_SELECTOR; ADD_BASIC_SELECTOR;
ADD_SELECTOR; ADD_SELECTOR;
SET_PROPERTY(QLatin1String("border"), Border); SET_PROPERTY("border"_L1, Border);
ADD_VALUE(Value::KnownIdentifier, Value_Native); ADD_VALUE(Value::KnownIdentifier, Value_Native);
ADD_DECLARATION; ADD_DECLARATION;

View File

@ -166,6 +166,8 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
QCompletionModel::QCompletionModel(QCompleterPrivate *c, QObject *parent) QCompletionModel::QCompletionModel(QCompleterPrivate *c, QObject *parent)
: QAbstractProxyModel(*new QCompletionModelPrivate, parent), : QAbstractProxyModel(*new QCompletionModelPrivate, parent),
c(c), showAll(false) c(c), showAll(false)
@ -1878,9 +1880,9 @@ QStringList QCompleter::splitPath(const QString& path) const
QString pathCopy = QDir::toNativeSeparators(path); QString pathCopy = QDir::toNativeSeparators(path);
#if defined(Q_OS_WIN) #if defined(Q_OS_WIN)
if (pathCopy == QLatin1String("\\") || pathCopy == QLatin1String("\\\\")) if (pathCopy == "\\"_L1 || pathCopy == "\\\\"_L1)
return QStringList(pathCopy); return QStringList(pathCopy);
const bool startsWithDoubleSlash = pathCopy.startsWith(QLatin1String("\\\\")); const bool startsWithDoubleSlash = pathCopy.startsWith("\\\\"_L1);
if (startsWithDoubleSlash) if (startsWithDoubleSlash)
pathCopy = pathCopy.mid(2); pathCopy = pathCopy.mid(2);
#endif #endif
@ -1890,7 +1892,7 @@ QStringList QCompleter::splitPath(const QString& path) const
#if defined(Q_OS_WIN) #if defined(Q_OS_WIN)
if (startsWithDoubleSlash) if (startsWithDoubleSlash)
parts[0].prepend(QLatin1String("\\\\")); parts[0].prepend("\\\\"_L1);
#else #else
if (pathCopy[0] == sep) // readd the "/" at the beginning as the split removed it if (pathCopy[0] == sep) // readd the "/" at the beginning as the split removed it
parts[0] = u'/'; parts[0] = u'/';

View File

@ -66,6 +66,8 @@
#ifndef QT_NO_SYSTEMTRAYICON #ifndef QT_NO_SYSTEMTRAYICON
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
static inline unsigned long locateSystemTray() static inline unsigned long locateSystemTray()
{ {
return (unsigned long)QGuiApplication::platformNativeInterface()->nativeResourceForScreen(QByteArrayLiteral("traywindow"), QGuiApplication::primaryScreen()); return (unsigned long)QGuiApplication::platformNativeInterface()->nativeResourceForScreen(QByteArrayLiteral("traywindow"), QGuiApplication::primaryScreen());
@ -321,7 +323,7 @@ bool QSystemTrayIconPrivate::isSystemTrayAvailable_sys()
// no QPlatformSystemTrayIcon so fall back to default xcb platform behavior // no QPlatformSystemTrayIcon so fall back to default xcb platform behavior
const QString platform = QGuiApplication::platformName(); const QString platform = QGuiApplication::platformName();
if (platform.compare(QLatin1String("xcb"), Qt::CaseInsensitive) == 0) if (platform.compare("xcb"_L1, Qt::CaseInsensitive) == 0)
return locateSystemTray(); return locateSystemTray();
return false; return false;
} }

View File

@ -68,6 +68,8 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
/*! /*!
\class QAbstractScrollArea \class QAbstractScrollArea
\brief The QAbstractScrollArea widget provides a scrolling area with \brief The QAbstractScrollArea widget provides a scrolling area with
@ -282,11 +284,11 @@ void QAbstractScrollAreaPrivate::init()
{ {
Q_Q(QAbstractScrollArea); Q_Q(QAbstractScrollArea);
viewport = new QWidget(q); viewport = new QWidget(q);
viewport->setObjectName(QLatin1String("qt_scrollarea_viewport")); viewport->setObjectName("qt_scrollarea_viewport"_L1);
viewport->setBackgroundRole(QPalette::Base); viewport->setBackgroundRole(QPalette::Base);
viewport->setAutoFillBackground(true); viewport->setAutoFillBackground(true);
scrollBarContainers[Qt::Horizontal] = new QAbstractScrollAreaScrollBarContainer(Qt::Horizontal, q); scrollBarContainers[Qt::Horizontal] = new QAbstractScrollAreaScrollBarContainer(Qt::Horizontal, q);
scrollBarContainers[Qt::Horizontal]->setObjectName(QLatin1String("qt_scrollarea_hcontainer")); scrollBarContainers[Qt::Horizontal]->setObjectName("qt_scrollarea_hcontainer"_L1);
hbar = scrollBarContainers[Qt::Horizontal]->scrollBar; hbar = scrollBarContainers[Qt::Horizontal]->scrollBar;
hbar->setRange(0,0); hbar->setRange(0,0);
scrollBarContainers[Qt::Horizontal]->setVisible(false); scrollBarContainers[Qt::Horizontal]->setVisible(false);
@ -294,7 +296,7 @@ void QAbstractScrollAreaPrivate::init()
QObject::connect(hbar, SIGNAL(valueChanged(int)), q, SLOT(_q_hslide(int))); QObject::connect(hbar, SIGNAL(valueChanged(int)), q, SLOT(_q_hslide(int)));
QObject::connect(hbar, SIGNAL(rangeChanged(int,int)), q, SLOT(_q_showOrHideScrollBars()), Qt::QueuedConnection); QObject::connect(hbar, SIGNAL(rangeChanged(int,int)), q, SLOT(_q_showOrHideScrollBars()), Qt::QueuedConnection);
scrollBarContainers[Qt::Vertical] = new QAbstractScrollAreaScrollBarContainer(Qt::Vertical, q); scrollBarContainers[Qt::Vertical] = new QAbstractScrollAreaScrollBarContainer(Qt::Vertical, q);
scrollBarContainers[Qt::Vertical]->setObjectName(QLatin1String("qt_scrollarea_vcontainer")); scrollBarContainers[Qt::Vertical]->setObjectName("qt_scrollarea_vcontainer"_L1);
vbar = scrollBarContainers[Qt::Vertical]->scrollBar; vbar = scrollBarContainers[Qt::Vertical]->scrollBar;
vbar->setRange(0,0); vbar->setRange(0,0);
scrollBarContainers[Qt::Vertical]->setVisible(false); scrollBarContainers[Qt::Vertical]->setVisible(false);

View File

@ -72,6 +72,8 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
/*! /*!
\class QAbstractSpinBox \class QAbstractSpinBox
\brief The QAbstractSpinBox class provides a spinbox and a line edit to \brief The QAbstractSpinBox class provides a spinbox and a line edit to
@ -1096,7 +1098,7 @@ void QAbstractSpinBox::keyPressEvent(QKeyEvent *event)
case Qt::Key_U: case Qt::Key_U:
if (event->modifiers() & Qt::ControlModifier if (event->modifiers() & Qt::ControlModifier
&& QGuiApplication::platformName() == QLatin1String("xcb")) { // only X11 && QGuiApplication::platformName() == "xcb"_L1) { // only X11
event->accept(); event->accept();
if (!isReadOnly()) if (!isReadOnly())
clear(); clear();
@ -1625,7 +1627,7 @@ void QAbstractSpinBoxPrivate::init()
Q_Q(QAbstractSpinBox); Q_Q(QAbstractSpinBox);
q->setLineEdit(new QLineEdit(q)); q->setLineEdit(new QLineEdit(q));
edit->setObjectName(QLatin1String("qt_spinbox_lineedit")); edit->setObjectName("qt_spinbox_lineedit"_L1);
validator = new QSpinBoxValidator(q, this); validator = new QSpinBoxValidator(q, this);
edit->setValidator(validator); edit->setValidator(validator);
@ -1969,7 +1971,7 @@ QVariant QAbstractSpinBoxPrivate::calculateAdaptiveDecimalStep(int steps) const
QSpinBoxValidator::QSpinBoxValidator(QAbstractSpinBox *qp, QAbstractSpinBoxPrivate *dp) QSpinBoxValidator::QSpinBoxValidator(QAbstractSpinBox *qp, QAbstractSpinBoxPrivate *dp)
: QValidator(qp), qptr(qp), dptr(dp) : QValidator(qp), qptr(qp), dptr(dp)
{ {
setObjectName(QLatin1String("qt_spinboxvalidator")); setObjectName("qt_spinboxvalidator"_L1);
} }
/*! /*!

View File

@ -128,7 +128,7 @@ public:
QVariant value, minimum, maximum, singleStep; QVariant value, minimum, maximum, singleStep;
QRect hoverRect; QRect hoverRect;
mutable QString cachedText = QLatin1String("\x01"); mutable QString cachedText = { u'\x01' };
mutable QVariant cachedValue; mutable QVariant cachedValue;
mutable QSize cachedSizeHint, cachedMinimumSizeHint; mutable QSize cachedSizeHint, cachedMinimumSizeHint;
QLineEdit *edit = nullptr; QLineEdit *edit = nullptr;

View File

@ -63,6 +63,8 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
enum { enum {
RowCount = 6, RowCount = 6,
ColumnCount = 7, ColumnCount = 7,
@ -105,9 +107,9 @@ protected:
QString QCalendarDateSectionValidator::highlightString(const QString &str, int pos) QString QCalendarDateSectionValidator::highlightString(const QString &str, int pos)
{ {
if (pos == 0) if (pos == 0)
return QLatin1String("<b>") + str + QLatin1String("</b>"); return "<b>"_L1 + str + "</b>"_L1;
int startPos = str.length() - pos; int startPos = str.length() - pos;
return QStringView{str}.mid(0, startPos) + QLatin1String("<b>") + QStringView{str}.mid(startPos, pos) + QLatin1String("</b>"); return QStringView{str}.mid(0, startPos) + "<b>"_L1 + QStringView{str}.mid(startPos, pos) + "</b>"_L1;
} }
@ -1758,7 +1760,7 @@ void QCalendarWidgetPrivate::createNavigationBar(QWidget *widget)
{ {
Q_Q(QCalendarWidget); Q_Q(QCalendarWidget);
navBarBackground = new QWidget(widget); navBarBackground = new QWidget(widget);
navBarBackground->setObjectName(QLatin1String("qt_calendar_navigationbar")); navBarBackground->setObjectName("qt_calendar_navigationbar"_L1);
navBarBackground->setAutoFillBackground(true); navBarBackground->setAutoFillBackground(true);
navBarBackground->setBackgroundRole(QPalette::Highlight); navBarBackground->setBackgroundRole(QPalette::Highlight);
@ -1819,11 +1821,11 @@ void QCalendarWidgetPrivate::createNavigationBar(QWidget *widget)
monthButton->setFocusPolicy(Qt::NoFocus); monthButton->setFocusPolicy(Qt::NoFocus);
//set names for the header controls. //set names for the header controls.
prevMonth->setObjectName(QLatin1String("qt_calendar_prevmonth")); prevMonth->setObjectName("qt_calendar_prevmonth"_L1);
nextMonth->setObjectName(QLatin1String("qt_calendar_nextmonth")); nextMonth->setObjectName("qt_calendar_nextmonth"_L1);
monthButton->setObjectName(QLatin1String("qt_calendar_monthbutton")); monthButton->setObjectName("qt_calendar_monthbutton"_L1);
yearButton->setObjectName(QLatin1String("qt_calendar_yearbutton")); yearButton->setObjectName("qt_calendar_yearbutton"_L1);
yearEdit->setObjectName(QLatin1String("qt_calendar_yearedit")); yearEdit->setObjectName("qt_calendar_yearedit"_L1);
updateMonthMenu(); updateMonthMenu();
showMonth(m_model->m_date.year(m_model->m_calendar), m_model->m_date.month(m_model->m_calendar)); showMonth(m_model->m_date.year(m_model->m_calendar), m_model->m_date.month(m_model->m_calendar));
@ -2135,7 +2137,7 @@ QCalendarWidget::QCalendarWidget(QWidget *parent)
d->m_model->m_dayFormats.insert(Qt::Saturday, fmt); d->m_model->m_dayFormats.insert(Qt::Saturday, fmt);
d->m_model->m_dayFormats.insert(Qt::Sunday, fmt); d->m_model->m_dayFormats.insert(Qt::Sunday, fmt);
d->m_view = new QCalendarView(this); d->m_view = new QCalendarView(this);
d->m_view->setObjectName(QLatin1String("qt_calendar_calendarview")); d->m_view->setObjectName("qt_calendar_calendarview"_L1);
d->m_view->setModel(d->m_model); d->m_view->setModel(d->m_model);
d->m_model->setView(d->m_view); d->m_model->setView(d->m_view);
d->m_view->setSelectionBehavior(QAbstractItemView::SelectItems); d->m_view->setSelectionBehavior(QAbstractItemView::SelectItems);
@ -2278,7 +2280,7 @@ QSize QCalendarWidget::minimumSizeHint() const
headerW += monthW + buttonDecoMargin; headerW += monthW + buttonDecoMargin;
fm = d->yearButton->fontMetrics(); fm = d->yearButton->fontMetrics();
headerW += fm.boundingRect(QLatin1String("5555")).width() + buttonDecoMargin; headerW += fm.boundingRect("5555"_L1).width() + buttonDecoMargin;
headerSize = QSize(headerW, headerH); headerSize = QSize(headerW, headerH);
} }

View File

@ -87,6 +87,8 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
QComboBoxPrivate::QComboBoxPrivate() QComboBoxPrivate::QComboBoxPrivate()
: QWidgetPrivate(), : QWidgetPrivate(),
shownOnce(false), shownOnce(false),
@ -158,8 +160,7 @@ QStyleOptionMenuItem QComboMenuDelegate::getStyleOption(const QStyleOptionViewIt
menuOption.palette.setBrush(QPalette::All, QPalette::Window, menuOption.palette.setBrush(QPalette::All, QPalette::Window,
qvariant_cast<QBrush>(index.data(Qt::BackgroundRole))); qvariant_cast<QBrush>(index.data(Qt::BackgroundRole)));
} }
menuOption.text = index.model()->data(index, Qt::DisplayRole).toString() menuOption.text = index.model()->data(index, Qt::DisplayRole).toString().replace(u'&', "&&"_L1);
.replace(u'&', QLatin1String("&&"));
menuOption.reservedShortcutWidth = 0; menuOption.reservedShortcutWidth = 0;
menuOption.maxIconWidth = option.decorationSize.width() + 4; menuOption.maxIconWidth = option.decorationSize.width() + 4;
menuOption.menuRect = option.rect; menuOption.menuRect = option.rect;

View File

@ -69,6 +69,8 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
// --- QDateTimeEdit --- // --- QDateTimeEdit ---
/*! /*!
@ -2518,21 +2520,21 @@ void QDateTimeEditPrivate::init(const QVariant &var)
updateTimeSpec(); updateTimeSpec();
q->setDisplayFormat(defaultDateFormat); q->setDisplayFormat(defaultDateFormat);
if (sectionNodes.isEmpty()) // ### safeguard for broken locale if (sectionNodes.isEmpty()) // ### safeguard for broken locale
q->setDisplayFormat(QLatin1String("dd/MM/yyyy")); q->setDisplayFormat("dd/MM/yyyy"_L1);
break; break;
case QMetaType::QDateTime: case QMetaType::QDateTime:
value = var; value = var;
updateTimeSpec(); updateTimeSpec();
q->setDisplayFormat(defaultDateTimeFormat); q->setDisplayFormat(defaultDateTimeFormat);
if (sectionNodes.isEmpty()) // ### safeguard for broken locale if (sectionNodes.isEmpty()) // ### safeguard for broken locale
q->setDisplayFormat(QLatin1String("dd/MM/yyyy hh:mm:ss")); q->setDisplayFormat("dd/MM/yyyy hh:mm:ss"_L1);
break; break;
case QMetaType::QTime: case QMetaType::QTime:
value = QDateTime(QDATETIMEEDIT_DATE_INITIAL, var.toTime()); value = QDateTime(QDATETIMEEDIT_DATE_INITIAL, var.toTime());
updateTimeSpec(); updateTimeSpec();
q->setDisplayFormat(defaultTimeFormat); q->setDisplayFormat(defaultTimeFormat);
if (sectionNodes.isEmpty()) // ### safeguard for broken locale if (sectionNodes.isEmpty()) // ### safeguard for broken locale
q->setDisplayFormat(QLatin1String("hh:mm:ss")); q->setDisplayFormat("hh:mm:ss"_L1);
break; break;
default: default:
Q_ASSERT_X(0, "QDateTimeEditPrivate::init", "Internal error"); Q_ASSERT_X(0, "QDateTimeEditPrivate::init", "Internal error");
@ -2636,7 +2638,7 @@ void QDateTimeEditPrivate::initCalendarPopup(QCalendarWidget *cw)
Q_Q(QDateTimeEdit); Q_Q(QDateTimeEdit);
if (!monthCalendar) { if (!monthCalendar) {
monthCalendar = new QCalendarPopup(q, cw, calendar); monthCalendar = new QCalendarPopup(q, cw, calendar);
monthCalendar->setObjectName(QLatin1String("qt_datetimedit_calendar")); monthCalendar->setObjectName("qt_datetimedit_calendar"_L1);
QObject::connect(monthCalendar, SIGNAL(newDateSelected(QDate)), q, SLOT(setDate(QDate))); QObject::connect(monthCalendar, SIGNAL(newDateSelected(QDate)), q, SLOT(setDate(QDate)));
QObject::connect(monthCalendar, SIGNAL(hidingCalendar(QDate)), q, SLOT(setDate(QDate))); QObject::connect(monthCalendar, SIGNAL(hidingCalendar(QDate)), q, SLOT(setDate(QDate)));
QObject::connect(monthCalendar, SIGNAL(activated(QDate)), q, SLOT(setDate(QDate))); QObject::connect(monthCalendar, SIGNAL(activated(QDate)), q, SLOT(setDate(QDate)));

View File

@ -61,6 +61,8 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
extern QString qt_setWindowTitle_helperHelper(const QString&, const QWidget*); // qwidget.cpp extern QString qt_setWindowTitle_helperHelper(const QString&, const QWidget*); // qwidget.cpp
// qmainwindow.cpp // qmainwindow.cpp
@ -285,7 +287,7 @@ bool QDockWidgetLayout::wmSupportsNativeWindowDeco()
#if defined(Q_OS_ANDROID) #if defined(Q_OS_ANDROID)
return false; return false;
#else #else
static const bool xcb = !QGuiApplication::platformName().compare(QLatin1String("xcb"), Qt::CaseInsensitive); static const bool xcb = !QGuiApplication::platformName().compare("xcb"_L1, Qt::CaseInsensitive);
return !xcb; return !xcb;
#endif #endif
} }
@ -659,12 +661,12 @@ void QDockWidgetPrivate::init()
layout->setSizeConstraint(QLayout::SetMinAndMaxSize); layout->setSizeConstraint(QLayout::SetMinAndMaxSize);
QAbstractButton *button = new QDockWidgetTitleButton(q); QAbstractButton *button = new QDockWidgetTitleButton(q);
button->setObjectName(QLatin1String("qt_dockwidget_floatbutton")); button->setObjectName("qt_dockwidget_floatbutton"_L1);
QObject::connect(button, SIGNAL(clicked()), q, SLOT(_q_toggleTopLevel())); QObject::connect(button, SIGNAL(clicked()), q, SLOT(_q_toggleTopLevel()));
layout->setWidgetForRole(QDockWidgetLayout::FloatButton, button); layout->setWidgetForRole(QDockWidgetLayout::FloatButton, button);
button = new QDockWidgetTitleButton(q); button = new QDockWidgetTitleButton(q);
button->setObjectName(QLatin1String("qt_dockwidget_closebutton")); button->setObjectName("qt_dockwidget_closebutton"_L1);
QObject::connect(button, SIGNAL(clicked()), q, SLOT(close())); QObject::connect(button, SIGNAL(clicked()), q, SLOT(close()));
layout->setWidgetForRole(QDockWidgetLayout::CloseButton, button); layout->setWidgetForRole(QDockWidgetLayout::CloseButton, button);

View File

@ -50,6 +50,8 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
static QFontDatabase::WritingSystem writingSystemFromScript(QLocale::Script script) static QFontDatabase::WritingSystem writingSystemFromScript(QLocale::Script script)
{ {
switch (script) { switch (script) {
@ -287,7 +289,7 @@ void QFontFamilyDelegate::paint(QPainter *painter,
const QString sampleText = comboPrivate->sampleTextForFontFamily.value(text, comboPrivate->sampleTextForWritingSystem.value(system)); const QString sampleText = comboPrivate->sampleTextForFontFamily.value(text, comboPrivate->sampleTextForWritingSystem.value(system));
if (system != QFontDatabase::Any || !sampleText.isEmpty()) { if (system != QFontDatabase::Any || !sampleText.isEmpty()) {
int w = painter->fontMetrics().horizontalAdvance(text + QLatin1String(" ")); int w = painter->fontMetrics().horizontalAdvance(text + " "_L1);
painter->setFont(font2); painter->setFont(font2);
const QString sample = !sampleText.isEmpty() ? sampleText : QFontDatabase::writingSystemSample(system); const QString sample = !sampleText.isEmpty() ? sampleText : QFontDatabase::writingSystemSample(system);
if (option.direction == Qt::RightToLeft) if (option.direction == Qt::RightToLeft)
@ -350,7 +352,7 @@ void QFontComboBoxPrivate::_q_updateModel()
continue; continue;
} }
result += list.at(i); result += list.at(i);
if (list.at(i) == fi.family() || list.at(i).startsWith(fi.family() + QLatin1String(" ["))) if (list.at(i) == fi.family() || list.at(i).startsWith(fi.family() + " ["_L1))
offset = result.count() - 1; offset = result.count() - 1;
} }
list = result; list = result;

View File

@ -60,6 +60,8 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
QLabelPrivate::QLabelPrivate() QLabelPrivate::QLabelPrivate()
: QFramePrivate(), : QFramePrivate(),
sh(), sh(),
@ -1555,11 +1557,11 @@ void QLabelPrivate::ensureTextPopulated() const
int from = 0; int from = 0;
bool found = false; bool found = false;
QTextCursor cursor; QTextCursor cursor;
while (!(cursor = control->document()->find((QLatin1String("&")), from)).isNull()) { while (!(cursor = control->document()->find(("&"_L1), from)).isNull()) {
cursor.deleteChar(); // remove the ampersand cursor.deleteChar(); // remove the ampersand
cursor.movePosition(QTextCursor::NextCharacter, QTextCursor::KeepAnchor); cursor.movePosition(QTextCursor::NextCharacter, QTextCursor::KeepAnchor);
from = cursor.position(); from = cursor.position();
if (!found && cursor.selectedText() != QLatin1String("&")) { //not a second & if (!found && cursor.selectedText() != "&"_L1) { //not a second &
found = true; found = true;
shortcutCursor = cursor; shortcutCursor = cursor;
} }

View File

@ -97,6 +97,8 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
/*! /*!
Initialize \a option with the values from this QLineEdit. This method Initialize \a option with the values from this QLineEdit. This method
is useful for subclasses when they need a QStyleOptionFrame, but don't want is useful for subclasses when they need a QStyleOptionFrame, but don't want
@ -2111,7 +2113,7 @@ void QLineEdit::paintEvent(QPaintEvent *)
void QLineEdit::dragMoveEvent(QDragMoveEvent *e) void QLineEdit::dragMoveEvent(QDragMoveEvent *e)
{ {
Q_D(QLineEdit); Q_D(QLineEdit);
if (!d->control->isReadOnly() && e->mimeData()->hasFormat(QLatin1String("text/plain"))) { if (!d->control->isReadOnly() && e->mimeData()->hasFormat("text/plain"_L1)) {
e->acceptProposedAction(); e->acceptProposedAction();
d->control->moveCursor(d->xToPos(e->position().toPoint().x()), false); d->control->moveCursor(d->xToPos(e->position().toPoint().x()), false);
d->cursorVisible = true; d->cursorVisible = true;
@ -2215,7 +2217,7 @@ QMenu *QLineEdit::createStandardContextMenu()
{ {
Q_D(QLineEdit); Q_D(QLineEdit);
QMenu *popup = new QMenu(this); QMenu *popup = new QMenu(this);
popup->setObjectName(QLatin1String("qt_edit_menu")); popup->setObjectName("qt_edit_menu"_L1);
QAction *action = nullptr; QAction *action = nullptr;
if (!isReadOnly()) { if (!isReadOnly()) {

View File

@ -84,6 +84,8 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
extern QMainWindowLayout *qt_mainwindow_layout(const QMainWindow *window); extern QMainWindowLayout *qt_mainwindow_layout(const QMainWindow *window);
/****************************************************************************** /******************************************************************************
@ -100,14 +102,14 @@ static void dumpLayout(QTextStream &qout, const QDockAreaLayoutItem &item, QStri
<< "pos: " << item.pos << " size:" << item.size << "pos: " << item.pos << " size:" << item.size
<< " gap:" << (item.flags & QDockAreaLayoutItem::GapItem) << " gap:" << (item.flags & QDockAreaLayoutItem::GapItem)
<< " keepSize:" << (item.flags & QDockAreaLayoutItem::KeepSize) << '\n'; << " keepSize:" << (item.flags & QDockAreaLayoutItem::KeepSize) << '\n';
indent += QLatin1String(" "); indent += " "_L1;
if (item.widgetItem != nullptr) { if (item.widgetItem != nullptr) {
qout << indent << "widget: " qout << indent << "widget: "
<< item.widgetItem->widget()->metaObject()->className() << item.widgetItem->widget()->metaObject()->className()
<< " \"" << item.widgetItem->widget()->windowTitle() << "\"\n"; << " \"" << item.widgetItem->widget()->windowTitle() << "\"\n";
} else if (item.subinfo != nullptr) { } else if (item.subinfo != nullptr) {
qout << indent << "subinfo:\n"; qout << indent << "subinfo:\n";
dumpLayout(qout, *item.subinfo, indent + QLatin1String(" ")); dumpLayout(qout, *item.subinfo, indent + " "_L1);
} else if (item.placeHolderItem != nullptr) { } else if (item.placeHolderItem != nullptr) {
QRect r = item.placeHolderItem->topLevelRect; QRect r = item.placeHolderItem->topLevelRect;
qout << indent << "placeHolder: " qout << indent << "placeHolder: "
@ -138,11 +140,11 @@ static void dumpLayout(QTextStream &qout, const QDockAreaLayoutInfo &layout, QSt
#endif #endif
<< '\n'; << '\n';
indent += QLatin1String(" "); indent += " "_L1;
for (int i = 0; i < layout.item_list.count(); ++i) { for (int i = 0; i < layout.item_list.count(); ++i) {
qout << indent << "Item: " << i << '\n'; qout << indent << "Item: " << i << '\n';
dumpLayout(qout, layout.item_list.at(i), indent + QLatin1String(" ")); dumpLayout(qout, layout.item_list.at(i), indent + " "_L1);
} }
} }
@ -155,13 +157,13 @@ static void dumpLayout(QTextStream &qout, const QDockAreaLayout &layout)
<< layout.rect.height() << '\n'; << layout.rect.height() << '\n';
qout << "TopDockArea:\n"; qout << "TopDockArea:\n";
dumpLayout(qout, layout.docks[QInternal::TopDock], QLatin1String(" ")); dumpLayout(qout, layout.docks[QInternal::TopDock], " "_L1);
qout << "LeftDockArea:\n"; qout << "LeftDockArea:\n";
dumpLayout(qout, layout.docks[QInternal::LeftDock], QLatin1String(" ")); dumpLayout(qout, layout.docks[QInternal::LeftDock], " "_L1);
qout << "RightDockArea:\n"; qout << "RightDockArea:\n";
dumpLayout(qout, layout.docks[QInternal::RightDock], QLatin1String(" ")); dumpLayout(qout, layout.docks[QInternal::RightDock], " "_L1);
qout << "BottomDockArea:\n"; qout << "BottomDockArea:\n";
dumpLayout(qout, layout.docks[QInternal::BottomDock], QLatin1String(" ")); dumpLayout(qout, layout.docks[QInternal::BottomDock], " "_L1);
} }
QDebug operator<<(QDebug debug, const QDockAreaLayout &layout) QDebug operator<<(QDebug debug, const QDockAreaLayout &layout)
@ -1893,7 +1895,7 @@ QWidget *QMainWindowLayout::getSeparatorWidget()
result = new QWidget(parentWidget()); result = new QWidget(parentWidget());
result->setAttribute(Qt::WA_MouseNoMask, true); result->setAttribute(Qt::WA_MouseNoMask, true);
result->setAutoFillBackground(false); result->setAutoFillBackground(false);
result->setObjectName(QLatin1String("qt_qmainwindow_extended_splitter")); result->setObjectName("qt_qmainwindow_extended_splitter"_L1);
} }
usedSeparatorWidgets.insert(result); usedSeparatorWidgets.insert(result);
return result; return result;
@ -2444,7 +2446,7 @@ QMainWindowLayout::QMainWindowLayout(QMainWindow *mainwindow, QLayout *parentLay
#endif // QT_CONFIG(dockwidget) #endif // QT_CONFIG(dockwidget)
pluggingWidget = nullptr; pluggingWidget = nullptr;
setObjectName(mainwindow->objectName() + QLatin1String("_layout")); setObjectName(mainwindow->objectName() + "_layout"_L1);
} }
QMainWindowLayout::~QMainWindowLayout() QMainWindowLayout::~QMainWindowLayout()
@ -2727,7 +2729,7 @@ void QMainWindowLayout::updateGapIndicator()
if (!gapIndicator) { if (!gapIndicator) {
gapIndicator = new QRubberBand(QRubberBand::Rectangle, expectedParent); gapIndicator = new QRubberBand(QRubberBand::Rectangle, expectedParent);
// For accessibility to identify this special widget. // For accessibility to identify this special widget.
gapIndicator->setObjectName(QLatin1String("qt_rubberband")); gapIndicator->setObjectName("qt_rubberband"_L1);
} else if (gapIndicator->parent() != expectedParent) { } else if (gapIndicator->parent() != expectedParent) {
gapIndicator->setParent(expectedParent); gapIndicator->setParent(expectedParent);
} }

View File

@ -176,6 +176,7 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
using namespace QMdi; using namespace QMdi;
// Asserts in debug mode, gives warning otherwise. // Asserts in debug mode, gives warning otherwise.
@ -277,7 +278,7 @@ static inline QString tabTextFor(QMdiSubWindow *subWindow)
QString title = subWindow->windowTitle(); QString title = subWindow->windowTitle();
if (subWindow->isWindowModified()) { if (subWindow->isWindowModified()) {
title.replace(QLatin1String("[*]"), QLatin1String("*")); title.replace("[*]"_L1, "*"_L1);
} else { } else {
extern QString qt_setWindowTitle_helperHelper(const QString&, const QWidget*); extern QString qt_setWindowTitle_helperHelper(const QString&, const QWidget*);
title = qt_setWindowTitle_helperHelper(title, subWindow); title = qt_setWindowTitle_helperHelper(title, subWindow);
@ -1515,7 +1516,7 @@ void QMdiAreaPrivate::highlightNextSubWindow(int increaseFactor)
if (!rubberBand) { if (!rubberBand) {
rubberBand = new QRubberBand(QRubberBand::Rectangle, q); rubberBand = new QRubberBand(QRubberBand::Rectangle, q);
// For accessibility to identify this special widget. // For accessibility to identify this special widget.
rubberBand->setObjectName(QLatin1String("qt_rubberband")); rubberBand->setObjectName("qt_rubberband"_L1);
rubberBand->setWindowFlags(rubberBand->windowFlags() | Qt::WindowStaysOnTopHint); rubberBand->setWindowFlags(rubberBand->windowFlags() | Qt::WindowStaysOnTopHint);
} }
#endif #endif

View File

@ -174,6 +174,8 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
using namespace QMdi; using namespace QMdi;
static const QStyle::SubControl SubControls[] = static const QStyle::SubControl SubControls[] =
@ -286,7 +288,7 @@ QString QMdiSubWindowPrivate::originalWindowTitle()
if (originalTitle.isNull()) { if (originalTitle.isNull()) {
originalTitle = originalWindowTitleHelper(); originalTitle = originalWindowTitleHelper();
if (originalTitle.isNull()) if (originalTitle.isNull())
originalTitle = QLatin1String(""); originalTitle = ""_L1;
} }
return originalTitle; return originalTitle;
} }
@ -1919,7 +1921,7 @@ void QMdiSubWindowPrivate::enterRubberBandMode()
if (!rubberBand) { if (!rubberBand) {
rubberBand = new QRubberBand(QRubberBand::Rectangle, q->parentWidget()); rubberBand = new QRubberBand(QRubberBand::Rectangle, q->parentWidget());
// For accessibility to identify this special widget. // For accessibility to identify this special widget.
rubberBand->setObjectName(QLatin1String("qt_rubberband")); rubberBand->setObjectName("qt_rubberband"_L1);
} }
QPoint rubberBandPos = q->mapToParent(QPoint(0, 0)); QPoint rubberBandPos = q->mapToParent(QPoint(0, 0));
rubberBand->setGeometry(rubberBandPos.x(), rubberBandPos.y(), rubberBand->setGeometry(rubberBandPos.x(), rubberBandPos.y(),
@ -2216,7 +2218,7 @@ void QMdiSubWindowPrivate::updateInternalWindowTitle()
Q_Q(QMdiSubWindow); Q_Q(QMdiSubWindow);
if (q->isWindowModified()) { if (q->isWindowModified()) {
windowTitle = q->windowTitle(); windowTitle = q->windowTitle();
windowTitle.replace(QLatin1String("[*]"), QLatin1String("*")); windowTitle.replace("[*]"_L1, "*"_L1);
} else { } else {
windowTitle = qt_setWindowTitle_helperHelper(q->windowTitle(), q); windowTitle = qt_setWindowTitle_helperHelper(q->windowTitle(), q);
} }
@ -2334,10 +2336,8 @@ void QMdiSubWindow::setWidget(QWidget *widget)
d->updateWindowTitle(true); d->updateWindowTitle(true);
isWindowModified = d->baseWidget->isWindowModified(); isWindowModified = d->baseWidget->isWindowModified();
} }
if (!this->isWindowModified() && isWindowModified if (!this->isWindowModified() && isWindowModified && windowTitle().contains("[*]"_L1))
&& windowTitle().contains(QLatin1String("[*]"))) {
setWindowModified(isWindowModified); setWindowModified(isWindowModified);
}
d->lastChildWindowTitle = d->baseWidget->windowTitle(); d->lastChildWindowTitle = d->baseWidget->windowTitle();
d->ignoreWindowTitleChange = false; d->ignoreWindowTitleChange = false;
@ -2770,7 +2770,7 @@ bool QMdiSubWindow::eventFilter(QObject *object, QEvent *event)
bool windowModified = d->baseWidget->isWindowModified(); bool windowModified = d->baseWidget->isWindowModified();
if (!windowModified && d->baseWidget->windowTitle() != windowTitle()) if (!windowModified && d->baseWidget->windowTitle() != windowTitle())
break; break;
if (windowTitle().contains(QLatin1String("[*]"))) if (windowTitle().contains("[*]"_L1))
setWindowModified(windowModified); setWindowModified(windowModified);
break; break;
} }
@ -2871,7 +2871,7 @@ bool QMdiSubWindow::event(QEvent *event)
d->updateInternalWindowTitle(); d->updateInternalWindowTitle();
break; break;
case QEvent::ModifiedChange: case QEvent::ModifiedChange:
if (!windowTitle().contains(QLatin1String("[*]"))) if (!windowTitle().contains("[*]"_L1))
break; break;
#if QT_CONFIG(menubar) #if QT_CONFIG(menubar)
if (maximizedButtonsWidget() && d->controlContainer->menuBar() && d->controlContainer->menuBar() if (maximizedButtonsWidget() && d->controlContainer->menuBar() && d->controlContainer->menuBar()

View File

@ -71,6 +71,8 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
class QMenuBarExtension : public QToolButton class QMenuBarExtension : public QToolButton
{ {
public: public:
@ -83,7 +85,7 @@ public:
QMenuBarExtension::QMenuBarExtension(QWidget *parent) QMenuBarExtension::QMenuBarExtension(QWidget *parent)
: QToolButton(parent) : QToolButton(parent)
{ {
setObjectName(QLatin1String("qt_menubar_ext_button")); setObjectName("qt_menubar_ext_button"_L1);
setAutoRaise(true); setAutoRaise(true);
#if QT_CONFIG(menu) #if QT_CONFIG(menu)
setPopupMode(QToolButton::InstantPopup); setPopupMode(QToolButton::InstantPopup);

View File

@ -52,6 +52,8 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
class QProgressBarPrivate : public QWidgetPrivate class QProgressBarPrivate : public QWidgetPrivate
{ {
Q_DECLARE_PUBLIC(QProgressBar) Q_DECLARE_PUBLIC(QProgressBar)
@ -89,7 +91,7 @@ QProgressBarPrivate::QProgressBarPrivate()
void QProgressBarPrivate::initDefaultFormat() void QProgressBarPrivate::initDefaultFormat()
{ {
if (defaultFormat) if (defaultFormat)
format = QLatin1String("%p") + locale.percent(); format = "%p"_L1 + locale.percent();
} }
void QProgressBarPrivate::init() void QProgressBarPrivate::init()
@ -152,10 +154,9 @@ bool QProgressBarPrivate::repaintRequired() const
const auto totalSteps = qint64(maximum) - minimum; const auto totalSteps = qint64(maximum) - minimum;
if (textVisible) { if (textVisible) {
if ((format.contains(QLatin1String("%v")))) if (format.contains("%v"_L1))
return true; return true;
if ((format.contains(QLatin1String("%p")) if (format.contains("%p"_L1) && valueDifference >= qAbs(totalSteps / 100))
&& valueDifference >= qAbs(totalSteps / 100)))
return true; return true;
} }
@ -468,19 +469,19 @@ QString QProgressBar::text() const
QString result = d->format; QString result = d->format;
QLocale locale = d->locale; // Omit group separators for compatibility with previous versions that were non-localized. QLocale locale = d->locale; // Omit group separators for compatibility with previous versions that were non-localized.
locale.setNumberOptions(locale.numberOptions() | QLocale::OmitGroupSeparator); locale.setNumberOptions(locale.numberOptions() | QLocale::OmitGroupSeparator);
result.replace(QLatin1String("%m"), locale.toString(totalSteps)); result.replace("%m"_L1, locale.toString(totalSteps));
result.replace(QLatin1String("%v"), locale.toString(d->value)); result.replace("%v"_L1, locale.toString(d->value));
// If max and min are equal and we get this far, it means that the // If max and min are equal and we get this far, it means that the
// progress bar has one step and that we are on that step. Return // progress bar has one step and that we are on that step. Return
// 100% here in order to avoid division by zero further down. // 100% here in order to avoid division by zero further down.
if (totalSteps == 0) { if (totalSteps == 0) {
result.replace(QLatin1String("%p"), locale.toString(100)); result.replace("%p"_L1, locale.toString(100));
return result; return result;
} }
const auto progress = static_cast<int>((qint64(d->value) - d->minimum) * 100.0 / totalSteps); const auto progress = static_cast<int>((qint64(d->value) - d->minimum) * 100.0 / totalSteps);
result.replace(QLatin1String("%p"), locale.toString(progress)); result.replace("%p"_L1, locale.toString(progress));
return result; return result;
} }

View File

@ -51,6 +51,8 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
//#define QSPINBOX_QSBDEBUG //#define QSPINBOX_QSBDEBUG
#ifdef QSPINBOX_QSBDEBUG #ifdef QSPINBOX_QSBDEBUG
# define QSBDEBUG qDebug # define QSBDEBUG qDebug
@ -518,7 +520,7 @@ QString QSpinBox::textFromValue(int value) const
QString str; QString str;
if (d->displayIntegerBase != 10) { if (d->displayIntegerBase != 10) {
const QLatin1String prefix = value < 0 ? QLatin1String("-") : QLatin1String(); const auto prefix = value < 0 ? "-"_L1 : ""_L1;
str = prefix + QString::number(qAbs(value), d->displayIntegerBase); str = prefix + QString::number(qAbs(value), d->displayIntegerBase);
} else { } else {
str = locale().toString(value); str = locale().toString(value);
@ -1126,8 +1128,8 @@ QVariant QSpinBoxPrivate::validateAndInterpret(QString &input, int &pos,
int num = min; int num = min;
if (max != min && (copy.isEmpty() if (max != min && (copy.isEmpty()
|| (min < 0 && copy == QLatin1String("-")) || (min < 0 && copy == "-"_L1)
|| (max >= 0 && copy == QLatin1String("+")))) { || (max >= 0 && copy == "+"_L1))) {
state = QValidator::Intermediate; state = QValidator::Intermediate;
QSBDEBUG() << __FILE__ << __LINE__<< "num is set to" << num; QSBDEBUG() << __FILE__ << __LINE__<< "num is set to" << num;
} else if (copy.startsWith(u'-') && min >= 0) { } else if (copy.startsWith(u'-') && min >= 0) {

View File

@ -62,6 +62,8 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
//#define QSPLITTER_DEBUG //#define QSPLITTER_DEBUG
QSplitterPrivate::~QSplitterPrivate() QSplitterPrivate::~QSplitterPrivate()
@ -873,7 +875,7 @@ QSplitterLayoutStruct *QSplitterPrivate::insertWidget(int index, QWidget *w)
} else { } else {
sls = new QSplitterLayoutStruct; sls = new QSplitterLayoutStruct;
QSplitterHandle *newHandle = q->createHandle(); QSplitterHandle *newHandle = q->createHandle();
newHandle->setObjectName(QLatin1String("qt_splithandle_") + w->objectName()); newHandle->setObjectName("qt_splithandle_"_L1 + w->objectName());
sls->handle = newHandle; sls->handle = newHandle;
sls->widget = w; sls->widget = w;
w->lower(); w->lower();
@ -1340,7 +1342,7 @@ void QSplitter::setRubberBand(int pos)
QBoolBlocker b(d->blockChildAdd); QBoolBlocker b(d->blockChildAdd);
d->rubberBand = new QRubberBand(QRubberBand::Line, this); d->rubberBand = new QRubberBand(QRubberBand::Line, this);
// For accessibility to identify this special widget. // For accessibility to identify this special widget.
d->rubberBand->setObjectName(QLatin1String("qt_rubberband")); d->rubberBand->setObjectName("qt_rubberband"_L1);
} }
const QRect newGeom = d->orient == Qt::Horizontal ? QRect(QPoint(pos + hw / 2 - rBord, r.y()), QSize(2 * rBord, r.height())) const QRect newGeom = d->orient == Qt::Horizontal ? QRect(QPoint(pos + hw / 2 - rBord, r.y()), QSize(2 * rBord, r.height()))

View File

@ -1550,7 +1550,7 @@ static QString computeElidedText(Qt::TextElideMode mode, const QString &text)
if (text.length() <= 3) if (text.length() <= 3)
return text; return text;
static const QLatin1String Ellipses("..."); static const auto Ellipses = "..."_L1;
QString ret; QString ret;
switch (mode) { switch (mode) {
case Qt::ElideRight: case Qt::ElideRight:

View File

@ -55,6 +55,8 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
/*! /*!
\class QTabWidget \class QTabWidget
\brief The QTabWidget class provides a stack of tabbed widgets. \brief The QTabWidget class provides a stack of tabbed widgets.
@ -226,14 +228,14 @@ void QTabWidgetPrivate::init()
Q_Q(QTabWidget); Q_Q(QTabWidget);
stack = new QStackedWidget(q); stack = new QStackedWidget(q);
stack->setObjectName(QLatin1String("qt_tabwidget_stackedwidget")); stack->setObjectName("qt_tabwidget_stackedwidget"_L1);
stack->setLineWidth(0); stack->setLineWidth(0);
// hack so that QMacStyle::layoutSpacing() can detect tab widget pages // hack so that QMacStyle::layoutSpacing() can detect tab widget pages
stack->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred, QSizePolicy::TabWidget)); stack->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred, QSizePolicy::TabWidget));
QObject::connect(stack, SIGNAL(widgetRemoved(int)), q, SLOT(_q_removeTab(int))); QObject::connect(stack, SIGNAL(widgetRemoved(int)), q, SLOT(_q_removeTab(int)));
QTabBar *tabBar = new QTabBar(q); QTabBar *tabBar = new QTabBar(q);
tabBar->setObjectName(QLatin1String("qt_tabwidget_tabbar")); tabBar->setObjectName("qt_tabwidget_tabbar"_L1);
tabBar->setDrawBase(false); tabBar->setDrawBase(false);
q->setTabBar(tabBar); q->setTabBar(tabBar);

View File

@ -58,6 +58,8 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
static inline bool shouldEnableInputMethod(QTextBrowser *texbrowser) static inline bool shouldEnableInputMethod(QTextBrowser *texbrowser)
{ {
#if defined (Q_OS_ANDROID) #if defined (Q_OS_ANDROID)
@ -169,14 +171,14 @@ Q_DECLARE_TYPEINFO(QTextBrowserPrivate::HistoryEntry, Q_RELOCATABLE_TYPE);
QString QTextBrowserPrivate::findFile(const QUrl &name) const QString QTextBrowserPrivate::findFile(const QUrl &name) const
{ {
QString fileName; QString fileName;
if (name.scheme() == QLatin1String("qrc")) { if (name.scheme() == "qrc"_L1) {
fileName = QLatin1String(":/") + name.path(); fileName = ":/"_L1 + name.path();
} else if (name.scheme().isEmpty()) { } else if (name.scheme().isEmpty()) {
fileName = name.path(); fileName = name.path();
} else { } else {
#if defined(Q_OS_ANDROID) #if defined(Q_OS_ANDROID)
if (name.scheme() == QLatin1String("assets")) if (name.scheme() == "assets"_L1)
fileName = QLatin1String("assets:") + name.path(); fileName = "assets:"_L1 + name.path();
else else
#endif #endif
fileName = name.toLocalFile(); fileName = name.toLocalFile();
@ -207,7 +209,7 @@ QUrl QTextBrowserPrivate::resolveUrl(const QUrl &url) const
// For the second case QUrl can merge "#someanchor" with "foo.html" // For the second case QUrl can merge "#someanchor" with "foo.html"
// correctly to "foo.html#someanchor" // correctly to "foo.html#someanchor"
if (!(currentURL.isRelative() if (!(currentURL.isRelative()
|| (currentURL.scheme() == QLatin1String("file") || (currentURL.scheme() == "file"_L1
&& !QFileInfo(currentURL.toLocalFile()).isAbsolute())) && !QFileInfo(currentURL.toLocalFile()).isAbsolute()))
|| (url.hasFragment() && url.path().isEmpty())) { || (url.hasFragment() && url.path().isEmpty())) {
return currentURL.resolved(url); return currentURL.resolved(url);
@ -245,11 +247,11 @@ void QTextBrowserPrivate::_q_activateAnchor(const QString &href)
#ifndef QT_NO_DESKTOPSERVICES #ifndef QT_NO_DESKTOPSERVICES
bool isFileScheme = bool isFileScheme =
url.scheme() == QLatin1String("file") url.scheme() == "file"_L1
#if defined(Q_OS_ANDROID) #if defined(Q_OS_ANDROID)
|| url.scheme() == QLatin1String("assets") || url.scheme() == "assets"_L1
#endif #endif
|| url.scheme() == QLatin1String("qrc"); || url.scheme() == "qrc"_L1;
if ((openExternalLinks && !isFileScheme && !url.isRelative()) if ((openExternalLinks && !isFileScheme && !url.isRelative())
|| (url.isRelative() && !currentURL.isRelative() && !isFileScheme)) { || (url.isRelative() && !currentURL.isRelative() && !isFileScheme)) {
QDesktopServices::openUrl(url); QDesktopServices::openUrl(url);
@ -304,9 +306,9 @@ void QTextBrowserPrivate::setSource(const QUrl &url, QTextDocument::ResourceType
QString fileName = url.fileName(); QString fileName = url.fileName();
if (type == QTextDocument::UnknownResource) { if (type == QTextDocument::UnknownResource) {
#if QT_CONFIG(textmarkdownreader) #if QT_CONFIG(textmarkdownreader)
if (fileName.endsWith(QLatin1String(".md")) || if (fileName.endsWith(".md"_L1) ||
fileName.endsWith(QLatin1String(".mkd")) || fileName.endsWith(".mkd"_L1) ||
fileName.endsWith(QLatin1String(".markdown"))) fileName.endsWith(".markdown"_L1))
type = QTextDocument::MarkdownResource; type = QTextDocument::MarkdownResource;
else else
#endif #endif
@ -337,7 +339,7 @@ void QTextBrowserPrivate::setSource(const QUrl &url, QTextDocument::ResourceType
if (q->isVisible()) { if (q->isVisible()) {
const QStringView firstTag = QStringView{txt}.left(txt.indexOf(u'>') + 1); const QStringView firstTag = QStringView{txt}.left(txt.indexOf(u'>') + 1);
if (firstTag.startsWith(QLatin1String("<qt")) && firstTag.contains(QLatin1String("type")) && firstTag.contains(QLatin1String("detail"))) { if (firstTag.startsWith("<qt"_L1) && firstTag.contains("type"_L1) && firstTag.contains("detail"_L1)) {
#ifndef QT_NO_CURSOR #ifndef QT_NO_CURSOR
QGuiApplication::restoreOverrideCursor(); QGuiApplication::restoreOverrideCursor();
#endif #endif

View File

@ -45,11 +45,13 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
QToolBarExtension::QToolBarExtension(QWidget *parent) QToolBarExtension::QToolBarExtension(QWidget *parent)
: QToolButton(parent) : QToolButton(parent)
, m_orientation(Qt::Horizontal) , m_orientation(Qt::Horizontal)
{ {
setObjectName(QLatin1String("qt_toolbar_ext_button")); setObjectName("qt_toolbar_ext_button"_L1);
setAutoRaise(true); setAutoRaise(true);
setOrientation(m_orientation); setOrientation(m_orientation);
setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);

View File

@ -56,6 +56,8 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
class QToolBoxButton : public QAbstractButton class QToolBoxButton : public QAbstractButton
{ {
Q_OBJECT Q_OBJECT
@ -351,7 +353,7 @@ int QToolBox::insertItem(int index, QWidget *widget, const QIcon &icon, const QS
auto &c = *newPage; auto &c = *newPage;
c.widget = widget; c.widget = widget;
c.button = new QToolBoxButton(this); c.button = new QToolBoxButton(this);
c.button->setObjectName(QLatin1String("qt_toolbox_toolboxbutton")); c.button->setObjectName("qt_toolbox_toolboxbutton"_L1);
connect(c.button, SIGNAL(clicked()), this, SLOT(_q_buttonClicked())); connect(c.button, SIGNAL(clicked()), this, SLOT(_q_buttonClicked()));
c.sv = new QScrollArea(this); c.sv = new QScrollArea(this);

View File

@ -67,6 +67,8 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
class QToolButtonPrivate : public QAbstractButtonPrivate class QToolButtonPrivate : public QAbstractButtonPrivate
{ {
Q_DECLARE_PUBLIC(QToolButton) Q_DECLARE_PUBLIC(QToolButton)
@ -939,7 +941,7 @@ void QToolButton::setDefaultAction(QAction *action)
// If iconText() is generated from text(), we need to escape any '&'s so they // If iconText() is generated from text(), we need to escape any '&'s so they
// don't turn into shortcuts // don't turn into shortcuts
if (QActionPrivate::get(action)->iconText.isEmpty()) if (QActionPrivate::get(action)->iconText.isEmpty())
buttonText.replace(QLatin1String("&"), QLatin1String("&&")); buttonText.replace("&"_L1, "&&"_L1);
setText(buttonText); setText(buttonText);
setIcon(action->icon()); setIcon(action->icon());
#if QT_CONFIG(tooltip) #if QT_CONFIG(tooltip)

View File

@ -52,6 +52,8 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
#define RANGE 4 #define RANGE 4
static bool resizeHorizontalDirectionFixed = false; static bool resizeHorizontalDirectionFixed = false;
@ -219,7 +221,7 @@ void QWidgetResizeHandler::mouseMoveEvent(QMouseEvent *e)
QPoint pp = globalPos - moveOffset; QPoint pp = globalPos - moveOffset;
// Workaround for window managers which refuse to move a tool window partially offscreen. // Workaround for window managers which refuse to move a tool window partially offscreen.
if (QGuiApplication::platformName() == QLatin1String("xcb")) { if (QGuiApplication::platformName() == "xcb"_L1) {
const QRect desktop = QWidgetPrivate::availableScreenGeometry(widget); const QRect desktop = QWidgetPrivate::availableScreenGeometry(widget);
pp.rx() = qMax(pp.x(), desktop.left()); pp.rx() = qMax(pp.x(), desktop.left());
pp.ry() = qMax(pp.y(), desktop.top()); pp.ry() = qMax(pp.y(), desktop.top());

View File

@ -110,6 +110,8 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
// could go into QTextCursor... // could go into QTextCursor...
static QTextLine currentTextLine(const QTextCursor &cursor) static QTextLine currentTextLine(const QTextCursor &cursor)
{ {
@ -2709,8 +2711,8 @@ bool QWidgetTextControl::canInsertFromMimeData(const QMimeData *source) const
if (d->acceptRichText) if (d->acceptRichText)
return (source->hasText() && !source->text().isEmpty()) return (source->hasText() && !source->text().isEmpty())
|| source->hasHtml() || source->hasHtml()
|| source->hasFormat(QLatin1String("application/x-qrichtext")) || source->hasFormat("application/x-qrichtext"_L1)
|| source->hasFormat(QLatin1String("application/x-qt-richtext")); || source->hasFormat("application/x-qt-richtext"_L1);
else else
return source->hasText() && !source->text().isEmpty(); return source->hasText() && !source->text().isEmpty();
} }
@ -2724,10 +2726,10 @@ void QWidgetTextControl::insertFromMimeData(const QMimeData *source)
bool hasData = false; bool hasData = false;
QTextDocumentFragment fragment; QTextDocumentFragment fragment;
#ifndef QT_NO_TEXTHTMLPARSER #ifndef QT_NO_TEXTHTMLPARSER
if (source->hasFormat(QLatin1String("application/x-qrichtext")) && d->acceptRichText) { if (source->hasFormat("application/x-qrichtext"_L1) && d->acceptRichText) {
// x-qrichtext is always UTF-8 (taken from Qt3 since we don't use it anymore). // x-qrichtext is always UTF-8 (taken from Qt3 since we don't use it anymore).
const QString richtext = QLatin1String("<meta name=\"qrichtext\" content=\"1\" />") const QString richtext = "<meta name=\"qrichtext\" content=\"1\" />"_L1
+ QString::fromUtf8(source->data(QLatin1String("application/x-qrichtext"))); + QString::fromUtf8(source->data("application/x-qrichtext"_L1));
fragment = QTextDocumentFragment::fromHtml(richtext, d->doc); fragment = QTextDocumentFragment::fromHtml(richtext, d->doc);
hasData = true; hasData = true;
} else if (source->hasHtml() && d->acceptRichText) { } else if (source->hasHtml() && d->acceptRichText) {
@ -3479,7 +3481,7 @@ void QTextEditMimeData::setup() const
{ {
QTextEditMimeData *that = const_cast<QTextEditMimeData *>(this); QTextEditMimeData *that = const_cast<QTextEditMimeData *>(this);
#ifndef QT_NO_TEXTHTMLPARSER #ifndef QT_NO_TEXTHTMLPARSER
that->setData(QLatin1String("text/html"), fragment.toHtml().toUtf8()); that->setData("text/html"_L1, fragment.toHtml().toUtf8());
#endif #endif
#ifndef QT_NO_TEXTODFWRITER #ifndef QT_NO_TEXTODFWRITER
{ {
@ -3487,7 +3489,7 @@ void QTextEditMimeData::setup() const
QTextDocumentWriter writer(&buffer, "ODF"); QTextDocumentWriter writer(&buffer, "ODF");
writer.write(fragment); writer.write(fragment);
buffer.close(); buffer.close();
that->setData(QLatin1String("application/vnd.oasis.opendocument.text"), buffer.data()); that->setData("application/vnd.oasis.opendocument.text"_L1, buffer.data());
} }
#endif #endif
that->setText(fragment.toRawText()); that->setText(fragment.toRawText());