Commit 09206ba0 authored by Marco Bubke's avatar Marco Bubke

Utils: Add explicit conversion operator to QString to SmallStringView

Change-Id: I759651c6426337256b514055132806bf91e93e33
Reviewed-by: Tim Jenssen's avatarTim Jenssen <tim.jenssen@qt.io>
parent 1ac525ba
......@@ -27,7 +27,7 @@
#include "smallstringiterator.h"
#include <QtGlobal>
#include <QString>
#include <cstring>
#include <string>
......@@ -116,6 +116,11 @@ public:
return std::string(data(), size());
}
explicit operator QString() const
{
return QString::fromUtf8(data(), int(size()));
}
bool startsWith(SmallStringView subStringToSearch) const noexcept
{
if (size() >= subStringToSearch.size())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment