summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarsten Heimrich <karsten.heimrich@qt.io>2020-06-09 13:22:51 +0200
committerKarsten Heimrich <karsten.heimrich@qt.io>2020-06-10 14:15:25 +0200
commitb455feb8fe34317c3c99c7d470fbe28c34402a40 (patch)
tree6122703367ddcd0b91508575ae7868ce7dd26ac2
parentcf38426863ee0d3b0400821e1d95a1f9ef4d1f6d (diff)
Qt6: Port QtKnx to QStringView
Task-number: QTBUG-84319 Change-Id: I1f09e79d67b03f8e340b0e6cef84a1d7f5bc8613 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
-rw-r--r--src/knx/knxproj/qknxbuildings.cpp8
-rw-r--r--src/knx/knxproj/qknxdeviceinstance.cpp12
-rw-r--r--src/knx/knxproj/qknxgroupaddresses.cpp4
-rw-r--r--src/knx/knxproj/qknxinstallation.cpp8
-rw-r--r--src/knx/knxproj/qknxprojectinformation.cpp12
-rw-r--r--src/knx/knxproj/qknxprojectroot.cpp4
-rw-r--r--src/knx/knxproj/qknxprojectutils.cpp8
-rw-r--r--src/knx/knxproj/qknxprojectutils_p.h8
-rw-r--r--src/knx/knxproj/qknxtopology.cpp8
-rw-r--r--src/knx/qknxaddress.cpp10
-rw-r--r--src/knx/ssl/qknxkeyring.cpp20
-rw-r--r--src/knx/ssl/qsslsocket_openssl_symbols.cpp6
12 files changed, 54 insertions, 54 deletions
diff --git a/src/knx/knxproj/qknxbuildings.cpp b/src/knx/knxproj/qknxbuildings.cpp
index ff81bc1..8728811 100644
--- a/src/knx/knxproj/qknxbuildings.cpp
+++ b/src/knx/knxproj/qknxbuildings.cpp
@@ -42,7 +42,7 @@ bool QKnxGroupAddressRef::parseElement(QXmlStreamReader *reader, bool pedantic)
auto attrs = reader->attributes();
// required attributes
- QStringRef attr;
+ QStringView attr;
if (!QKnxProjectUtils::fetchAttr(attrs, QStringLiteral("Id"), &attr, reader))
return false;
if (!QKnxProjectUtils::setNCName(QLatin1String("Id"), attr, &Id, reader, pedantic))
@@ -83,7 +83,7 @@ bool QKnxFunction::parseElement(QXmlStreamReader *reader, bool pedantic)
auto attrs = reader->attributes();
// required attributes
- QStringRef attr;
+ QStringView attr;
if (!QKnxProjectUtils::fetchAttr(attrs, QStringLiteral("Id"), &attr, reader))
return false;
if (!QKnxProjectUtils::setNCName(QLatin1String("Id"), attr, &Id, reader, pedantic))
@@ -144,7 +144,7 @@ bool QKnxBuildingPart::parseElement(QXmlStreamReader *reader, bool pedantic)
auto attrs = reader->attributes();
// required attributes
- QStringRef attr;
+ QStringView attr;
if (!QKnxProjectUtils::fetchAttr(attrs, QStringLiteral("Id"), &attr, reader))
return false;
if (!QKnxProjectUtils::setNCName(QLatin1String("Id"), attr, &Id, reader, pedantic))
@@ -192,7 +192,7 @@ bool QKnxBuildingPart::parseElement(QXmlStreamReader *reader, bool pedantic)
return false;
BuildingPart.append(part);
} else if (reader->name() == QStringLiteral("DeviceInstanceRef")) {
- QStringRef attr;
+ QStringView attr;
if (!QKnxProjectUtils::fetchAttr(reader->attributes(), QLatin1String("RefId"),
&attr, reader)) return false;
QString refId;
diff --git a/src/knx/knxproj/qknxdeviceinstance.cpp b/src/knx/knxproj/qknxdeviceinstance.cpp
index 8c27010..f772fe6 100644
--- a/src/knx/knxproj/qknxdeviceinstance.cpp
+++ b/src/knx/knxproj/qknxdeviceinstance.cpp
@@ -50,7 +50,7 @@ bool QKnxParameterInstanceRef::parseElement(QXmlStreamReader *reader, bool pedan
auto attrs = reader->attributes();
// required attributes
- QStringRef attr;
+ QStringView attr;
if (!QKnxProjectUtils::fetchAttr(attrs, QLatin1String("RefId"), &attr, reader))
return false;
if (!QKnxProjectUtils::setNCName(QLatin1String("RefId"), attr, &RefId, reader, pedantic))
@@ -79,7 +79,7 @@ bool QKnxConnectors::parseElement(QXmlStreamReader *reader, bool pedantic)
auto fetchAttributes = [&](const QXmlStreamAttributes &attrs, QKnxConnector *connector) -> bool
{
// required attributes
- QStringRef attr;
+ QStringView attr;
if (!QKnxProjectUtils::fetchAttr(attrs, QLatin1String("GroupAddressRefId"), &attr, reader))
return false;
if (!QKnxProjectUtils::setNCName(QLatin1String("GroupAddressRefId"), attr,
@@ -191,7 +191,7 @@ bool QKnxChannelInstance::parseElement(QXmlStreamReader *reader, bool pedantic)
auto attrs = reader->attributes();
// required attributes
- QStringRef attr;
+ QStringView attr;
if (!QKnxProjectUtils::fetchAttr(attrs, QLatin1String("Id"), &attr, reader))
return false;
if (!QKnxProjectUtils::setNCName(QLatin1String("Id"), attr, &Id, reader, pedantic))
@@ -222,7 +222,7 @@ bool QKnxAdditionalAddress::parseElement(QXmlStreamReader *reader, bool pedantic
auto attrs = reader->attributes();
// required attributes
- QStringRef attr;
+ QStringView attr;
if (!QKnxProjectUtils::fetchAttr(attrs, QStringLiteral("Address"), &attr, reader))
return false;
auto address = attr.toUInt();
@@ -368,7 +368,7 @@ bool QKnxBusInterface::parseElement(QXmlStreamReader *reader, bool pedantic)
reader->skipCurrentElement();
continue;
}
- QStringRef attr;
+ QStringView attr;
if (!QKnxProjectUtils::fetchAttr(reader->attributes(),
QStringLiteral("GroupAddressRefId"), &attr, reader)) return false;
if (pedantic && !QKnxProjectUtils::isNCName(attr.toString()))
@@ -404,7 +404,7 @@ bool QKnxDeviceInstance::parseElement(QXmlStreamReader *reader, bool pedantic)
auto attrs = reader->attributes();
// required attributes
- QStringRef attr;
+ QStringView attr;
if (!QKnxProjectUtils::fetchAttr(attrs, QLatin1String("Id"), &attr, reader))
return false;
if (!QKnxProjectUtils::setNCName(QLatin1String("Id"), attr, &Id, reader, pedantic))
diff --git a/src/knx/knxproj/qknxgroupaddresses.cpp b/src/knx/knxproj/qknxgroupaddresses.cpp
index 460723e..18aecdd 100644
--- a/src/knx/knxproj/qknxgroupaddresses.cpp
+++ b/src/knx/knxproj/qknxgroupaddresses.cpp
@@ -50,7 +50,7 @@ bool QKnxGroupAddress::parseElement(QXmlStreamReader *reader, bool pedantic)
auto attrs = reader->attributes();
// required attributes
- QStringRef attr;
+ QStringView attr;
if (!QKnxProjectUtils::fetchAttr(attrs, QStringLiteral("Id"), &attr, reader))
return false;
if (!QKnxProjectUtils::setNCName(QLatin1String("Id"), attr, &Id, reader, pedantic))
@@ -112,7 +112,7 @@ bool QKnxGroupRange::parseElement(QXmlStreamReader *reader, bool pedantic)
auto attrs = reader->attributes();
// required attributes
- QStringRef attr;
+ QStringView attr;
if (!QKnxProjectUtils::fetchAttr(attrs, QStringLiteral("Id"), &attr, reader))
return false;
if (!QKnxProjectUtils::setNCName(QLatin1String("Id"), attr, &Id, reader, pedantic))
diff --git a/src/knx/knxproj/qknxinstallation.cpp b/src/knx/knxproj/qknxinstallation.cpp
index c351805..001998e 100644
--- a/src/knx/knxproj/qknxinstallation.cpp
+++ b/src/knx/knxproj/qknxinstallation.cpp
@@ -43,7 +43,7 @@ bool QKnxTrade::parseElement(QXmlStreamReader *reader, bool pedantic)
auto attrs = reader->attributes();
// required attributes
- QStringRef attr;
+ QStringView attr;
if (!QKnxProjectUtils::fetchAttr(attrs, QLatin1String("Name"), &attr, reader))
return false;
if (!QKnxProjectUtils::setString(QLatin1String("Name"), attr, 255, &Name, reader, pedantic))
@@ -74,7 +74,7 @@ bool QKnxTrade::parseElement(QXmlStreamReader *reader, bool pedantic)
return false;
Trade.append(trade);
} else if (reader->name() == QStringLiteral("DeviceInstanceRef")) {
- QStringRef attr;
+ QStringView attr;
if (!QKnxProjectUtils::fetchAttr(reader->attributes(), QStringLiteral("RefId"),
&attr, reader)) return false;
QString refId;
@@ -107,7 +107,7 @@ bool QKnxSplitInfo::parseElement(QXmlStreamReader *reader, bool pedantic)
auto attrs = reader->attributes();
// required attributes
- QStringRef attr;
+ QStringView attr;
if (!QKnxProjectUtils::fetchAttr(attrs, QStringLiteral("ObjectPath"), &attr, reader))
return false;
ObjectPath = attr.toString();
@@ -137,7 +137,7 @@ bool QKnxInstallation::parseElement(QXmlStreamReader *reader, bool pedantic)
auto attrs = reader->attributes();
// required attributes
- QStringRef attr;
+ QStringView attr;
if (!QKnxProjectUtils::fetchAttr(attrs, QLatin1String("Name"), &attr, reader))
return false;
if (!QKnxProjectUtils::setString(QLatin1String("Name"), attr, 50, &Name, reader,
diff --git a/src/knx/knxproj/qknxprojectinformation.cpp b/src/knx/knxproj/qknxprojectinformation.cpp
index 260e24d..0120561 100644
--- a/src/knx/knxproj/qknxprojectinformation.cpp
+++ b/src/knx/knxproj/qknxprojectinformation.cpp
@@ -42,7 +42,7 @@ bool QKnxHistoryEntry::parseElement(QXmlStreamReader *reader, bool pedantic)
auto attrs = reader->attributes();
// required attributes
- QStringRef attr;
+ QStringView attr;
if (!QKnxProjectUtils::fetchAttr(attrs, QStringLiteral("Date"), &attr, reader))
return false;
Date = QDateTime::fromString(attr.toString(), Qt::ISODateWithMs);
@@ -77,7 +77,7 @@ bool QKnxToDoItem::parseElement(QXmlStreamReader *reader, bool pedantic)
auto attrs = reader->attributes();
// required attributes
- QStringRef attr;
+ QStringView attr;
if (!QKnxProjectUtils::fetchAttr(attrs, QStringLiteral("Description"), &attr, reader))
return false;
Description = attr.toString();
@@ -109,7 +109,7 @@ bool QKnxProjectTrace::parseElement(QXmlStreamReader *reader, bool /*pedantic*/)
auto attrs = reader->attributes();
// required attributes
- QStringRef attr;
+ QStringView attr;
if (!QKnxProjectUtils::fetchAttr(attrs, QStringLiteral("Date"), &attr, reader))
return false;
Date = QDateTime::fromString(attr.toString(), Qt::ISODateWithMs);
@@ -141,7 +141,7 @@ bool QKnxDeviceCertificate::parseElement(QXmlStreamReader *reader, bool pedantic
auto attrs = reader->attributes();
// required attributes
- QStringRef attr;
+ QStringView attr;
if (!QKnxProjectUtils::fetchAttr(attrs, QStringLiteral("SerialNumber"), &attr, reader))
return false;
SerialNumber = attr.toUtf8();
@@ -176,7 +176,7 @@ bool QKnxUserFile::parseElement(QXmlStreamReader *reader, bool pedantic)
auto attrs = reader->attributes();
// required attributes
- QStringRef attr;
+ QStringView attr;
if (!QKnxProjectUtils::fetchAttr(attrs, QLatin1String("Filename"), &attr, reader))
return false;
if (!QKnxProjectUtils::setString(QLatin1String("Filename"), attr, 255, &Filename,
@@ -204,7 +204,7 @@ bool QKnxProjectInformation::parseElement(QXmlStreamReader *reader, bool pedanti
auto attrs = reader->attributes();
// required attributes
- QStringRef attr;
+ QStringView attr;
if (!QKnxProjectUtils::fetchAttr(attrs, QLatin1String("Name"), &attr, reader))
return false;
if (!QKnxProjectUtils::setString(QLatin1String("Name"), attr, 50, &Name, reader, pedantic))
diff --git a/src/knx/knxproj/qknxprojectroot.cpp b/src/knx/knxproj/qknxprojectroot.cpp
index b7241b5..be0cb23 100644
--- a/src/knx/knxproj/qknxprojectroot.cpp
+++ b/src/knx/knxproj/qknxprojectroot.cpp
@@ -42,7 +42,7 @@ bool QKnxAddinData::parseElement(QXmlStreamReader *reader, bool pedantic)
auto attrs = reader->attributes();
// required attributes
- QStringRef attr;
+ QStringView attr;
if (!QKnxProjectUtils::fetchAttr(attrs, QLatin1String("AddinId"), &attr, reader))
return false;
if (!QKnxProjectUtils::setNCName(QLatin1String("AddinId"), attr, &AddinId, reader, pedantic))
@@ -69,7 +69,7 @@ bool QKnxProject::parseElement(QXmlStreamReader *reader, bool pedantic)
return false;
if (reader->name() == QLatin1String("Project")) {
- QStringRef attr; // required attribute
+ QStringView attr; // required attribute
if (!QKnxProjectUtils::fetchAttr(reader->attributes(), QLatin1String("Id"), &attr, reader))
return false;
if (!QKnxProjectUtils::setNCName(QLatin1String("Id"), attr, &Id, reader, pedantic))
diff --git a/src/knx/knxproj/qknxprojectutils.cpp b/src/knx/knxproj/qknxprojectutils.cpp
index 7cef564..c82a6ac 100644
--- a/src/knx/knxproj/qknxprojectutils.cpp
+++ b/src/knx/knxproj/qknxprojectutils.cpp
@@ -42,7 +42,7 @@ bool QKnxProjectUtils::isNCName(const QString &candidate)
return QXmlUtils::isNCName(candidate);
}
-bool QKnxProjectUtils::setNCName(const QString &name, const QStringRef &attr, QString *field,
+bool QKnxProjectUtils::setNCName(const QString &name, QStringView attr, QString *field,
QXmlStreamReader *reader, bool pedantic)
{
if (!reader || !field)
@@ -59,7 +59,7 @@ bool QKnxProjectUtils::setNCName(const QString &name, const QStringRef &attr, QS
}
bool QKnxProjectUtils::fetchAttr(const QXmlStreamAttributes &attributes, const QString &attrName,
- QStringRef *value, QXmlStreamReader *reader)
+ QStringView *value, QXmlStreamReader *reader)
{
if (!value || !reader)
return false;
@@ -70,7 +70,7 @@ bool QKnxProjectUtils::fetchAttr(const QXmlStreamAttributes &attributes, const Q
return !reader->hasError();
}
-bool QKnxProjectUtils::setString(const QString &name, const QStringRef &attr, int maxSize,
+bool QKnxProjectUtils::setString(const QString &name, QStringView attr, int maxSize,
QString *field, QXmlStreamReader *reader, bool pedantic)
{
if (!reader || !field)
@@ -85,7 +85,7 @@ bool QKnxProjectUtils::setString(const QString &name, const QStringRef &attr, in
return !reader->hasError();
}
-bool QKnxProjectUtils::setString(const QString &name, const QStringRef &attr,
+bool QKnxProjectUtils::setString(const QString &name, QStringView attr,
const QStringList &list, QString *field, QXmlStreamReader *reader, bool pedantic)
{
if (!reader || !field)
diff --git a/src/knx/knxproj/qknxprojectutils_p.h b/src/knx/knxproj/qknxprojectutils_p.h
index e619d59..e18c7d0 100644
--- a/src/knx/knxproj/qknxprojectutils_p.h
+++ b/src/knx/knxproj/qknxprojectutils_p.h
@@ -54,16 +54,16 @@ struct Q_KNX_EXPORT QKnxProjectUtils final
public:
static bool isNCName(const QString &candidate);
- static bool setNCName(const QString &name, const QStringRef &attr, QString *field,
+ static bool setNCName(const QString &name, QStringView attr, QString *field,
QXmlStreamReader *reader, bool pedantic);
static bool fetchAttr(const QXmlStreamAttributes &attributes, const QString &attrName,
- QStringRef *value, QXmlStreamReader *reader);
+ QStringView *value, QXmlStreamReader *reader);
- static bool setString(const QString &name, const QStringRef &attr, int maxSize,
+ static bool setString(const QString &name, QStringView attr, int maxSize,
QString *field, QXmlStreamReader *reader, bool pedantic);
- static bool setString(const QString &name, const QStringRef &attr, const QStringList &list,
+ static bool setString(const QString &name, QStringView attr, const QStringList &list,
QString *field, QXmlStreamReader *reader, bool pedantic);
template< typename T> static bool setNumber(const QString &name, const T &attr, T maxValue,
diff --git a/src/knx/knxproj/qknxtopology.cpp b/src/knx/knxproj/qknxtopology.cpp
index c8d8498..b25f444 100644
--- a/src/knx/knxproj/qknxtopology.cpp
+++ b/src/knx/knxproj/qknxtopology.cpp
@@ -45,7 +45,7 @@ bool QKnxBusAccess::parseElement(QXmlStreamReader *reader, bool pedantic)
auto attrs = reader->attributes();
// required attributes
- QStringRef attr;
+ QStringView attr;
if (!QKnxProjectUtils::fetchAttr(attrs, QStringLiteral("Name"), &attr, reader))
return false;
Name = attr.toString();
@@ -76,7 +76,7 @@ bool QKnxAdditionalGroupAddress::parseElement(QXmlStreamReader *reader, bool /*p
return false;
if (reader->name() == QStringLiteral("GroupAddress")) {
- QStringRef attr; // required attribute
+ QStringView attr; // required attribute
if (!QKnxProjectUtils::fetchAttr(reader->attributes(), QLatin1String("Address"), &attr,
reader)) return false;
Address = attr.toUShort();
@@ -100,7 +100,7 @@ bool QKnxLine::parseElement(QXmlStreamReader *reader, bool pedantic)
auto attrs = reader->attributes();
// required attributes
- QStringRef attr;
+ QStringView attr;
if (!QKnxProjectUtils::fetchAttr(attrs, QLatin1String("Id"), &attr, reader))
return false;
if (!QKnxProjectUtils::setNCName(QLatin1String("Id"), attr, &Id, reader, pedantic))
@@ -182,7 +182,7 @@ bool QKnxArea::parseElement(QXmlStreamReader *reader, bool pedantic)
auto attrs = reader->attributes();
// required attributes
- QStringRef attr;
+ QStringView attr;
if (!QKnxProjectUtils::fetchAttr(attrs, QLatin1String("Name"), &attr, reader))
return false;
if (!QKnxProjectUtils::setString(QLatin1String("Name"), attr, 255, &Name, reader, pedantic))
diff --git a/src/knx/qknxaddress.cpp b/src/knx/qknxaddress.cpp
index f1b12e8..e245ef6 100644
--- a/src/knx/qknxaddress.cpp
+++ b/src/knx/qknxaddress.cpp
@@ -140,8 +140,8 @@ QKnxAddress::QKnxAddress(QKnxAddress::Type type, const QString &address)
return;
QVector<quint16> sections;
- const auto convert = [&sections](const QVector<QStringRef> &in) -> bool {
- for (const QStringRef &section : qAsConst(in)) {
+ const auto convert = [&sections](const QVector<QStringView> &in) -> bool {
+ for (const QStringView &section : qAsConst(in)) {
bool ok = false;
const quint16 value = section.toUShort(&ok, 0);
if (!ok)
@@ -152,7 +152,7 @@ QKnxAddress::QKnxAddress(QKnxAddress::Type type, const QString &address)
};
if (slashes && type == QKnxAddress::Type::Group) {
- if (!convert(address.splitRef(QLatin1Char('/'))))
+ if (!convert(QStringView{address}.split(QLatin1Char('/'))))
return;
if (sections.count() == 2)
*this = QKnxAddress(type, sections[0], nullptr, sections[1]);
@@ -160,11 +160,11 @@ QKnxAddress::QKnxAddress(QKnxAddress::Type type, const QString &address)
*this = QKnxAddress(type, sections[0], &sections[1], sections[2]);
}
if (dots && type == QKnxAddress::Type::Individual) {
- if (convert(address.splitRef(QLatin1Char('.'))) && sections.count() == 3)
+ if (convert(QStringView{address}.split(QLatin1Char('.'))) && sections.count() == 3)
*this = QKnxAddress(type, sections[0], &sections[1], sections[2]);
}
if (type == QKnxAddress::Type::Group || type == QKnxAddress::Type::Individual) {
- if (convert({ address.midRef(0) }) && sections.count() == 1) {
+ if (convert({ QStringView{address}.mid(0) }) && sections.count() == 1) {
m_type = type;
m_address = sections[0];
}
diff --git a/src/knx/ssl/qknxkeyring.cpp b/src/knx/ssl/qknxkeyring.cpp
index ff31b7b..2efdbf9 100644
--- a/src/knx/ssl/qknxkeyring.cpp
+++ b/src/knx/ssl/qknxkeyring.cpp
@@ -50,7 +50,7 @@ namespace QKnx { namespace Ets { namespace Keyring {
namespace QKnxPrivate
{
- void writeBytes(QByteArray *dest, const QStringRef &source)
+ void writeBytes(QByteArray *dest, QStringView source)
{
dest->append(quint8(source.size()));
dest->append(source.toString().toUtf8());
@@ -88,7 +88,7 @@ namespace QKnxPrivate
}
static bool fetchAttr(const QXmlStreamAttributes &attributes, const QString &attrName,
- QStringRef *value, QXmlStreamReader *reader)
+ QStringView *value, QXmlStreamReader *reader)
{
if (!value || !reader)
return false;
@@ -99,7 +99,7 @@ namespace QKnxPrivate
return !reader->hasError();
}
- static bool setString(const QString &name, const QStringRef &attr, int maxSize,
+ static bool setString(const QString &name, QStringView attr, int maxSize,
QString *field, QXmlStreamReader *reader, bool pedantic)
{
if (!reader || !field)
@@ -114,7 +114,7 @@ namespace QKnxPrivate
return !reader->hasError();
}
- bool setString(const QString &name, const QStringRef &attr, const QStringList &list,
+ bool setString(const QString &name, QStringView attr, const QStringList &list,
QString *field, QXmlStreamReader *reader, bool pedantic)
{
if (!reader || !field)
@@ -147,7 +147,7 @@ bool QKnxBackbone::parseElement(QXmlStreamReader *reader, bool pedantic)
if (reader->name() == QStringLiteral("Backbone")) {
auto attrs = reader->attributes();
- QStringRef attr; // mandatory attributes
+ QStringView attr; // mandatory attributes
if (!QKnxPrivate::fetchAttr(attrs, QStringLiteral("MulticastAddress"), &attr, reader))
return false;
MulticastAddress = attr.toString();
@@ -194,7 +194,7 @@ bool QKnxInterface::QKnxGroup::parseElement(QXmlStreamReader *reader, bool pedan
if (reader->name() == QStringLiteral("Group")) {
auto attrs = reader->attributes();
- QStringRef attr; // mandatory attributes
+ QStringView attr; // mandatory attributes
if (!QKnxPrivate::fetchAttr(attrs, QStringLiteral("Address"), &attr, reader))
return false;
Address = attr.toUShort();
@@ -228,7 +228,7 @@ bool QKnxInterface::parseElement(QXmlStreamReader *reader, bool pedantic)
if (reader->name() == QStringLiteral("Interface")) {
auto attrs = reader->attributes();
- QStringRef attr; // mandatory attribute
+ QStringView attr; // mandatory attribute
if (!QKnxPrivate::fetchAttr(attrs, QLatin1String("Type"), &attr, reader))
return false;
if (!QKnxPrivate::setString(QLatin1String("Type"), attr, {
@@ -274,7 +274,7 @@ bool QKnxGroupAddresses::QKnxGroup::parseElement(QXmlStreamReader *reader, bool
if (reader->name() == QStringLiteral("Group")) {
auto attrs = reader->attributes();
- QStringRef attr; // mandatory attributes
+ QStringView attr; // mandatory attributes
if (!QKnxPrivate::fetchAttr(attrs, QStringLiteral("Address"), &attr, reader))
return false;
Address = attr.toUShort();
@@ -330,7 +330,7 @@ bool QKnxDevice::parseElement(QXmlStreamReader *reader, bool pedantic)
if (reader->name() == QStringLiteral("Device")) {
auto attrs = reader->attributes();
- QStringRef attr; // mandatory attribute
+ QStringView attr; // mandatory attribute
if (!QKnxPrivate::fetchAttr(attrs, QLatin1String("IndividualAddress"), &attr, reader))
return false;
IndividualAddress = attr.toString();
@@ -389,7 +389,7 @@ bool QKnxKeyring::parseElement(QXmlStreamReader *reader, bool pedantic)
if (reader->name() == QStringLiteral("Keyring")) {
auto attrs = reader->attributes();
- QStringRef attr; // mandatory attributes
+ QStringView attr; // mandatory attributes
if (!QKnxPrivate::fetchAttr(attrs, QLatin1String("Project"), &attr, reader))
return false;
if (!QKnxPrivate::setString(QLatin1String("Project"), attr, 255, &Project, reader, pedantic))
diff --git a/src/knx/ssl/qsslsocket_openssl_symbols.cpp b/src/knx/ssl/qsslsocket_openssl_symbols.cpp
index 7598abe..ea3e805 100644
--- a/src/knx/ssl/qsslsocket_openssl_symbols.cpp
+++ b/src/knx/ssl/qsslsocket_openssl_symbols.cpp
@@ -607,7 +607,7 @@ bool q_resolveOpenSslSymbols()
struct NumericallyLess
{
typedef bool result_type;
- result_type operator()(const QStringRef &lhs, const QStringRef &rhs) const
+ result_type operator()(QStringView lhs, QStringView rhs) const
{
bool ok = false;
int b = 0;
@@ -629,8 +629,8 @@ struct LibGreaterThan
typedef bool result_type;
result_type operator()(const QString &lhs, const QString &rhs) const
{
- const QVector<QStringRef> lhsparts = lhs.splitRef(QLatin1Char('.'));
- const QVector<QStringRef> rhsparts = rhs.splitRef(QLatin1Char('.'));
+ const QVector<QStringView> lhsparts = QStringView{lhs}.split(QLatin1Char('.'));
+ const QVector<QStringView> rhsparts = QStringView{rhs}.split(QLatin1Char('.'));
Q_ASSERT(lhsparts.count() > 1 && rhsparts.count() > 1);
// note: checking rhs < lhs, the same as lhs > rhs