PDA

View Full Version : Use Qt Creator's code editor in one's own Qt application?



agarny
21st February 2012, 23:44
This is a topic I have already mentioned before (see here (http://www.qtcentre.org/threads/39259-Use-Qt-Creator-s-text-editor-widget)), but I didn't get any luck back then, so here I go again.

My application relies on a code editor and I am currently using QScintilla2 (http://www.riverbankcomputing.co.uk/software/qscintilla/intro) for that purpose. However, I would rather use Qt Creator's own code editor, if at all possible. I intend to check Qt Creator's source code and see what they have done in that respect, but just out of curiosity: has anyone managed to get Qt Creator's code editor to work in their Qt-based application? If so, then any hint would be most appreciated.

With regards to QScintilla2, there is nothing wrong with it. It's just that I would rather 1) use a solution which is 100% Qt-based and 2) use a non-GPL solution (considering the nature of QScintilla2, a LGPL license would make more sense, but I appreciate that their authors would rather have you pay for it if you are not happy with a GPL license which is fair enough).

ChrisW67
22nd February 2012, 00:23
Have you tried? It seems that using the cppeditor plugin as-is will require inheriting a lot of the Qt Creator infrastructure. To adapt it seems a fair amount of work.

agarny
22nd February 2012, 01:33
No, I haven't tried. I have just downloaded Qt Creator's source code and it would seem that the TextEditor plugin might be what I am after (the CppEditor plugin makes use of it). Still, it seems like it might a bit of work to 'extract' it and make it a standalone widget.