PDA

View Full Version : QTextEdit and atomic blocks?



zaphod.b
4th October 2016, 15:59
Hi all,

I wish to extend QTextEdit by the concept of atomic blocks. Think of the text as an editable template that consists of "normal" text and placeholders. The placeholders consist of strings and can be added to or removed from the text but only as atomic blocks. They shall be rendered different from "normal" text. In every other respect they shall be handled like a single character, i.e. the cursor should skip them, select as a whole only, and so on.

How would you go about this? Do I need to do this "on foot", or is there a high-level approach? Maybe I even missed something out-of-the-box?

I'm currently on 5.3.2, but switching to "hottest sh*t" should be feasible if called for.
Also, QWidgets for now but QML a future option.

Thanks a lot!