On Wed, Aug 22, 2012 at 10:55 AM, Sensei <sense...@gmail.com> wrote: > If I change the font to "Courier", or "Times", or "Andale Mono" or > Xcode's "Menlo", everything is OK, I've tested alignment with 10K lines. > > When I use "Monaco", the font I intended to use, lines numbers get > misaligned almost immediately. > > > CodeEditor::CodeEditor(QWidget *parent) : QPlainTextEdit(parent) > { > lineNumberArea = new LineNumberArea(this); > > connect(this, SIGNAL(blockCountChanged(int)), this, > SLOT(updateLineNumberAreaWidth(int))); > connect(this, SIGNAL(updateRequest(QRect,int)), this, > SLOT(updateLineNumberArea(QRect,int))); > connect(this, SIGNAL(cursorPositionChanged()), this, > SLOT(highlightCurrentLine())); > > setFont(QFont("Courier", 22)); > > updateLineNumberAreaWidth(0); > highlightCurrentLine(); > } > > > 1) use the same font for the line number as the text editor -
or 2) set the hight of each line in the panel, as the hight of each line in the editor.
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest