[QScintilla] Bug in QsciScintilla::edgeColor

Marc Gronle marc.gronle at ito.uni-stuttgart.de
Fri Sep 23 13:24:03 BST 2016


Hi Phil,

I just wondered why Qt is printing a warning "QColor::setRgb: RGB
parameters out of range" if
the method edgeColor() of QsciScintilla is called. Debugging into this
function leads to the reason:

The long variable res contains the full RGB value as uint32 value. While
the blue and green component are split from res using a bit-shift and
bitmask, the red component is directly obtained
from res, hence, a value that is much bigger than 255.

Probably the implementation:

QColor QsciScintilla::edgeColor() const
{
    long res = SendScintilla(SCI_GETEDGECOLOUR);

    return QColor((int)res & 0x00ff, ((int)(res >> 8)) & 0x00ff, ((int)(res
>> 16)) & 0x00ff);
}

will solve the problem.

Best regards

Marc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/qscintilla/attachments/20160923/4ac01591/attachment.html>


More information about the QScintilla mailing list