summaryrefslogtreecommitdiffstats
path: root/src/tools
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2016-01-25 13:22:55 +0100
committerMarc Mutz <marc.mutz@kdab.com>2016-02-19 18:16:38 +0000
commit1da975cdc5297ddde584981c4bf301b288ccaca9 (patch)
tree188ad7a00c8f1f8a53f627a59f7664013ce603fc /src/tools
parent342acf66fe640c72e1a7c8837ba5cdefae06f9c9 (diff)
QLatin1String: add at()/op[]/mid()/right()/left()
QLatin1String can be used as a string-view-like type. When attempting to do so in uic, mid() and at() were found to be missing. Added the others for completeness. Use the new functions in uic, for which they were originally conceived. [ChangeLog][QtCore][QLatin1String] Added at(), operator[](), mid(), right(), left(). Change-Id: I4cfe3e9ed1157dedee754b2012d9678fe72b161e Reviewed-by: Milian Wolff <milian.wolff@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/uic/cpp/cppwriteinitialization.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/tools/uic/cpp/cppwriteinitialization.cpp b/src/tools/uic/cpp/cppwriteinitialization.cpp
index 0886cf4c4a..ebb7f8691a 100644
--- a/src/tools/uic/cpp/cppwriteinitialization.cpp
+++ b/src/tools/uic/cpp/cppwriteinitialization.cpp
@@ -785,8 +785,7 @@ void WriteInitialization::acceptWidget(DomWidget *node)
DomPropertyList headerProperties;
for (auto realPropertyName : realPropertyNames) {
const QString fakePropertyName = QLatin1String("header")
- + QChar(QLatin1Char(realPropertyName.data()[0])).toUpper()
- + QLatin1String(realPropertyName.data() + 1, realPropertyName.size() - 1);
+ + QChar(realPropertyName.at(0)).toUpper() + realPropertyName.mid(1);
if (DomProperty *fakeProperty = attributes.value(fakePropertyName)) {
fakeProperty->setAttributeName(realPropertyName);
headerProperties << fakeProperty;
@@ -807,8 +806,7 @@ void WriteInitialization::acceptWidget(DomWidget *node)
DomPropertyList headerProperties;
for (auto realPropertyName : realPropertyNames) {
const QString fakePropertyName = headerPrefix
- + QChar(QLatin1Char(realPropertyName.data()[0])).toUpper()
- + QLatin1String(realPropertyName.data() + 1, realPropertyName.size() - 1);
+ + QChar(realPropertyName.at(0)).toUpper() + realPropertyName.mid(1);
if (DomProperty *fakeProperty = attributes.value(fakePropertyName)) {
fakeProperty->setAttributeName(realPropertyName);
headerProperties << fakeProperty;