html mail composer
Closed, ResolvedPublic

Related Objects

mbohlender triaged this task as Normal priority.
mbohlender raised the priority of this task from Normal to Needs Triage.

Note that we can't use TextEdit.textDocument to modify the content: https://doc.qt.io/qt-5/qquicktextdocument.html

The TextEdit is of course entirely unsuitable for an HTML editor. It literally just listens for a textchange and then copies whatever format it finds (https://code.woboq.org/qt5/qtdeclarative/src/quick/items/qquicktextcontrol.cpp.html#273), which means the only way to change the format is to insert some text, which of course falls flat on it's face if you try to e.g. toggle bold and then continue writing without selecting something first.

The only proper way would be if we could get a hold of the internal cursor and set it's text formatting. But of course we cant.

Options we have:

  • Try to use the TextEdit read-only and insert all text via our own cursor (this could actually lead to something useful). This means we'll have to capture all keyboard input and somehow deal with the cursor position.
  • Try some unknown hack to make this work.
  • Somehow implement an html editor in a webview
  • implement an editor component from scratch.
cmollekopf moved this task from Backlog to In Progress on the Kube (0.5) board.Sep 13 2017, 10:56 AM

The format caching approach works somewhat, but unfortunately unreliably. The html composer is hidden until this is resolved.

cmollekopf triaged this task as Low priority.Sep 13 2017, 10:57 AM
cmollekopf moved this task from In Progress to Backlog on the Kube (0.5) board.

WebEngineView gained support for editing with Qt 5.10, see WebEngineView.InsertOrderedList and related. This may or may not be an easier way to create a somewhat fully featured html composer.

So no freeze on 5.9 LTS?

We'll stick to 5.9 for now. I just stumbled over this and we'll have to evaluate what the best approach is when we improve the editor. So this was just a note, not a concrete plan.

cmollekopf edited projects, added Kube; removed Kube (0.5).Jan 10 2018, 12:04 PM
cmollekopf closed this task as Resolved.Jul 31 2018, 4:11 PM
cmollekopf claimed this task.

We already have a basic editor and support for lists is doable on top of what we have.