Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    [Solved] converting data hex value stored in QString to ASCII format

    General and Desktop
    1
    1
    1012
    Loading More Posts
    • 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.
    • R
      reem9611 last edited by

      I am reading data from the device through serial interface .First I received weird data then I try to convert what I am receiving to hex and it and the output I get is 31204a756c203230313320 , how I can convert this ASCII format?

      @
      QByteArray inComBuffer;
      if (port->bytesAvailable()) {

          inComBuffer.append(port->readAll().toHex());
      
          QString version=inComBuffer.mid(12,22);
      
          ui->recvEdit->insertPlainText(version);
      

      }
      @

      1 Reply Last reply Reply Quote 0
      • First post
        Last post