johnmauer
17th June 2010, 13:45
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.
QString hexZero = QString::number(0, 16);
Perhaps there is a better way to get the hex string for a given QColor, and I'm just too blind to see it.
QString hexZero = QString::number(0, 16);
Perhaps there is a better way to get the hex string for a given QColor, and I'm just too blind to see it.