Qt Code:
  1. double dbl = 7.01;
  2. QByteArray ba((const char*)&dbl, sizeof(dbl));
To copy to clipboard, switch view to plain text mode