[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ktexteditor-devel
Subject:    Re: interface for arbitrary highlight?
From:       Dominik Haumann <dhdev () gmx ! de>
Date:       2007-02-07 10:25:19
Message-ID: 200702071125.19326.dhdev () gmx ! de
[Download RAW message or body]

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.

> Though there is no obvious way to set an attribute for a smartrange
> either?

smartrange.cpp says:

void SmartRange::setAttribute( Attribute::Ptr attribute )
{
  if (attribute == m_attribute)
    return;

  Attribute::Ptr prev = m_attribute;

  m_attribute = attribute;

  foreach (SmartRangeNotifier* n, m_notifiers)
    emit n->rangeAttributeChanged(this, attribute, prev);

  foreach (SmartRangeWatcher* w, m_watchers)
    w->rangeAttributeChanged(this, attribute, prev);
}

So with setAttribute you can assign an Attribute. I guess KatePart
is supposed to see that and draw the content accordingly.

I'd call that the "obvious way", I have now idea whether it really
works, though :-)

See also:
http://www.englishbreakfastnetwork.org/apidocs/apidox-kde-4.0/kdelibs-apidocs/interfaces/ktexteditor/html/classKTextEditor_1_1SmartRange.html
 http://www.englishbreakfastnetwork.org/apidocs/apidox-kde-4.0/kdelibs-apidocs/interfaces/ktexteditor/html/classKTextEditor_1_1Attribute.html


Dominik
_______________________________________________
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