Search code examples
c++qt4text-editordqml

QML/D text editor and basic considerations


I am going to code a text/code editor (GUI with QML and the rest in D*). But I have several problems:

  • I code the GUI with QML and C++ and then I connect it with a D-Backend for formatting etc. purposes. What is the best way to connect different Languages? Pipes, Sockets or in D the ability to use C++ Libraries?

  • IMHO rich text is used to format the text (in most cases). How is it possible to edit this "markup" in an easy way?? Is the formated code like a background image and the user edits an opaque non-formated-text?

  • Are there common techniques?

*Because QML is cool, platform indepedent and fast. On the other hand D is powerful and easy to use.


Solution

  • As you might know, there is QtD, Qt binding for D. It's not production ready right now, but it might be some day.

    Another option would be connecting C++ and D, through C wrapper. This is the most commonly used way of interacting between C++ and D.

    extern(C++) interfaces are specific to DigitalMars C++ compiler on Windows and are very limited, so that probably wouldn't help with your problem.

    Also you might want to look at SWIG. It's a tool automatically generating glue code for interaction of other languages with C++. It supports D.

    If performance is not an issue communications with D code could work through sockets or pipes.