qcolor 和 htmlcolor 互转
注意:#f0f0f0
QString str = "f0f0f0";不要带#
1 QColor c(255,0,255); 2 //QColor >> QRgb(uint) 3 QRgb mRgb = qRgb(c.red(),c.green(),c.blue()); 4 //QRgb(uint) >> QColor; 5 QColor mColor = QColor(mRgb); 6 //QRgb(uint) >> QString; 7 QString mRgbStr = QString::number(mRgb,16); 8 //QString >> unint >> QColor 9 QColor color2(mRgbStr.toUInt(NULL,16));