mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-10-25 08:08:50 +00:00
Add Qt helper for constructin rdcstr directly from QString
This commit is contained in:
4 files changed
+13
-7
No files matched your search
@@ -590,6 +590,11 @@ struct rdcstr : public rdcarray<char>
|
||||
// cast operators
|
||||
operator std::string() const { return std::string(elems, elems + usedCount); }
|
||||
#if defined(RENDERDOC_QT_COMPAT)
|
||||
rdcstr(const QString &in) : rdcarray<char>()
|
||||
{
|
||||
QByteArray arr = in.toUtf8();
|
||||
assign(arr.data(), arr.size());
|
||||
}
|
||||
operator QString() const { return QString::fromUtf8(elems, usedCount); }
|
||||
operator QVariant() const { return QVariant(QString::fromUtf8(elems, usedCount)); }
|
||||
#endif
|
||||
|
||||
Reference in new issue
Block a user