I have QSet<QuadPattern> texture;
and I would like modify all QuadPattern in a loop.
foreach
is not the good solution because it makes a copy.
With this code :
QMutableSetIterator<QuadPattern> it(texture); while (it.hasNext()) { it.next(); it.value().setCoordinate(...)); }
I get a compilation error :
error: C2662: 'QuadPattern::setCoordinate' : cannot convert 'this' pointer from 'const QuadPattern' to 'QuadPattern &'
Conversion loses qualifiers
The function setCoordinate
is like this :
inline void setCoordinate(const std::pair &value) { _coordinate = value; }
Why this error ?