[QScintilla] Border around marker of type QsciScintilla::Background

Phil Thompson phil at riverbankcomputing.com
Wed Mar 5 11:16:51 GMT 2014


On 05-03-2014 10:18 am, Marc Gronle wrote:
> Hello together,
>
> Im new to this mailing list and tried to find out if this question
> already has been posted. I didnt find anything, so please apologize 
> if
> Im wrong.
>
> We use QScintilla for a Python script editor and mark some lines with
> a background marker with a different background color (e.g. red). If
> this color does not have an alpha component, everything is fine.
> However, if there is an alpha component, the rectangular background
> has a black margin, which is not desired, especially if the line 
> below
> or above has the same background color.
>
> I tried to find out where this fact comes from. The alpha-version of
> the marker uses SurfaceImpl::AlphaRectangle in PlatQt.cpp. This
> function modifies the brush of the QPainter, however not the pen. In
> the non-alpha version (RoundedRectangle), the pen is modified and in
> many other functions the pen is explicitely set to NoPen before
> drawing. By not setting set pen, the last configuration is used,
> depending on which function is called before.
>
> If the pen would have been set to NoPen in AlphaRectangle, no border
> should be painted.
>
> Is the border-behaviour desired for the alpha version? Else, maybe my
> suggestion would help to solve this.

If you add the following line before the call to drawRoundRect()...

painter->setPen(convertQColor(outline, alphaOutline));

...does it behave as you want?

Phil


More information about the QScintilla mailing list