Qt 4.4.0, MS VS 2005
consider this piece of code:
QList<QPair<QColor,QString> > colorlist;
{
colorlist.
append(qMakePair
(QColor(name
),name
));
if (!c1.isValid() || c1.alpha()>255 || name=="transparent")
{
qDebug("haha");
}
}
QStringList names = QColor::colorNames();
QList<QPair<QColor,QString> > colorlist;
foreach(QString name, names)
{
colorlist.append(qMakePair(QColor(name),name));
QColor c1(name);
if (!c1.isValid() || c1.alpha()>255 || name=="transparent")
{
qDebug("haha");
QMessageBox::warning(0,"1",QString::number(c1.alpha()));
}
}
To copy to clipboard, switch view to plain text mode
colorNames returned list of 148 colors "Qt knows about" (ORLY?..), but when I construct QColor("transparent") it behaves wrong.
1. The MS VS debugger shows that its alpha equals 65535, but the alpha() returns 255. Well that isn't very important BUT
2. WTF it returns 255, when "transparent" means (0,0,0,0)? btw if I create QColor c(Qt::transparent) it's correct.
Well, should I report this to Trolltech's bug tracker
Bookmarks