views:

69

answers:

2

Hi there,

I want to provide a QtScript source code editor in my application. It would be great if this would have source code highlighting and auto completion.

So I don't want to reinvent the wheel: Is there already a quite good widget for that? I could not find anything on Google...

Cheers, Manuel

A: 

You can use QTextEdit and QSyntaxHighlighter together to get text editing features with syntax highlighting. See Qt's richtext\syntaxhighlighter example.

QtScript is based on the ECMAScript scripting language as is JavaScript, so I guess you could use JavaScript syntax highlighting without any big problems. So if you don't want to code the new QSyntaxHighlighter from scratch, maybe you could use this JavaScript editing widget.

Roku
A: 

See QScintilla. It has Javascript highlighting and (auto-)completion support built-in.

Ivo
I didn't know that a Qt version of this great component exists!
Manuel