Using QLineEdit::setHtml with font changes requires "#rrggbb" for arbitrary colors. Each QColor can be broken into the requisite subset easily, and then converted to a hex string. However, the string for zero in hex should be "00" yet the following code gives "0". The workaround is obvious but I am curious as to the reason if anyone knows.
Qt Code:
  1. QString hexZero = QString::number(0, 16);
To copy to clipboard, switch view to plain text mode 
Perhaps there is a better way to get the hex string for a given QColor, and I'm just too blind to see it.