#StackBounty: #c++ #qt #text-editor Qt: Multiple Text Cursors in QPlainTextEdit

Bounty: 300

In Sublime Text, if you hold control while clicking, you can add another cursor to the document, allowing you to type and edit in multiple places at once. I’m trying to recreate this with Qt’s QPlainTextEdit. The logic seems pretty simple…

  • On Ctrl+click, create and store a new cursor at location of the click

  • Draw all cursors

  • When any key events happen, make sure the other cursors also receive them

However, it seems that in order to do these things, I have to understand exactly how QPlainTextEdit works, and while I have a loose understanding, I find the source to be very dense and difficult to navigate.

While this feature is very important to me, I can’t afford to spend a month on it. I don’t know how to reasonably proceed. Is there some open source text editor built with Qt that has this feature? Can I in fact implement it without thoroughly understanding how QPlainTextEdit works? Is there some other solution I have not considered? I thought this would be trivial, or at the very least someone might have solved it before, but that doesn’t appear to be the case. Any advice is appreciated.


Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.