From 615a9cf99150cfee34c14cfed0aa9583f5993934 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 9 Jun 2020 12:02:57 +0200 Subject: QUuid: port to QAnyStringView MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove the QString/QStringView/QLatin1String/const char* overloads from the API, but not the ABI. As a drive-by, replace a use of QStringView::left() by truncate(), as suggested by a comment. [ChangeLog][QtCore][QUuid] The from-string constructor and the fromString() function now take QAnyStringView (was: overload set with a subset of QString, QByteArray, const char*, QLatin1String, QStringView each). Change-Id: If7fa26cfbef9280480c78b669d9f5f14118995ed Reviewed-by: MÃ¥rten Nordheim Reviewed-by: Thiago Macieira --- src/corelib/plugin/quuid.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/corelib/plugin/quuid.h') diff --git a/src/corelib/plugin/quuid.h b/src/corelib/plugin/quuid.h index 9192542684..9229d5b694 100644 --- a/src/corelib/plugin/quuid.h +++ b/src/corelib/plugin/quuid.h @@ -97,12 +97,17 @@ public: uchar b4, uchar b5, uchar b6, uchar b7, uchar b8) noexcept : data1(l), data2(w1), data3(w2), data4{b1, b2, b3, b4, b5, b6, b7, b8} {} + explicit QUuid(QAnyStringView string) noexcept + : QUuid{fromString(string)} {} + static QUuid fromString(QAnyStringView string) noexcept; +#if QT_REMOVED_SINCE(6, 3) explicit QUuid(const QString &); static QUuid fromString(QStringView string) noexcept; static QUuid fromString(QLatin1String string) noexcept; explicit QUuid(const char *); - QString toString(StringFormat mode = WithBraces) const; explicit QUuid(const QByteArray &); +#endif + QString toString(StringFormat mode = WithBraces) const; QByteArray toByteArray(StringFormat mode = WithBraces) const; QByteArray toRfc4122() const; #if QT_REMOVED_SINCE(6, 3) -- cgit v1.2.3