mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 11:00:44 -06:00
Move syntax highlighter objects to SqlTextEdit class
Any SqlTextEdit object has its SQL syntax highlighter anyway, so it makes sense to move the syntax highlighter object inside the text edit class instead of maintining somewhere else. This hopefully makes the code a bit easier to maintain.
This commit is contained in:
@@ -26,9 +26,6 @@ SqlExecutionArea::SqlExecutionArea(QWidget* parent, DBBrowserDB* _db) :
|
||||
logfont.setPointSize(PreferencesDialog::getSettingsValue("log", "fontsize").toInt());
|
||||
ui->editErrors->setFont(logfont);
|
||||
|
||||
// Create syntax highlighter
|
||||
highlighter = new SQLiteSyntaxHighlighter(ui->editEditor->document());
|
||||
|
||||
// Create model
|
||||
model = new SqliteTableModel(this, db, PreferencesDialog::getSettingsValue("db", "prefetchsize").toInt());
|
||||
ui->tableResult->setModel(model);
|
||||
@@ -47,7 +44,7 @@ SqlExecutionArea::~SqlExecutionArea()
|
||||
|
||||
void SqlExecutionArea::setTableNames(const QStringList& tables)
|
||||
{
|
||||
highlighter->setTableNames(tables);
|
||||
ui->editEditor->syntaxHighlighter()->setTableNames(tables);
|
||||
}
|
||||
|
||||
QString SqlExecutionArea::getSql() const
|
||||
|
||||
Reference in New Issue
Block a user