FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

qscintilla: Fix line number not being shown at first · sqlitebrowser/sqlitebrowser@79dbd7a · GitHub

Commit 79dbd7a

Browse files
committed
qscintilla: Fix line number not being shown at first
1 parent c8d0136 commit 79dbd7a

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

‎src/sqltextedit.cpp‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,15 @@ void SqlTextEdit::updateLineNumberAreaWidth()
7474
setMarginWidth(0, QFontMetrics(font).width(QString("0").repeated(digits)) + 5);
7575
}
7676

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+
7786
void SqlTextEdit::dropEvent(QDropEvent* e)
7887
{
7988
QList<QUrl> urls = e->mimeData()->urls();

‎src/sqltextedit.h‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include "Qsci/qsciscintilla.h"
55

66
class SqlUiLexer;
7+
class QsciLexer;
78

89
/**
910
* @brief The SqlTextEdit class
@@ -18,6 +19,8 @@ class SqlTextEdit : public QsciScintilla
1819
explicit SqlTextEdit(QWidget *parent = 0);
1920
virtual ~SqlTextEdit();
2021

22+
virtual void setLexer(QsciLexer* lexer);
23+
2124
protected:
2225
void dropEvent(QDropEvent* e);
2326

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL