Important: Please read the Qt Code of Conduct -

What is a proper conversion from QString to std::byte?

  • I need somehow convert QString to std::byte .In google alot suggests to QByteArray(which i also was thinking at first), but description of this type frighten me:

    Like char and unsigned char, it can be used to access raw memory occupied by other objects (object representation), but unlike those types, it is not a character type and is not an arithmetic type. A byte is only a collection of bits, and the only operators defined for it are the bitwise ones.

    That description which Bold, i totally can't get...

  • @Engelard
    Indeed go via QByteArray, and don't fret about what you've written in bold about std::byte definition rationale!

Log in to reply