March 20, 2012

_DarkAngel_ _DarkAngel_
Lab Rat
15 posts

Implementing multi-selection in QTextEdit

 

Hi all,

I’m developing a QTextEdit-based editor, and I need to implement “block mode”. In that mode, rectangular blocks must be selected, instead of standard continuous selection. The pic below illustrates what I mean.

the pic

To be honest, I’ve already implemented that mode using the QTextEdit::ExtraSelection class and setExtraSelections() function, but the code looks not very well and there are still some issues.

So, any ideas? All I’ve googled is a suggestion to use Q3TextEdit which somehow supports multi-selection, but, of course, that is not what I need. I can post my code if necessary.

1 reply

March 26, 2012

_DarkAngel_ _DarkAngel_
Lab Rat
15 posts

No ideas?

It would be also fine to implement some mode in which it’s possible to position the cursor at any point of the edit. I mean something like Borland Delphi’s source code editor.

 
  ‹‹ How to detect when icon clicked in item delegate ?      [WIP] Equivalent of QTabWidget with tabs on left and horizontal text ››

You must log in to post a reply. Not a member yet? Register here!