void CodeEditor::setupMargins() { updateLineNumberMarginWidth(); setMarginSensitivity(0, true); setMarginSensitivity(1, true); markerDefine(QsciScintilla::RightArrow, MARKER); setMarkerBackgroundColor(QColor("#ee1111"), MARKER); markerDefine(QsciScintilla::Background, LINE_BG); setMarkerBackgroundColor(QColor("#ffff00").lighter(170), LINE_BG); }
QSourceCodeWidget::QSourceCodeWidget( int _index, const char * fname, const char * srcTxt ) : QsciScintilla ( 0 ) { index = _index; long_name = QString(fname); short_name = QFileInfo(long_name).fileName(); QFont font(tr("Courier New")); font.setPointSize(8); setLexer(new QsciLexerCPP); lexer()->setFont(font); setText( QString(srcTxt) ); setReadOnly(true); setFolding(QsciScintilla::BoxedTreeFoldStyle); setMarginType(1,QsciScintilla::NumberMargin); setMarginWidth(1,30); setMarginSensitivity(1,true); current_marker=0; }