Results 1 to 2 of 2

Thread: bug with QColor(QString& name)

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2008
    Posts
    57
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default bug with QColor(QString& name)

    Qt 4.4.0, MS VS 2005
    consider this piece of code:
    Qt Code:
    1. QStringList names = QColor::colorNames();
    2. QList<QPair<QColor,QString> > colorlist;
    3. foreach(QString name, names)
    4. {
    5. colorlist.append(qMakePair(QColor(name),name));
    6. QColor c1(name);
    7. if (!c1.isValid() || c1.alpha()>255 || name=="transparent")
    8. {
    9. qDebug("haha");
    10. QMessageBox::warning(0,"1",QString::number(c1.alpha()));
    11. }
    12. }
    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

  2. #2
    Join Date
    Jun 2008
    Posts
    57
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: bug with QColor(QString& name)

    damn..someone else has reported this bug in January, but Trolltech didn't fix it till 4.4.0 grr, only in 4.4.1
    http://trolltech.com/developer/task-...ntry&id=193671

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.