Skip to content

Add support for QTextBlockFormat::marker

Igor Poboiko requested to merge poboiko/kpimtextedit:checkbox into master

This patch enables use of QTextBlockFormat::marker introduced in Qt 5.14. Using it, any list element can be marked with interactive checkbox.

Here's short demonstration of the behavior: checkbox

It adds a KToggleAction with which user can toggle this checkbox.

Brief explanation of the logic:

  • If the cursor is already on a list, we just toggle the marker
  • If the cursor is not on a list, we have to add a list first (having a marker without a list just does nothing)
  • If the cursor was on the single-element list, and we have disabled the marker, disable the list too.

This could be quite useful in KJots (enables users to write various checklists). In principle I could implement this in KJots only, but I thought it might be nice thing to have in KPIMTextEdit.

Merge request reports