So, I have simple code
QMap<QColor, int> colors;
for(int w = 0; w < image.width(); ++w)
for (int h = 0; h < image.height(); ++h)
colors[QColor::fromRgb(image.pixel(w,h))]++;
The error message is
no match for 'operator<' (operand types are 'const QColor' and 'const QColor').
So, qMapLessThanKey is trying unsuccessfully to instantiate comparer of two colors and it's impossible.
Question is: Is it possible to store QColor in a QMap as key as value and not by reference?
Just curious. I know how to write what I want in other way. But it looks for me strange that there is any exceptions in QT on what I can store in map or cannot.