• Skip to content
  • Skip to link menu
Brand

API Documentation

  1. KDE API Reference
  2. The KDE Frameworks
  3. KTextEditor
  • KDE Home
  • Contact Us

Quick Links

Skip menu "KTextEditor"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • File List
  • Modules
  • Dependencies
  • Related Pages

Class Picker

About

Advanced embeddable text editor

Maintainer
Christoph Cullmann
Supported platforms
FreeBSD, Linux, MacOSX, Windows
Community
IRC: #kde-devel on Freenode
Mailing list: kde-frameworks-devel
Use with CMake
find_package(KF5TextEditor)
target_link_libraries(yourapp KF5::TextEditor)
Use with QMake
QT += KTextEditor 
Clone
git clone git://anongit.kde.org/ktexteditor.git
Browse source
KTextEditor on cgit.kde.org

KTextEditor

  • View on LXR
  • KTextEditor
  • AnnotationViewInterfaceV2
Public Member Functions | List of all members
KTextEditor::AnnotationViewInterfaceV2 Class Referenceabstract
View Extension Interfaces

#include <annotationinterface.h>

Inheritance diagram for KTextEditor::AnnotationViewInterfaceV2:
Inheritance graph
[legend]

Public Member Functions

virtual KTextEditor::AbstractAnnotationItemDelegate * annotationItemDelegate () const =0
 
virtual void setAnnotationItemDelegate (KTextEditor::AbstractAnnotationItemDelegate *delegate)=0
 
virtual void setAnnotationUniformItemSizes (bool uniformItemSizes)=0
 
virtual bool uniformAnnotationItemSizes () const =0
 
- Public Member Functions inherited from KTextEditor::AnnotationViewInterface
virtual void annotationActivated (KTextEditor::View *view, int line)=0
 
virtual void annotationBorderVisibilityChanged (KTextEditor::View *view, bool visible)=0
 
virtual void annotationContextMenuAboutToShow (KTextEditor::View *view, QMenu *menu, int line)=0
 
virtual bool isAnnotationBorderVisible () const =0
 
virtual void setAnnotationBorderVisible (bool visible)=0
 
- Public Member Functions inherited from KTextEditor::AnnotationInterface
virtual AnnotationModel * annotationModel () const =0
 
virtual void setAnnotationModel (AnnotationModel *model)=0
 

Detailed Description

Annotation interface for the View, version 2.

Introduction

The AnnotationViewInterfaceV2 allows to do the same as AnnotationViewInterface and additionally

  • (1) set a custom AbstractAnnotationItemDelegate for the View.

For a more detailed explanation about whether you want to set a custom delegate for rendering the annotations, read the detailed documentation about the AbstractAnnotationItemDelegate.

Accessing the AnnotationViewInterface

The AnnotationViewInterfaceV2 is an extension interface for a View, i.e. the View inherits the interface provided that the used KTextEditor library implements the interface. Use qobject_cast to access the interface:

// view is of type KTextEditor::View*
auto iface = qobject_cast<KTextEditor::AnnotationViewInterfaceV2*>(view);
if (iface) {
// the implementation supports the interface
// do stuff
iface->setAnnotationItemDelegate(myDelegate);
iface->setAnnotationUniformItemSizes(true);
} else {
// the implementation does not support the interface
}
Since
5.53

Definition at line 314 of file annotationinterface.h.

Member Function Documentation

virtual KTextEditor::AbstractAnnotationItemDelegate* KTextEditor::AnnotationViewInterfaceV2::annotationItemDelegate ( ) const
pure virtual

Returns the currently used AbstractAnnotationItemDelegate.

Returns
the current AbstractAnnotationItemDelegate
virtual void KTextEditor::AnnotationViewInterfaceV2::setAnnotationItemDelegate ( KTextEditor::AbstractAnnotationItemDelegate *  delegate)
pure virtual

Sets the AbstractAnnotationItemDelegate for this view and the model to provide custom rendering of annotation information for each line.

Ownership is not transferred.

Parameters
delegatethe new AbstractAnnotationItemDelegate, or nullptr to reset to the default delegate
virtual void KTextEditor::AnnotationViewInterfaceV2::setAnnotationUniformItemSizes ( bool  uniformItemSizes)
pure virtual

This function can be used to declare whether it is known that the annotation items rendered by the set delegate all have the same size.

This enables the view to do some optimizations for performance purposes.

By default the value of this property is false .

Parameters
uniformItemSizesif true the annotation items are considered to all have the same size
virtual bool KTextEditor::AnnotationViewInterfaceV2::uniformAnnotationItemSizes ( ) const
pure virtual

Checks whether the annotation items all have the same size.


The documentation for this class was generated from the following file:
  • annotationinterface.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2019 The KDE developers.
Generated on Thu Dec 12 2019 02:25:29 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal