qscintilla: Enable code folding

This commit is contained in:
Martin Kleusberg
2015-04-17 17:43:46 +02:00
parent 24ce374bb0
commit 6fed5ec7c2
2 changed files with 7 additions and 1 deletions

View File

@@ -8,6 +8,10 @@ SqlUiLexer::SqlUiLexer(QObject* parent) :
autocompleteApi = new QsciAPIs(this);
setupAutoCompletion();
autocompleteApi->prepare();
// Setup folding
setFoldComments(true);
setFoldCompact(false);
}
void SqlUiLexer::setupAutoCompletion()

View File

@@ -79,6 +79,9 @@ SqlTextEdit::SqlTextEdit(QWidget* parent) :
// Set tab width
setTabWidth(PreferencesDialog::getSettingsValue("editor", "tabsize").toInt());
// Enable folding
setFolding(QsciScintilla::BoxedTreeFoldStyle);
}
SqlTextEdit::~SqlTextEdit()
@@ -112,7 +115,6 @@ void SqlTextEdit::dropEvent(QDropEvent* e)
f.close();
}
void SqlTextEdit::setupSyntaxHighlightingFormat(const QString& settings_name, int style)
{
sqlLexer->setColor(QColor(PreferencesDialog::getSettingsValue("syntaxhighlighter", settings_name + "_colour").toString()), style);