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] converting data hex value stored in QString to ASCII format

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

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 1.1k Views
  • 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 Offline
    R Offline
    reem9611
    wrote on last edited by
    #1

    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
    0

    • Login

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