[prev in list] [next in list] [prev in thread] [next in thread]
List: ktexteditor-devel
Subject: Re: interface for arbitrary highlight?
From: Anders Lund <anders () alweb ! dk>
Date: 2007-02-07 22:56:16
Message-ID: 200702072356.18913.anders () alweb ! dk
[Download RAW message or body]
On Wednesday 07 February 2007, Hamish Rodda wrote:
> On Wednesday 07 February 2007 21:25, Dominik Haumann wrote:
> > On Tuesday 06 February 2007 23:20, Anders Lund wrote:
> > > On Tuesday 06 February 2007, Anders Lund wrote:
> > > > Hamish made me aware of the smartinterface, which I'm going to use
> >
> > Ah right, this is only possible with SmartRanges.
>
> Yep. See the code in kdelibs/kate/tests/arbitraryhighlighttest.cpp for a
> crude example.
I have now this code:
KTextEditor::SmartInterface *si =
qobject_cast<KTextEditor::SmartInterface*>( m_view->document() );
if( ! si )
return;
d->liRange = si->newSmartRange();
KTextEditor::Attribute::Ptr a( new KTextEditor::Attribute() );
a->setBackground( QColor("red") );
a->setForeground( QColor("black") );
d->liRange->setAttribute( a );
This is in the pluginviews constructor.
But it doesn't work. When the smartrange is changed using setRange() so that
it contains text that should be highlighted, it isn't.
-anders
--
www: http://www.alweb.dk
jabber: anderslund@jabber.dk
_______________________________________________
KTextEditor-Devel mailing list
KTextEditor-Devel@kde.org
https://mail.kde.org/mailman/listinfo/ktexteditor-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic