QtCreator - Editor and Code Completion in Custom Project



  • I don’t know whether Qt licensing would allow but I’ve been considering whether it would be possible to use the code editor, code completion and snippets features from QtCreator in a custom project.

    Has anyone investigated or attempted such a project?



  • Qt Creator is licensed under the GPLv3, so you can comply to that or buy the commercial license and keep your code closed.

    DISCLAIMER: I do not work for the Qt Company or on Qt Creator, this is just my understanding of the matter.



  • @vivaladav Thanks for your input.

    The end application should have no problem complying with the GPLv3 license.



  • @webzoid no problem.

    In that case you should be fine.

    Something you probably need to know is that pretty much everything in Qt Creator is a plugin. Which means you might be able to reuse some code, but you will need to handle Qt Creator plugins or to adapt/interface the existing code somehow.



  • @vivaladav Understood - I appreciate that what I'm looking to do won't be so straightforward. Unless I develop a QtCreator plugin for my extensions...


  • Qt Champions 2016

    @webzoid said in QtCreator - Editor and Code Completion in Custom Project:

    extensions

    Hi
    What kind of extensions is that ?
    other source files or ?



  • @mrjj Well, I have managed to set up QtCreator to compile for my Cortex-M4. What I had wanted was to take the code editor, intellisense and snippets (among many other features) and integrate them into my own custom IDE.

    The fundamental change I want to introduce (either as a plugin, if possible, or in my own IDE) is a designer for the TFT display which comes with the Cortex-M4 device mentioned above. I have my own embedded C++ framework for both low-level and high-level functionality - the only thing I don't have is a "designer" as such for the graphical display.

    What I almost envisage is similar to the Qt Widgets designer but in my case, with a fixed widget size (I actually have my own embedded widget set) and links directly to my own API.

    A small undertaking, I know :)


  • Qt Champions 2016

    @webzoid
    Hi
    Ok that sounds interesting. Is that embedded widget set still based on QWidgets and can render on a normal desktop ?
    Or will the designer also on the Cortex and be sort of a mini Designer arm version?
    If you widgets are QWidget based, its should be easy to integrated as Designer plugins and have those
    available to drag and drop from right side.



  • @mrjj Unfortunately it isn't based on the QWidgets due to the memory constraints of the microcontroller. There are similarities but because of the size restriction, the widgets are very limited in functionality.

    The designer will be a "mini" ARM version - basically what you design and see in QtCreator (or the custom IDE) is what you will see on the Cortex-M4.


  • Qt Champions 2016

    @webzoid
    Ok so its very much like
    https://ugfx.io/
    (the author Joel Bodenmann is member here)
    I think he looked at using Creator but ended up writing his own IDE.

    I think changing Designer to use non QWidgets would be huge task but maybe you can wrap them in widgets for Designing and later display native.

    So if designer is mini arm version, wont it be an issue that whole of Creator is widgets ? ( like in too heavy ?)



  • @mrjj Yeah, pretty similar to that.

    I think in the end, I will probably have to write my own IDE but use various features from QtCreator where I can - mainly because I really like how the code editor, etc works. I have considered wrapping the GUI stuff in QWidgets and write my own interpreter which compiles to my native API.

    What would be the ultimate solution is to have a single code base which can run as a Qt application AND also cross-compile as an embedded solution. This would be great but inherently complex. Also, my API (both high and low level) is written in C++ which may be advantageous to the end solution.

    Ultimately, the road ahead is long and extremely winding.


  • Qt Champions 2016

    Hi
    Since its possible to add a completely new language to Creator
    https://github.com/Groterik/qtcreator-dlangeditor

    It should be possible to change it to like your API too and since its c++ based it should
    not be extremely challenging.
    However, the whole Creator base code + plugins is pretty large so it will take some time to become friends.
    I can high recommend this online browser (of Qt source code)
    https://code.woboq.org/qt5/qt-creator/



  • @mrjj Thanks for the links and info. I'm a little torn as to which direction to take this project. I can see the benefits of adding extra "plugins" to QtCreator in order to achieve what I'm looking for however this may well be far more work than starting from the beginning.

    I've managed to find the relevant source code for the cppeditor plugin and the designer so I can see how these plugins work behind the scenes and implement something similar in my own application.

    I think the element I'm going to struggle with the most is the visual designer. Having looked for examples of similar kinds of applications/widgets, I've not yet managed to find anything which I could use as a base.


  • Qt Champions 2016

    Hi
    Im also not sure if reusing Creator is more code than making the mini version your self.
    It really depends on how much work it is to make it like your "widgets"
    Also maintenance, if they find bug in some code you have reused then patching is not
    super straight forward unless old code is intact.

    For a Designer, i guess any editor with WYSIWYG could be used.
    I liked this one
    https://github.com/paceholder/nodeeditor



  • @mrjj I think a mini-version is probably the best idea in both the short and long term. I just really like a number of features from QtCreator which I'd love to implement which is why I had considered using QtCreator as a base.

    I think nodeeditor is a good place to start. There was an awesome C# designer which I'd used many moons ago by a company called DevExpress - unfortunately, they do not offer this as a QtWidget.


  • Qt Champions 2016

    @webzoid
    For syntax and those features, there are alot of of Qt editors you might be able to reuse from.
    Like http://monkeystudio.org/node/1
    (its Qt4 age so might be issue in Qt5.10)
    Creator gets from the Kate (KDE) as far as i know so much of it you can get with no that much fuss.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.