Qt: Rich text editor

Created on 17 Nov 2016  路  7Comments  路  Source: therecipe/qt

Putting in here as a result of discussion on slack.

It would be useful to have a rich text editor that supports, fonts, justification etc, so that users can write reports, save them, print them, and convert to PDF

Qt has one
http://doc.qt.io/qt-5/qtwidgets-richtext-textedit-example.html

What this does:

  • its actually a HTML editor. Dont know if it supports markdown ?

I am not sure how to build this in go ?
http://doc.qt.io/qt-5/qtwidgets-richtext-textedit-textedit-cpp.html
The imports at the top are basically what i also have to import in golang too ?
Then just copy the logic of what the cpp does for the events etc ?

Most helpful comment

@joeblew99

I ported the textedit example, you can find it here: https://github.com/therecipe/qt/tree/master/internal/examples/widgets/textedit

All 7 comments

Hey

You only need to import the core, gui and widgets module, as all classes you need are probably in those 3 modules.

I'm not sure if this editor supports markdown, but I found another markdown example here:
http://doc.qt.io/qt-5/qtwebengine-webenginewidgets-markdowneditor-example.html

Not sure, if those can be combined.

And to port this over, I would start with the main.cpp and then move further down.
The examples rely heavily on own C++ classes to implement functions, but in Go you can most of the time simply create a new instance with New* and implement the signals/slots/virtual functions at runtime with *.Connect*

Ok thanks for the tips. It really does help to know i am on the right track.

@joeblew99

I ported the textedit example, you can find it here: https://github.com/therecipe/qt/tree/master/internal/examples/widgets/textedit

that works, very impressed

@therecipe thankyou ! Will try it out..

Yeah, pretty good indication of the kind of really fast, cross-platform fun we're in for now :).

This is working well in the examples for me too.
SO closing....

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ismlsmile picture ismlsmile  路  5Comments

Litarvan picture Litarvan  路  3Comments

ohenepee picture ohenepee  路  4Comments

tapir picture tapir  路  5Comments

tjma2001 picture tjma2001  路  3Comments