path: root/src/corelib/plugin/quuid.h
diff options
authorMarc Mutz <>2020-06-09 12:02:57 +0200
committerMarc Mutz <>2021-07-30 22:54:28 +0200
commit615a9cf99150cfee34c14cfed0aa9583f5993934 (patch)
tree80f69ace058792b1faf39f27ef6f6de97fbe52a8 /src/corelib/plugin/quuid.h
parent09fba5cf3657c19c38e897a11a015d45b4328ae3 (diff)
QUuid: port to QAnyStringView
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 <>
Diffstat (limited to 'src/corelib/plugin/quuid.h')
1 files changed, 6 insertions, 1 deletions
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;
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 &);
+ QString toString(StringFormat mode = WithBraces) const;
QByteArray toByteArray(StringFormat mode = WithBraces) const;
QByteArray toRfc4122() const;