summaryrefslogtreecommitdiffstats
path: root/src/widgets/util
diff options
context:
space:
mode:
authorSona Kurazyan <sona.kurazyan@qt.io>2022-04-25 14:10:21 +0200
committerSona Kurazyan <sona.kurazyan@qt.io>2022-04-26 09:01:26 +0200
commit63b042fb219a42194485e152acf6d305e4594c5c (patch)
tree1fc9ddb37dc81ea6fe1e644aa92a3ac9a823f92b /src/widgets/util
parenta7dc1e280bdb63f893c720947f05ce5e24893f6f (diff)
QtWidgets: stop using QLatin1Char constructor for creating char literals
Required for porting away from QLatin1Char/QLatin1String in scope of QTBUG-98434. As a drive-by, fix qsizetype -> int narrowing conversion warnings for the touched lines. Change-Id: I133b80334b66e0a5ab9546dd8e1ff0631e79601e Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/widgets/util')
-rw-r--r--src/widgets/util/qcompleter.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/widgets/util/qcompleter.cpp b/src/widgets/util/qcompleter.cpp
index 32d3956847..d4911912d0 100644
--- a/src/widgets/util/qcompleter.cpp
+++ b/src/widgets/util/qcompleter.cpp
@@ -983,7 +983,7 @@ static bool completeOnLoaded(const QFileSystemModel *model,
if (prefixSize == pathSize)
return path.compare(prefix, caseSensitivity) == 0 && isRoot(model, path);
// The user is typing something within that directory and is not in a subdirectory yet.
- const auto separator = QLatin1Char('/');
+ const auto separator = u'/';
return prefix.startsWith(path, caseSensitivity) && prefix.at(pathSize) == separator
&& !QStringView{prefix}.right(prefixSize - pathSize - 1).contains(separator);
}
@@ -1893,7 +1893,7 @@ QStringList QCompleter::splitPath(const QString& path) const
parts[0].prepend(QLatin1String("\\\\"));
#else
if (pathCopy[0] == sep) // readd the "/" at the beginning as the split removed it
- parts[0] = QLatin1Char('/');
+ parts[0] = u'/';
#endif
return parts;