cd Qt4 qmake make sudo make install
LIBS += -lqscintilla2
#include <QtGui> #include <Qsci/qsciscintilla.h> #include <Qsci/qscilexercpp.h> #include "mainwindow.h" MainWindow::MainWindow() { textEdit = new QsciScintilla; // textEdit->setUtf8(true); // setCentralWidget(textEdit); // ui QsciLexerCPP * lexCpp = new QsciLexerCPP(this); // ( ) textEdit->setLexer(lexCpp); // ++ }
private: QSciScintilla *textEdit;
//! textEdit->setCaretLineVisible(true); textEdit->setCaretLineBackgroundColor(QColor("gainsboro")); //! textEdit->setAutoIndent(true); textEdit->setIndentationGuides(false); textEdit->setIndentationsUseTabs(true); textEdit->setIndentationWidth(4); //! margin , breakpoints textEdit->setMarginsBackgroundColor(QColor("gainsboro")); textEdit->setMarginLineNumbers(1, true); textEdit->setMarginWidth(1, 50); //! - textEdit->setAutoCompletionSource(QsciScintilla::AcsAll); textEdit->setAutoCompletionCaseSensitivity(true); textEdit->setAutoCompletionReplaceWord(true); textEdit->setAutoCompletionUseSingle(QsciScintilla::AcusAlways); textEdit->setAutoCompletionThreshold(0); //! textEdit->setBraceMatching(QsciScintilla::SloppyBraceMatch); textEdit->setMatchedBraceBackgroundColor(Qt::yellow); textEdit->setUnmatchedBraceForegroundColor(Qt::blue);
Source: https://habr.com/ru/post/144411/
All Articles