views:

87

answers:

1

Greetings,

in one of my applications I provide a simple code editor based on a QTextEdit widget and the QSyntaxHighlighter. I was wondering if there is function, library or generally a way to allow the user to have his/her code re-formatted and intented within the application?

Websites like this allow you to re-format and intent JavaScript/QtScript/ECMAScript code easily, but it would be nice to have a "Format Code" button right next to the code editor.

A: 

You could try to experiment with astyle or indent. Although these programs are mostly made to format C/C++, they might give acceptable results with javascript.

Job