12 #include "IException.h" 
   25       result = QColor(
string.mid(1, 2).
toInt(NULL, 16), 
string.mid(3, 2).
toInt(NULL, 16),
 
   26                       string.mid(5, 2).
toInt(NULL, 16), 
string.mid(7, 2).
toInt(NULL, 16));
 
   41     if (color.isValid()) {
 
   42       result = QString(
"#%1%2%3%4")
 
   43           .arg(color.red(), 2, 16, QChar(
'0'))
 
   44           .arg(color.green(), 2, 16, QChar(
'0'))
 
   45           .arg(color.blue(), 2, 16, QChar(
'0'))
 
   46           .arg(color.alpha(), 2, 16, QChar(
'0'));
 
   50           "Can not convert an invalid color to an RGBA string.  There is no string representation " 
   51             "of an invalid color.",
 
   65     return QRegExp(
"^#[0-9a-fA-F]{8}$");