[PyQt] QtScintilla2 and fonts

Detlev Offenbach detlev at die-offenbachs.de
Sat Jun 30 19:07:58 BST 2007


On Samstag, 30. Juni 2007, Phil Thompson wrote:
> On Tuesday 26 June 2007 10:37 pm, kib2 wrote:
> > Phil Thompson a écrit :
> > > On Tuesday 26 June 2007 1:38 pm, kib2 wrote:
> > >> Hi,
> > >>
> > >> I'm trying to play with QtScintilla2 and something is going wrong :
> > >>
> > >> editor = QsciScintilla()
> > >> font = QtGui.QFont()
> > >> font.setFamily("Consolas")
> > >> font.setPointSize(10)
> > >> editor.setFont(font)
> > >> editor.setMarginsFont(font)
> > >>
> > >> the problem here is that the Margin font is set correctly, but not the
> > >> editor one.
> > >>
> > >> Have you got any hint please ? Thanks.
> > >
> > > Works for me.
> > >
> > > Phil
> > > _______________________________________________
> > > PyQt mailing list    PyQt at riverbankcomputing.com
> > > http://www.riverbankcomputing.com/mailman/listinfo/pyqt
> >
> > Hi Phil,
> >
> > you are right, but I badly expressed myself.
> > In fact, I wanted all the different styles to use "Consolas" fonts.
> > So I've read the QScintilla docs and found the save/writeSettings method
> > from a lexer, but never managed to get it work correctly.
> >
> > Can you please give me a sample ?
>
> There is a bug in readSettings() that is fixed in tonight's snapshot.
> Though I don't see how using the settings helps particularly. The eric
> source code is probably the best source of example code.
>
> > I've tried to see a edge line at column 80, but failed.
> > Here's the code :
> >
> > ## Edge Mode
> > editor.EdgeMode(QsciScintilla.EdgeLine)

Shouldn't that be "editor.setEdgeMode(...)"?

> > editor.setEdgeColumn(80)
> > editor.setEdgeColor(QtGui.QColor("#FF0000"))
>
> You need to produce a short complete example that demonstrates the problem.
>

edge mode works perfectly fine in eric4!

Detlev
-- 
Detlev Offenbach
detlev at die-offenbachs.de



More information about the PyQt mailing list