examples/widgets/codeeditor/codeeditor.cpp
changeset 3 41300fa6a67c
parent 0 1918ee327afb
child 4 3b1da2848fc7
equal deleted inserted replaced
2:56cd8111b7f7 3:41300fa6a67c
    48 CodeEditor::CodeEditor(QWidget *parent) : QPlainTextEdit(parent)
    48 CodeEditor::CodeEditor(QWidget *parent) : QPlainTextEdit(parent)
    49 {
    49 {
    50     lineNumberArea = new LineNumberArea(this);
    50     lineNumberArea = new LineNumberArea(this);
    51 
    51 
    52     connect(this, SIGNAL(blockCountChanged(int)), this, SLOT(updateLineNumberAreaWidth(int)));
    52     connect(this, SIGNAL(blockCountChanged(int)), this, SLOT(updateLineNumberAreaWidth(int)));
    53     connect(this, SIGNAL(updateRequest(const QRect &, int)), this, SLOT(updateLineNumberArea(const QRect &, int)));
    53     connect(this, SIGNAL(updateRequest(QRect,int)), this, SLOT(updateLineNumberArea(QRect,int)));
    54     connect(this, SIGNAL(cursorPositionChanged()), this, SLOT(highlightCurrentLine()));
    54     connect(this, SIGNAL(cursorPositionChanged()), this, SLOT(highlightCurrentLine()));
    55 
    55 
    56     updateLineNumberAreaWidth(0);
    56     updateLineNumberAreaWidth(0);
    57     highlightCurrentLine();
    57     highlightCurrentLine();
    58 }
    58 }