QCmyk32: make it equality comparable

... because it is. It's also convenient for tests.

Change-Id: I1b9e21763f62c446890ddd5970df25fcae9484b7
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
This commit is contained in:
Giuseppe D'Angelo 2024-05-27 12:20:21 +02:00
parent 8931f2c836
commit e5a5fe7e29

View File

@ -24,6 +24,10 @@ class QCmyk32
{
private:
uint m_cmyk = 0;
friend constexpr bool comparesEqual(const QCmyk32 &lhs, const QCmyk32 &rhs) noexcept
{
return lhs.m_cmyk == rhs.m_cmyk;
}
public:
QCmyk32() = default;
@ -77,6 +81,8 @@ public:
QColor c = color.toCmyk();
return QCmyk32(c.cyan(), c.magenta(), c.yellow(), c.black());
}
Q_DECLARE_EQUALITY_COMPARABLE_LITERAL_TYPE(QCmyk32)
};
static_assert(sizeof(QCmyk32) == sizeof(int));