From 959edbe10b59a76d2935a4c3e6f05cc68bcdc0b8 Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Wed, 10 Nov 2010 15:44:59 +0100 Subject: Introduced a simple incremental lexer for GLSL. --- src/plugins/glsleditor/glsleditor.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src/plugins/glsleditor/glsleditor.cpp') diff --git a/src/plugins/glsleditor/glsleditor.cpp b/src/plugins/glsleditor/glsleditor.cpp index 4cee79db69..8e58371981 100644 --- a/src/plugins/glsleditor/glsleditor.cpp +++ b/src/plugins/glsleditor/glsleditor.cpp @@ -31,6 +31,7 @@ #include "glsleditoreditable.h" #include "glsleditorconstants.h" #include "glsleditorplugin.h" +#include "glslhighlighter.h" #include #include @@ -89,7 +90,7 @@ GLSLTextEditor::GLSLTextEditor(QWidget *parent) : connect(this, SIGNAL(textChanged()), this, SLOT(updateDocument())); -// baseTextDocument()->setSyntaxHighlighter(new Highlighter(document())); + baseTextDocument()->setSyntaxHighlighter(new Highlighter(document())); // if (m_modelManager) { // m_semanticHighlighter->setModelManager(m_modelManager); @@ -147,8 +148,6 @@ Core::Context GLSLEditorEditable::context() const void GLSLTextEditor::setFontSettings(const TextEditor::FontSettings &fs) { TextEditor::BaseTextEditor::setFontSettings(fs); -#warning set up the GLSL highlighter -#if 0 Highlighter *highlighter = qobject_cast(baseTextDocument()->syntaxHighlighter()); if (!highlighter) return; @@ -175,7 +174,6 @@ void GLSLTextEditor::setFontSettings(const TextEditor::FontSettings &fs) highlighter->setFormats(fs.toTextCharFormats(categories)); highlighter->rehighlight(); -#endif } QString GLSLTextEditor::wordUnderCursor() const @@ -202,7 +200,9 @@ void GLSLTextEditor::createToolBar(GLSLEditorEditable *editable) { m_outlineCombo = new QComboBox; m_outlineCombo->setMinimumContentsLength(22); +#ifdef __GNUC__ #warning set up the outline model +#endif // m_outlineCombo->setModel(m_outlineModel); QTreeView *treeView = new QTreeView; @@ -219,10 +219,6 @@ void GLSLTextEditor::createToolBar(GLSLEditorEditable *editable) policy.setHorizontalPolicy(QSizePolicy::Expanding); m_outlineCombo->setSizePolicy(policy); - connect(m_outlineCombo, SIGNAL(activated(int)), this, SLOT(jumpToOutlineElement(int))); - - connect(file(), SIGNAL(changed()), this, SLOT(updateFileName())); - QToolBar *toolBar = static_cast(editable->toolBar()); QList actions = toolBar->actions(); -- cgit v1.2.1