开发者

QML/D text editor and basic considerations

I am going to code a text/code editor (GUI with QML and the rest in D*开发者_JS百科). 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.


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.


QML isn't for WebApp. It s QtQuick Markup Language. The 'new' way to do UI at Qt. And QWidget will probably be deprecated in favor of QML in Qt5.

I've try to do the same thing. But i fear that qml isn't ready yet to do things like that. Most element available today are just good enought to draw image, rectangle, listview, one line text input and do transition.

I was trying to achieve that by coloring with python and pygments, too slow, using html3.2 style to do that isn't the right way. But it's the only way to style text in qml textedit. ;(

QtQuick 2.0 should bring better text control.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜