summaryrefslogtreecommitdiff
path: root/src/plugins/glsleditor/glsleditor.cpp
diff options
context:
space:
mode:
authorRoberto Raggi <roberto.raggi@nokia.com>2010-11-10 15:44:59 +0100
committerRoberto Raggi <roberto.raggi@nokia.com>2010-11-10 15:57:39 +0100
commit959edbe10b59a76d2935a4c3e6f05cc68bcdc0b8 (patch)
treeddb40025d54065dabb6985ebc05ef828fd49241d /src/plugins/glsleditor/glsleditor.cpp
parentf6eeed0372c706483809caed181c5d9e879fad91 (diff)
downloadqt-creator-959edbe10b59a76d2935a4c3e6f05cc68bcdc0b8.tar.gz
Introduced a simple incremental lexer for GLSL.
Diffstat (limited to 'src/plugins/glsleditor/glsleditor.cpp')
-rw-r--r--src/plugins/glsleditor/glsleditor.cpp12
1 files changed, 4 insertions, 8 deletions
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 <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/actionmanager/actioncontainer.h>
@@ -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<Highlighter*>(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<QToolBar*>(editable->toolBar());
QList<QAction*> actions = toolBar->actions();