diff options
Diffstat (limited to 'src/widgets/kernel')
| -rw-r--r-- | src/widgets/kernel/qapplication.cpp | 8 | ||||
| -rw-r--r-- | src/widgets/kernel/qtooltip.cpp | 6 | ||||
| -rw-r--r-- | src/widgets/kernel/qwidget.cpp | 9 | ||||
| -rw-r--r-- | src/widgets/kernel/qwidgetwindow.cpp | 6 | ||||
| -rw-r--r-- | src/widgets/kernel/qwindowcontainer.cpp | 4 |
5 files changed, 21 insertions, 12 deletions
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index 91c08de41f0..9cc7cccdcfd 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -132,6 +132,8 @@ static void initResources() QT_BEGIN_NAMESPACE +using namespace Qt::StringLiterals; + // Helper macro for static functions to check on the existence of the application class. #define CHECK_QAPP_INSTANCE(...) \ if (Q_LIKELY(QCoreApplication::instance())) { \ @@ -411,10 +413,10 @@ void QApplicationPrivate::process_cmdline() // obsolete argument #ifndef QT_NO_STYLE_STYLESHEET } else if (strcmp(arg, "-stylesheet") == 0 && i < argc -1) { - styleSheet = QLatin1String("file:///"); + styleSheet = "file:///"_L1; styleSheet.append(QString::fromLocal8Bit(argv[++i])); } else if (strncmp(arg, "-stylesheet=", 12) == 0) { - styleSheet = QLatin1String("file:///"); + styleSheet = "file:///"_L1; styleSheet.append(QString::fromLocal8Bit(arg + 12)); #endif } else if (qstrcmp(arg, "-widgetcount") == 0) { @@ -551,7 +553,7 @@ void QApplicationPrivate::initialize() } else { qWarning("QApplication: invalid style override '%s' passed, ignoring it.\n" "\tAvailable styles: %s", qPrintable(styleOverride), - qPrintable(QStyleFactory::keys().join(QLatin1String(", ")))); + qPrintable(QStyleFactory::keys().join(", "_L1))); } } diff --git a/src/widgets/kernel/qtooltip.cpp b/src/widgets/kernel/qtooltip.cpp index 49de9e0c6ab..3cfd7aa68c4 100644 --- a/src/widgets/kernel/qtooltip.cpp +++ b/src/widgets/kernel/qtooltip.cpp @@ -62,6 +62,8 @@ QT_BEGIN_NAMESPACE +using namespace Qt::StringLiterals; + /*! \class QToolTip @@ -372,7 +374,7 @@ void QTipLabel::placeTip(const QPoint &pos, QWidget *w) //the stylesheet need to know the real parent 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. - QTipLabel::instance->setStyleSheet(QLatin1String("/* */")); + QTipLabel::instance->setStyleSheet("/* */"_L1); // Set up for cleaning up this later... 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)); QTipLabel::instance->setTipRect(w, rect); QTipLabel::instance->placeTip(pos, w); - QTipLabel::instance->setObjectName(QLatin1String("qtooltip_label")); + QTipLabel::instance->setObjectName("qtooltip_label"_L1); #if QT_CONFIG(effects) if (QApplication::isEffectEnabled(Qt::UI_FadeTooltip)) diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 2adbffa99b3..d3a742acead 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -119,6 +119,7 @@ QT_BEGIN_NAMESPACE using namespace QNativeInterface::Private; +using namespace Qt::StringLiterals; Q_LOGGING_CATEGORY(lcWidgetPainting, "qt.widgets.painting", QtWarningMsg); @@ -6021,7 +6022,7 @@ QString QWidget::windowTitle() const if (!d->extra->topextra->caption.isEmpty()) return d->extra->topextra->caption; if (!d->extra->topextra->filePath.isEmpty()) - return QFileInfo(d->extra->topextra->filePath).fileName() + QLatin1String("[*]"); + return QFileInfo(d->extra->topextra->filePath).fileName() + "[*]"_L1; } return QString(); } @@ -6045,7 +6046,7 @@ QString qt_setWindowTitle_helperHelper(const QString &title, const QWidget *widg if (cap.isEmpty()) return cap; - QLatin1String placeHolder("[*]"); + const auto placeHolder = "[*]"_L1; int index = cap.indexOf(placeHolder); // here the magic begins @@ -6069,7 +6070,7 @@ QString qt_setWindowTitle_helperHelper(const QString &title, const QWidget *widg index = cap.indexOf(placeHolder, index); } - cap.replace(QLatin1String("[*][*]"), placeHolder); + cap.replace("[*][*]"_L1, placeHolder); return cap; } @@ -11456,7 +11457,7 @@ void QWidgetPrivate::setWindowModified_helper() return; bool on = q->testAttribute(Qt::WA_WindowModified); 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"); setWindowTitle_helper(q->windowTitle()); setWindowIconText_helper(q->windowIconText()); diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp index 6524393ee17..3b32268c060 100644 --- a/src/widgets/kernel/qwidgetwindow.cpp +++ b/src/widgets/kernel/qwidgetwindow.cpp @@ -55,6 +55,8 @@ QT_BEGIN_NAMESPACE +using namespace Qt::StringLiterals; + Q_WIDGETS_EXPORT extern bool qt_tab_all_widgets(); 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(); if (name.isEmpty()) - name = QString::fromUtf8(m_widget->metaObject()->className()) + QLatin1String("Class"); - name += QLatin1String("Window"); + name = QString::fromUtf8(m_widget->metaObject()->className()) + "Class"_L1; + name += "Window"_L1; setObjectName(name); } diff --git a/src/widgets/kernel/qwindowcontainer.cpp b/src/widgets/kernel/qwindowcontainer.cpp index b26bc68d19a..adeebc52dc2 100644 --- a/src/widgets/kernel/qwindowcontainer.cpp +++ b/src/widgets/kernel/qwindowcontainer.cpp @@ -52,6 +52,8 @@ QT_BEGIN_NAMESPACE +using namespace Qt::StringLiterals; + class QWindowContainerPrivate : public QWidgetPrivate { public: @@ -222,7 +224,7 @@ QWindowContainer::QWindowContainer(QWindow *embeddedWindow, QWidget *parent, Qt: QString windowName = d->window->objectName(); if (windowName.isEmpty()) 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->setFlag(Qt::SubWindow); |
