[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyQt] QScintilla problems.
From:       Barry Scott <barry () barrys-emacs ! org>
Date:       2019-08-21 16:23:32
Message-ID: 69A286A1-695A-4F58-8DA6-73E2A1D79D4A () barrys-emacs ! org
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


> On 20 Aug 2019, at 18:49, Phil Thompson <phil@riverbankcomputing.com> wrote:
> 
> On 20/08/2019 15:05, Colin McPhail wrote:
> > > On 18 Aug 2019, at 19:30, Barry Scott <barry@barrys-emacs.org> wrote:
> > > The attached code shows two problems with QScintilla.
> > > 1. SCI_STYLEGETFONT does not return the font.
> > > 2. Changing the size to 24pt makes line spacing be 24pt but the text is drawn \
> > > in 11pt. (1) looks likes a bug.
> > > (2) may be that I do not understand something about how to drive the API.
> > > What makes Scintilla use the changed settings.
> > > (3) Changing the font does not seem to work either.
> > > What am I misunderstanding?
> > > Barry
> > I'm not a QScintilla expert but I imagine most people use the
> > convenience methods of QScintilla objects such as setFont() and
> > setText(). I've attached a version of your example code that uses
> > those methods.
> 
> Yes - the main purpose of the low-level API is to support the needs of the \
> high-level API. It should only need to be used if there is some feature of \
> Scintilla that hasn't got a higher level abstraction.

Using setFont() has got my code working again. Original code is 3 years old and only \
broke recently.

The reason I was using the low level API is that the high level API does not support \
my use case, as far as I can tell.

I'm using Qscintilla to make a side-by-side diff tool. I colour text to make it easy \
to see inserted, deleted and modified text. This I do by using SCI_STYLESETFORE and
SCI_STYLESETBACK for 4 style numbers.

I use STYLE_DEFAULT, STYLE_LASTPREDEFINED+1, STYLE_LASTPREDEFINED+2
and STYLE_LASTPREDEFINED+3.

I'm also using INDIC and folding via the low level API.

BTW the PyPi description page has a bad link to the docs of
http://pyqt.sourceforge.net/Docs/QScintilla2/ \
<http://pyqt.sourceforge.net/Docs/QScintilla2/> I guess it should be \
https://www.riverbankcomputing.com/static/Docs/QScintilla/ \
<https://www.riverbankcomputing.com/static/Docs/QScintilla/>


Barry



> 
> Phil
> _______________________________________________
> PyQt mailing list    PyQt@riverbankcomputing.com
> https://www.riverbankcomputing.com/mailman/listinfo/pyqt


[Attachment #5 (unknown)]

<html><head><meta http-equiv="Content-Type" content="text/html; \
charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: \
space; line-break: after-white-space;" class=""><br class=""><div><br \
class=""><blockquote type="cite" class=""><div class="">On 20 Aug 2019, at 18:49, \
Phil Thompson &lt;<a href="mailto:phil@riverbankcomputing.com" \
class="">phil@riverbankcomputing.com</a>&gt; wrote:</div><br \
class="Apple-interchange-newline"><div class=""><div class="">On 20/08/2019 15:05, \
Colin McPhail wrote:<br class=""><blockquote type="cite" class=""><blockquote \
type="cite" class="">On 18 Aug 2019, at 19:30, Barry Scott &lt;<a \
href="mailto:barry@barrys-emacs.org" class="">barry@barrys-emacs.org</a>&gt; \
wrote:<br class="">The attached code shows two problems with QScintilla.<br \
class="">1. SCI_STYLEGETFONT does not return the font.<br class="">2. Changing the \
size to 24pt makes line spacing be 24pt but the text is drawn in 11pt.<br \
class="">(1) looks likes a bug.<br class="">(2) may be that I do not understand \
something about how to drive the API.<br class="">What makes Scintilla use the \
changed settings.<br class="">(3) Changing the font does not seem to work either.<br \
class="">What am I misunderstanding?<br class="">Barry<br class=""></blockquote>I'm \
not a QScintilla expert but I imagine most people use the<br class="">convenience \
methods of QScintilla objects such as setFont() and<br class="">setText(). I've \
attached a version of your example code that uses<br class="">those methods.<br \
class=""></blockquote><br class="">Yes - the main purpose of the low-level API is to \
support the needs of the high-level API. It should only need to be used if there is \
some feature of Scintilla that hasn't got a higher level abstraction.<br \
class=""></div></div></blockquote><div><br class=""></div><div>Using setFont() has \
got my code working again. Original code is 3 years old and only broke \
recently.</div><div><br class=""></div><div>The reason I was using the low level API \
is that the high level API does not support my</div><div>use case, as far as I can \
tell.</div><div><br class=""></div><div>I'm using Qscintilla to make a side-by-side \
diff tool. I colour text to make it easy to see</div><div>inserted, deleted and \
modified text. This I do by using SCI_STYLESETFORE and</div><div>SCI_STYLESETBACK for \
4 style numbers.</div><div><br class=""></div><div>I \
use&nbsp;STYLE_DEFAULT,&nbsp;STYLE_LASTPREDEFINED+1, \
STYLE_LASTPREDEFINED+2</div><div>and STYLE_LASTPREDEFINED+3.</div><div><br \
class=""></div><div>I'm also using INDIC and folding via the low level \
API.</div><div><br class=""></div><div>BTW the PyPi description page has a bad link \
to the docs of</div><div><a href="http://pyqt.sourceforge.net/Docs/QScintilla2/" \
class="">http://pyqt.sourceforge.net/Docs/QScintilla2/</a>&nbsp;I guess it should \
be</div><div><a href="https://www.riverbankcomputing.com/static/Docs/QScintilla/" \
class="">https://www.riverbankcomputing.com/static/Docs/QScintilla/</a></div><div><br \
class=""></div><div><br class=""></div><div>Barry</div><div><br \
class=""></div><div><br class=""></div><br class=""><blockquote type="cite" \
class=""><div class=""><div class=""><br class="">Phil<br \
class="">_______________________________________________<br class="">PyQt mailing \
list &nbsp;&nbsp;&nbsp;<a href="mailto:PyQt@riverbankcomputing.com" \
class="">PyQt@riverbankcomputing.com</a><br class=""><a \
href="https://www.riverbankcomputing.com/mailman/listinfo/pyqt" \
class="">https://www.riverbankcomputing.com/mailman/listinfo/pyqt</a><br \
class=""></div></div></blockquote></div><br class=""></body></html>


[Attachment #6 (text/plain)]

_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
https://www.riverbankcomputing.com/mailman/listinfo/pyqt


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic