HighlightInterface

Thomas Zander zander at kde.org
Wed Oct 3 08:45:38 BST 2007


On Wednesday 03 October 2007 09:22:10 Anders Lund wrote:
> I know we have the API freeze coming up, but to me this is a bad loss.
> Would it be OK if I add this option today?
>
> It's the question of adding one method
>
> virtual QString highlightSection( QString highlightName ) = 0;

What about returning a Cursor instead? 
In QTextDocument (as an example) you create a QTextCursor which has a position 
and an anchor, which together makes a range.   You can have as many cursors 
on the document as you want.
So in KWord I create a highlight section by creating a new QTextCursor and 
setting the range. 
I should note that in contrary to KTextEditor::Cursor the QTextCursor has a 
selectedText() method.

I think it makes a lot of sense to follow that design instead of moving away 
further.

> to KTextEditor::Document
>
> and of course implementation in KateDocument?
-- 
Thomas Zander
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20071003/86afbe60/attachment.sig>


More information about the kde-core-devel mailing list