This thread from stackoverflow might help.

Basically, you would use QString::number() as you have been, but replace the "4" with the value obtained from:

Qt Code:
  1. std::numeric_limits< double >::max_digits10
To copy to clipboard, switch view to plain text mode