Replace uses of _qs with _s in sources and examples
Task-number: QTBUG-101408 Change-Id: I48360ba3b23965cd3d90ac243c100a0656a4cde8 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
This commit is contained in:
parent
a1d8b9023f
commit
908e85cc85
@ -57,13 +57,15 @@
|
|||||||
|
|
||||||
#include "dialog.h"
|
#include "dialog.h"
|
||||||
|
|
||||||
|
using namespace Qt::StringLiterals;
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
QApplication app(argc, argv);
|
QApplication app(argc, argv);
|
||||||
|
|
||||||
#if QT_CONFIG(translation)
|
#if QT_CONFIG(translation)
|
||||||
QTranslator translator;
|
QTranslator translator;
|
||||||
if (translator.load(QLocale::system(), u"qtbase"_qs, u"_"_qs,
|
if (translator.load(QLocale::system(), u"qtbase"_s, u"_"_s,
|
||||||
QLibraryInfo::path(QLibraryInfo::TranslationsPath))) {
|
QLibraryInfo::path(QLibraryInfo::TranslationsPath))) {
|
||||||
app.installTranslator(&translator);
|
app.installTranslator(&translator);
|
||||||
}
|
}
|
||||||
|
@ -46,6 +46,7 @@
|
|||||||
//#define DEBUG_SOLUTION_GEN
|
//#define DEBUG_SOLUTION_GEN
|
||||||
|
|
||||||
using namespace QMakeInternal;
|
using namespace QMakeInternal;
|
||||||
|
using namespace Qt::StringLiterals;
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
// Filter GUIDs (Do NOT change these!) ------------------------------
|
// Filter GUIDs (Do NOT change these!) ------------------------------
|
||||||
@ -301,7 +302,7 @@ QString VcprojGenerator::retrievePlatformToolSet() const
|
|||||||
if (!envVar.isEmpty())
|
if (!envVar.isEmpty())
|
||||||
return envVar;
|
return envVar;
|
||||||
|
|
||||||
return u"v"_qs + project->first("MSVC_TOOLSET_VER");
|
return u"v"_s + project->first("MSVC_TOOLSET_VER");
|
||||||
}
|
}
|
||||||
|
|
||||||
bool VcprojGenerator::isStandardSuffix(const QString &suffix) const
|
bool VcprojGenerator::isStandardSuffix(const QString &suffix) const
|
||||||
|
@ -58,7 +58,7 @@ int main() {
|
|||||||
int y;
|
int y;
|
||||||
int z;
|
int z;
|
||||||
|
|
||||||
QString toString() const { return u"[x: %1; y: %2, z: %3]"_qs.arg(QString::number(x),
|
QString toString() const { return u"[x: %1; y: %2, z: %3]"_s.arg(QString::number(x),
|
||||||
QString::number(y),
|
QString::number(y),
|
||||||
QString::number(z)); }
|
QString::number(z)); }
|
||||||
};
|
};
|
||||||
|
@ -148,7 +148,7 @@ static QSettings *findConfiguration()
|
|||||||
#endif
|
#endif
|
||||||
if (QCoreApplication::instance()) {
|
if (QCoreApplication::instance()) {
|
||||||
QDir pwd(QCoreApplication::applicationDirPath());
|
QDir pwd(QCoreApplication::applicationDirPath());
|
||||||
qtconfig = pwd.filePath(u"qt" QT_STRINGIFY(QT_VERSION_MAJOR) ".conf"_qs);
|
qtconfig = pwd.filePath(u"qt" QT_STRINGIFY(QT_VERSION_MAJOR) ".conf"_s);
|
||||||
if (QFile::exists(qtconfig))
|
if (QFile::exists(qtconfig))
|
||||||
return new QSettings(qtconfig, QSettings::IniFormat);
|
return new QSettings(qtconfig, QSettings::IniFormat);
|
||||||
qtconfig = pwd.filePath("qt.conf"_L1);
|
qtconfig = pwd.filePath("qt.conf"_L1);
|
||||||
@ -532,7 +532,7 @@ QLibraryInfoPrivate::LocationInfo QLibraryInfoPrivate::locationInfo(QLibraryInfo
|
|||||||
result.key = QLatin1StringView(qtConfEntries.viewAt(loc * 2));
|
result.key = QLatin1StringView(qtConfEntries.viewAt(loc * 2));
|
||||||
result.defaultValue = QLatin1StringView(qtConfEntries.viewAt(loc * 2 + 1));
|
result.defaultValue = QLatin1StringView(qtConfEntries.viewAt(loc * 2 + 1));
|
||||||
if (result.key == u"QmlImports")
|
if (result.key == u"QmlImports")
|
||||||
result.fallbackKey = u"Qml2Imports"_qs;
|
result.fallbackKey = u"Qml2Imports"_s;
|
||||||
#ifndef Q_OS_WIN // On Windows we use the registry
|
#ifndef Q_OS_WIN // On Windows we use the registry
|
||||||
} else if (loc == QLibraryInfo::SettingsPath) {
|
} else if (loc == QLibraryInfo::SettingsPath) {
|
||||||
result.key = "Settings"_L1;
|
result.key = "Settings"_L1;
|
||||||
|
@ -1648,7 +1648,7 @@ QString QFileSystemEngine::homePath()
|
|||||||
|
|
||||||
QString QFileSystemEngine::rootPath()
|
QString QFileSystemEngine::rootPath()
|
||||||
{
|
{
|
||||||
return u"/"_qs;
|
return u"/"_s;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString QFileSystemEngine::tempPath()
|
QString QFileSystemEngine::tempPath()
|
||||||
|
@ -61,7 +61,7 @@ QFileSystemIterator::QFileSystemIterator(const QFileSystemEntry &entry, QDir::Fi
|
|||||||
{
|
{
|
||||||
Q_UNUSED(nameFilters);
|
Q_UNUSED(nameFilters);
|
||||||
Q_UNUSED(flags);
|
Q_UNUSED(flags);
|
||||||
if (nativePath.endsWith(u".lnk"_qs) && !QFileSystemEngine::isDirPath(dirPath, nullptr)) {
|
if (nativePath.endsWith(u".lnk"_s) && !QFileSystemEngine::isDirPath(dirPath, nullptr)) {
|
||||||
QFileSystemMetaData metaData;
|
QFileSystemMetaData metaData;
|
||||||
QFileSystemEntry link = QFileSystemEngine::getLinkTarget(entry, metaData);
|
QFileSystemEntry link = QFileSystemEngine::getLinkTarget(entry, metaData);
|
||||||
nativePath = link.nativeFilePath();
|
nativePath = link.nativeFilePath();
|
||||||
|
@ -251,7 +251,7 @@ bool QStorageInfoPrivate::queryStorageProperty()
|
|||||||
struct Helper
|
struct Helper
|
||||||
{
|
{
|
||||||
QBasicMutex mutex;
|
QBasicMutex mutex;
|
||||||
QSystemLibrary ntdll {u"ntdll"_qs};
|
QSystemLibrary ntdll {u"ntdll"_s};
|
||||||
};
|
};
|
||||||
Q_GLOBAL_STATIC(Helper, gNtdllHelper)
|
Q_GLOBAL_STATIC(Helper, gNtdllHelper)
|
||||||
|
|
||||||
|
@ -154,7 +154,7 @@ QString QSystemError::string(ErrorScope errorScope, int errorCode)
|
|||||||
qWarning("invalid error scope");
|
qWarning("invalid error scope");
|
||||||
Q_FALLTHROUGH();
|
Q_FALLTHROUGH();
|
||||||
case NoError:
|
case NoError:
|
||||||
return u"No error"_qs;
|
return u"No error"_s;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -260,9 +260,9 @@ QString QMimeType::comment() const
|
|||||||
QStringList languageList;
|
QStringList languageList;
|
||||||
languageList << QLocale().name();
|
languageList << QLocale().name();
|
||||||
languageList << QLocale().uiLanguages();
|
languageList << QLocale().uiLanguages();
|
||||||
languageList << u"default"_qs; // use the default locale if possible.
|
languageList << u"default"_s; // use the default locale if possible.
|
||||||
for (const QString &language : qAsConst(languageList)) {
|
for (const QString &language : qAsConst(languageList)) {
|
||||||
const QString lang = language == "C"_L1 ? u"en_US"_qs : language;
|
const QString lang = language == "C"_L1 ? u"en_US"_s : language;
|
||||||
const QString comm = d->localeComments.value(lang);
|
const QString comm = d->localeComments.value(lang);
|
||||||
if (!comm.isEmpty())
|
if (!comm.isEmpty())
|
||||||
return comm;
|
return comm;
|
||||||
|
@ -1113,7 +1113,7 @@ static QString winIso639LangName(LCID id)
|
|||||||
if (ok && *endptr == '\0') {
|
if (ok && *endptr == '\0') {
|
||||||
switch (i) {
|
switch (i) {
|
||||||
case 0x814:
|
case 0x814:
|
||||||
result = u"nn"_qs; // Nynorsk
|
result = u"nn"_s; // Nynorsk
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -1597,7 +1597,7 @@ QString QRegularExpression::errorString() const
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#ifdef QT_NO_TRANSLATION
|
#ifdef QT_NO_TRANSLATION
|
||||||
return u"no error"_qs;
|
return u"no error"_s;
|
||||||
#else
|
#else
|
||||||
return QCoreApplication::translate("QRegularExpression", "no error");
|
return QCoreApplication::translate("QRegularExpression", "no error");
|
||||||
#endif
|
#endif
|
||||||
|
@ -279,7 +279,7 @@ void QThreadPoolPrivate::startThread(QRunnable *runnable)
|
|||||||
Q_ASSERT(runnable != nullptr);
|
Q_ASSERT(runnable != nullptr);
|
||||||
auto thread = std::make_unique<QThreadPoolThread>(this);
|
auto thread = std::make_unique<QThreadPoolThread>(this);
|
||||||
if (objectName.isEmpty())
|
if (objectName.isEmpty())
|
||||||
objectName = u"Thread (pooled)"_qs;
|
objectName = u"Thread (pooled)"_s;
|
||||||
thread->setObjectName(objectName);
|
thread->setObjectName(objectName);
|
||||||
Q_ASSERT(!allThreads.contains(thread.get())); // if this assert hits, we have an ABA problem (deleted threads don't get removed here)
|
Q_ASSERT(!allThreads.contains(thread.get())); // if this assert hits, we have an ABA problem (deleted threads don't get removed here)
|
||||||
allThreads.insert(thread.get());
|
allThreads.insert(thread.get());
|
||||||
|
@ -55,6 +55,8 @@
|
|||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
using namespace Qt::StringLiterals;
|
||||||
|
|
||||||
QT_IMPL_METATYPE_EXTERN(QNetworkCookie)
|
QT_IMPL_METATYPE_EXTERN(QNetworkCookie)
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -667,7 +669,7 @@ static QDateTime parseDateString(const QByteArray &dateString)
|
|||||||
|
|
||||||
// hour:minute:second.ms pm
|
// hour:minute:second.ms pm
|
||||||
static const QRegularExpression timeRx(
|
static const QRegularExpression timeRx(
|
||||||
u"(\\d\\d?):(\\d\\d?)(?::(\\d\\d?)(?:\\.(\\d{1,3}))?)?(?:\\s*(am|pm))?"_qs);
|
u"(\\d\\d?):(\\d\\d?)(?::(\\d\\d?)(?:\\.(\\d{1,3}))?)?(?:\\s*(am|pm))?"_s);
|
||||||
|
|
||||||
int at = 0;
|
int at = 0;
|
||||||
while (at < dateString.length()) {
|
while (at < dateString.length()) {
|
||||||
|
@ -64,6 +64,8 @@ extern "C" int LookupStringInFixedSet(const unsigned char *graph, std::size_t le
|
|||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
using namespace Qt::StringLiterals;
|
||||||
|
|
||||||
Q_LOGGING_CATEGORY(lcTld, "qt.network.tld")
|
Q_LOGGING_CATEGORY(lcTld, "qt.network.tld")
|
||||||
|
|
||||||
static constexpr int PSL_NOT_FOUND = -1;
|
static constexpr int PSL_NOT_FOUND = -1;
|
||||||
@ -106,7 +108,7 @@ int QPublicSuffixDatabase::lookupDomain(QByteArrayView domain) const
|
|||||||
static QStringList locatePublicSuffixFiles()
|
static QStringList locatePublicSuffixFiles()
|
||||||
{
|
{
|
||||||
return QStandardPaths::locateAll(QStandardPaths::GenericDataLocation,
|
return QStandardPaths::locateAll(QStandardPaths::GenericDataLocation,
|
||||||
u"publicsuffix/public_suffix_list.dafsa"_qs);
|
u"publicsuffix/public_suffix_list.dafsa"_s);
|
||||||
}
|
}
|
||||||
|
|
||||||
QPublicSuffixDatabase::QPublicSuffixDatabase()
|
QPublicSuffixDatabase::QPublicSuffixDatabase()
|
||||||
|
@ -61,6 +61,8 @@
|
|||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
using namespace Qt::StringLiterals;
|
||||||
|
|
||||||
QNetworkManagerInterfaceBase::QNetworkManagerInterfaceBase(QObject *parent)
|
QNetworkManagerInterfaceBase::QNetworkManagerInterfaceBase(QObject *parent)
|
||||||
: QDBusAbstractInterface(QLatin1String(NM_DBUS_SERVICE), QLatin1String(NM_DBUS_PATH),
|
: QDBusAbstractInterface(QLatin1String(NM_DBUS_SERVICE), QLatin1String(NM_DBUS_PATH),
|
||||||
NM_DBUS_INTERFACE, QDBusConnection::systemBus(), parent)
|
NM_DBUS_INTERFACE, QDBusConnection::systemBus(), parent)
|
||||||
@ -137,7 +139,7 @@ static QDBusInterface getPrimaryDevice(const QDBusObjectPath &devicePath)
|
|||||||
|
|
||||||
std::optional<QDBusObjectPath> QNetworkManagerInterface::primaryConnectionDevicePath() const
|
std::optional<QDBusObjectPath> QNetworkManagerInterface::primaryConnectionDevicePath() const
|
||||||
{
|
{
|
||||||
auto it = propertyMap.constFind(u"PrimaryConnection"_qs);
|
auto it = propertyMap.constFind(u"PrimaryConnection"_s);
|
||||||
if (it != propertyMap.cend())
|
if (it != propertyMap.cend())
|
||||||
return it->value<QDBusObjectPath>();
|
return it->value<QDBusObjectPath>();
|
||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
|
@ -58,6 +58,8 @@ static const char m_classErrorMsg[] = "Can't find class \"%s\"";
|
|||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
using namespace Qt::StringLiterals;
|
||||||
|
|
||||||
namespace QtAndroidAccessibility
|
namespace QtAndroidAccessibility
|
||||||
{
|
{
|
||||||
static jmethodID m_addActionMethodID = 0;
|
static jmethodID m_addActionMethodID = 0;
|
||||||
@ -374,7 +376,7 @@ if (!clazz) { \
|
|||||||
const double step = qAbs(valueIface->minimumStepSize().toDouble(&stepIsValid));
|
const double step = qAbs(valueIface->minimumStepSize().toDouble(&stepIsValid));
|
||||||
if (!stepIsValid || qFuzzyIsNull(step)) {
|
if (!stepIsValid || qFuzzyIsNull(step)) {
|
||||||
// Ignore step, use default precision
|
// Ignore step, use default precision
|
||||||
valueStr = qFuzzyIsNull(val) ? u"0"_qs : QString::number(val, 'f');
|
valueStr = qFuzzyIsNull(val) ? u"0"_s : QString::number(val, 'f');
|
||||||
} else {
|
} else {
|
||||||
const int precision = [](double s) {
|
const int precision = [](double s) {
|
||||||
int count = 0;
|
int count = 0;
|
||||||
@ -398,7 +400,7 @@ if (!clazz) { \
|
|||||||
}
|
}
|
||||||
return count;
|
return count;
|
||||||
}(step);
|
}(step);
|
||||||
valueStr = qFuzzyIsNull(val / step) ? u"0"_qs
|
valueStr = qFuzzyIsNull(val / step) ? u"0"_s
|
||||||
: QString::number(val, 'f', precision);
|
: QString::number(val, 'f', precision);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -35,6 +35,8 @@
|
|||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
using namespace Qt::StringLiterals;
|
||||||
|
|
||||||
CustomWidgetsInfo::CustomWidgetsInfo() = default;
|
CustomWidgetsInfo::CustomWidgetsInfo() = default;
|
||||||
|
|
||||||
void CustomWidgetsInfo::acceptUI(DomUI *node)
|
void CustomWidgetsInfo::acceptUI(DomUI *node)
|
||||||
@ -109,8 +111,8 @@ bool CustomWidgetsInfo::isAmbiguousSignal(const QString &className,
|
|||||||
if (signalSignature.startsWith(u"triggered") && extends(className, "QAction"))
|
if (signalSignature.startsWith(u"triggered") && extends(className, "QAction"))
|
||||||
return true;
|
return true;
|
||||||
if (signalSignature.startsWith(u"clicked(")
|
if (signalSignature.startsWith(u"clicked(")
|
||||||
&& extendsOneOf(className, {u"QCommandLinkButton"_qs, u"QCheckBox"_qs,
|
&& extendsOneOf(className, {u"QCommandLinkButton"_s, u"QCheckBox"_s,
|
||||||
u"QPushButton"_qs, u"QRadioButton"_qs, u"QToolButton"_qs})) {
|
u"QPushButton"_s, u"QRadioButton"_s, u"QToolButton"_s})) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@ -137,12 +139,12 @@ QString CustomWidgetsInfo::simpleContainerAddPageMethod(const QString &name) con
|
|||||||
using AddPageMethod = std::pair<QString, QString>;
|
using AddPageMethod = std::pair<QString, QString>;
|
||||||
|
|
||||||
static const AddPageMethod addPageMethods[] = {
|
static const AddPageMethod addPageMethods[] = {
|
||||||
{u"QStackedWidget"_qs, u"addWidget"_qs},
|
{u"QStackedWidget"_s, u"addWidget"_s},
|
||||||
{u"QToolBar"_qs, u"addWidget"_qs},
|
{u"QToolBar"_s, u"addWidget"_s},
|
||||||
{u"QDockWidget"_qs, u"setWidget"_qs},
|
{u"QDockWidget"_s, u"setWidget"_s},
|
||||||
{u"QScrollArea"_qs, u"setWidget"_qs},
|
{u"QScrollArea"_s, u"setWidget"_s},
|
||||||
{u"QSplitter"_qs, u"addWidget"_qs},
|
{u"QSplitter"_s, u"addWidget"_s},
|
||||||
{u"QMdiArea"_qs, u"addSubWindow"_qs}
|
{u"QMdiArea"_s, u"addSubWindow"_s}
|
||||||
};
|
};
|
||||||
for (const auto &m : addPageMethods) {
|
for (const auto &m : addPageMethods) {
|
||||||
if (extends(name, m.first))
|
if (extends(name, m.first))
|
||||||
|
@ -134,6 +134,8 @@
|
|||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
using namespace Qt::StringLiterals;
|
||||||
|
|
||||||
using namespace QCss;
|
using namespace QCss;
|
||||||
|
|
||||||
|
|
||||||
@ -1588,12 +1590,12 @@ public:
|
|||||||
if (propertyIndex == -1) {
|
if (propertyIndex == -1) {
|
||||||
value = obj->property(name.toLatin1()); // might be a dynamic property
|
value = obj->property(name.toLatin1()); // might be a dynamic property
|
||||||
if (!value.isValid()) {
|
if (!value.isValid()) {
|
||||||
if (name == u"class"_qs) {
|
if (name == "class"_L1) {
|
||||||
QString className = QString::fromLatin1(obj->metaObject()->className());
|
QString className = QString::fromLatin1(obj->metaObject()->className());
|
||||||
if (className.contains(QLatin1Char(':')))
|
if (className.contains(QLatin1Char(':')))
|
||||||
className.replace(QLatin1Char(':'), QLatin1Char('-'));
|
className.replace(QLatin1Char(':'), QLatin1Char('-'));
|
||||||
valueStr = className;
|
valueStr = className;
|
||||||
} else if (name == u"style"_qs) {
|
} else if (name == "style"_L1) {
|
||||||
QWidget *w = qobject_cast<QWidget *>(obj);
|
QWidget *w = qobject_cast<QWidget *>(obj);
|
||||||
QStyleSheetStyle *proxy = w ? qt_styleSheet(w->style()) : nullptr;
|
QStyleSheetStyle *proxy = w ? qt_styleSheet(w->style()) : nullptr;
|
||||||
if (proxy)
|
if (proxy)
|
||||||
|
@ -70,6 +70,8 @@
|
|||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
using namespace Qt::StringLiterals;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
class CloseButton : public QAbstractButton
|
class CloseButton : public QAbstractButton
|
||||||
{
|
{
|
||||||
@ -406,12 +408,12 @@ void QTabBarPrivate::init()
|
|||||||
{
|
{
|
||||||
Q_Q(QTabBar);
|
Q_Q(QTabBar);
|
||||||
leftB = new QToolButton(q);
|
leftB = new QToolButton(q);
|
||||||
leftB->setObjectName(u"ScrollLeftButton"_qs);
|
leftB->setObjectName(u"ScrollLeftButton"_s);
|
||||||
leftB->setAutoRepeat(true);
|
leftB->setAutoRepeat(true);
|
||||||
QObject::connect(leftB, SIGNAL(clicked()), q, SLOT(_q_scrollTabs()));
|
QObject::connect(leftB, SIGNAL(clicked()), q, SLOT(_q_scrollTabs()));
|
||||||
leftB->hide();
|
leftB->hide();
|
||||||
rightB = new QToolButton(q);
|
rightB = new QToolButton(q);
|
||||||
rightB->setObjectName(u"ScrollRightButton"_qs);
|
rightB->setObjectName(u"ScrollRightButton"_s);
|
||||||
rightB->setAutoRepeat(true);
|
rightB->setAutoRepeat(true);
|
||||||
QObject::connect(rightB, SIGNAL(clicked()), q, SLOT(_q_scrollTabs()));
|
QObject::connect(rightB, SIGNAL(clicked()), q, SLOT(_q_scrollTabs()));
|
||||||
rightB->hide();
|
rightB->hide();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user