Possible bug in annotations?

7 views
Skip to first unread message

snim2

unread,
Apr 28, 2011, 7:21:49 AM4/28/11
to scintilla-interest
Hi there,

I'm using the PyQt4 bindings to QScintilla (PyQt4, Qt4.7.2, Python2.7,
QtDesigner 4.7.2, Ubuntu Natty) and I have a GUI with two QScintilla
panes, side by side. The GUI has a SLOT that adds annotations to
certain lines, which I want to be styled.

I've created the GUI in QtDesigner, and my own code styles both editor
panes in the same way, so I would expect there would be no difference
between the two. When I add an annotation to each editor for testing,
one is styled in the annotation style I have set, and the other is
not. Oddly, it's always the right hand pane which is wrong, if I swap
them over like this:

self.leftEditor, self.rightEditor = self.rightEditor,
self.leftEditor

then it's still the right hand pane which is incorrect.

I made a cut down version of the GUI just to show you what the bug
looks like: http://imgur.com/dcRbi

In the image, both annotations should look like the left hand one,
with a yellow background and smaller, italicized text. The code which
generates this I've put here: https://gist.github.com/944268

there's still quite a bit of "irrelevant" code there, including
everything generated by Designer, as I can't really be sure what's
causing the bug.

So, my question is, have I used the API incorrectly or is this a
problem with QScintilla?

Many thanks,

Sarah

Neil Hodgson

unread,
Apr 28, 2011, 7:27:44 PM4/28/11
to scintilla...@googlegroups.com
snim2:

> I made a cut down version of the GUI just to show you what the bug
> looks like: http://imgur.com/dcRbi
>
> In the image, both annotations should look like the left hand one,
> with a yellow background and smaller, italicized text. The code which
> generates this I've put here: https://gist.github.com/944268

I don't use QScintilla but my guess is that there is some sort of
once-only use or a reference-counting issue.

Perhaps the style number allocation caused by using -1 in the
QsciStyle call only occurs in the context of the first editor instance
it is used with and you should have separate calls to QsciStyle for
each instance. The use of -1 here is specific to QScintilla and not
generic Scintilla.

There may be a forum or other support mechanism specifically for
QScintilla with people more knowledgeable about this issue.

Neil

snim2

unread,
Apr 28, 2011, 9:01:52 PM4/28/11
to scintilla-interest
I think you're absolutely right about the annotations. I didn't
appreciate that this wasn't the qscintilla-dev list, I'll ask in a
more appropriate forum!

Thanks,

Sarah
Reply all
Reply to author
Forward
0 new messages