| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent c8d0136 commit 79dbd7a
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -74,6 +74,15 @@ void SqlTextEdit::updateLineNumberAreaWidth() | |||
| 74 | 74 | setMarginWidth(0, QFontMetrics(font).width(QString("0").repeated(digits)) + 5); | |
| 75 | 75 | } | |
| 76 | 76 | ||
| 77 | + void SqlTextEdit::setLexer(QsciLexer* lexer) | ||
| 78 | + { | ||
| 79 | + // Call the parent implementation | ||
| 80 | + QsciScintilla::setLexer(lexer); | ||
| 81 | + | ||
| 82 | + // This is called in the constructor of the editor but as the lexer isn't set at that time it doesn't do anything | ||
| 83 | + updateLineNumberAreaWidth(); | ||
| 84 | + } | ||
| 85 | + | ||
| 77 | 86 | void SqlTextEdit::dropEvent(QDropEvent* e) | |
| 78 | 87 | { | |
| 79 | 88 | QList<QUrl> urls = e->mimeData()->urls(); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,6 +4,7 @@ | |||
| 4 | 4 | #include "Qsci/qsciscintilla.h" | |
| 5 | 5 | ||
| 6 | 6 | class SqlUiLexer; | |
| 7 | + class QsciLexer; | ||
| 7 | 8 | ||
| 8 | 9 | /** | |
| 9 | 10 | * @brief The SqlTextEdit class | |
@@ -18,6 +19,8 @@ class SqlTextEdit : public QsciScintilla | |||
| 18 | 19 | explicit SqlTextEdit(QWidget *parent = 0); | |
| 19 | 20 | virtual ~SqlTextEdit(); | |
| 20 | 21 | ||
| 22 | + virtual void setLexer(QsciLexer* lexer); | ||
| 23 | + | ||
| 21 | 24 | protected: | |
| 22 | 25 | void dropEvent(QDropEvent* e); | |
| 23 | 26 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments