Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.15.0
-
3768a915bcf6aecf6bb445d7a6abfb78e505b4d7 (qt/qtbase/dev) 2cd77a1e22999d184708fec05ebc226eacec65cb (qt/qtbase/5.15)
Description
The documentation says that the colors are equal if they have the same RGB and
alpha values (see: https://doc.qt.io/qt-5/qcolor.html#operator-eq-eq ).
However, It appears that also the types of colors are checked. Like if two colors with different spec, but same RGB and same alpha values, == returns false.
QColor col1(255, 255, 255, 255); QColor colHSV = col1.toHsv(); // copy of the color above in a HSV format qDebug() << "RGBAs are equal - " << (col1.rgba() == colHSV.rgba()); // Return true qDebug() << "Names are equal - " << (col1.name() == colHSV.name()); // Return true qDebug() << "Colors are equal - " << (col1 == colHSV); // Return False
Documentation should include this detail too.
Attachments
For Gerrit Dashboard: QTBUG-84436 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
301788,2 | Update QColor::operator== documentation | 5.15 | qt/qtbase | Status: MERGED | +2 | 0 |
301840,5 | Update QColor::operator== documentation | dev | qt/qtbase | Status: MERGED | +2 | 0 |