KTextEditor::TextHintProvider Class Referenceabstract

#include <texthintinterface.h>

Public Member Functions

 TextHintProvider ()
virtual ~TextHintProvider ()
virtual QString textHint (KTextEditor::View *view, const KTextEditor::Cursor &position)=0

Detailed Description

Class to provide text hints for a View.

The class TextHintProvider is used in combination with TextHintInterface. TextHintProvider allows to provide text hint information for text under the mouse cursor.

To use this class, derive your provider from TextHintProvider and register it with TextHintInterface::registerTextHintProvider(). When not needed anymore, make sure to remove your provider by calling TextHintInterface::unregisterTextHintProvider(), otherwise the View will contain a dangling pointer to your potentially deleted provider.

Detailed information about how to use the TextHintInterface can be found in the documentation about the TextHintInterface.

See also
TextHintInterface since 5.0

Definition at line 137 of file texthintinterface.h.

Constructor & Destructor Documentation

TextHintProvider::TextHintProvider ( )

Default constructor.

Definition at line 253 of file ktexteditor.cpp.

TextHintProvider::~TextHintProvider ( )

Virtual destructor to allow inheritance.

Definition at line 257 of file ktexteditor.cpp.

Member Function Documentation

virtual QString KTextEditor::TextHintProvider::textHint ( KTextEditor::View view,
const KTextEditor::Cursor position 
pure virtual

This function is called whenever the users hovers over text such that the text hint delay passes.

Then, textHint() is called for each registered TextHintProvider.

Return the text hint (possibly Qt richtext) for view at position.

If you do not have any contents to show, just return an empty QString().

viewthe view that requests the text hint
positiontext cursor under the mouse position
text tool tip to be displayed, may be Qt richtext

The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Wed Aug 12 2020 22:57:38 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.