Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. (Solved)How To Conversion From .... to ..... ?
Forum Updated to NodeBB v4.3 + New Features

(Solved)How To Conversion From .... to ..... ?

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 1.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vpwal
    wrote on last edited by
    #1

    Hi all how i can convert ?

    QByteArray to const unsigned char*

    Thanks.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      Salvatello
      wrote on last edited by
      #2

      @const unsigned char* begin = reinterpret_cast<unsigned char*>(byteArrayBuffer.data());

      const unsigned char* end = begin + byteArrayBuffer.length();
      std::vector<unsigned char> bufferToCompress( begin, end );@

      1 Reply Last reply
      0
      • V Offline
        V Offline
        vpwal
        wrote on last edited by
        #3

        That was look promising.

        Thank you for quick Help......Salvatello

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi,

          Since it seems you won't be modifying the content of the QByteArray, it should rather be

          @const unsigned char begin = reinterpret_cast<const unsigned char>(byteArrayBuffer.constData());@

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • V Offline
            V Offline
            vpwal
            wrote on last edited by
            #5

            Thanks..again to SGaist

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved