KTextEditor::TextHintProvider

Search for usage in LXR

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 41 of file texthintinterface.h.

Constructor & Destructor Documentation

◆ TextHintProvider()

TextHintProvider::TextHintProvider ( )
default

Default constructor.

◆ ~TextHintProvider()

TextHintProvider::~TextHintProvider ( )
virtualdefault

Virtual destructor to allow inheritance.

Member Function Documentation

◆ textHint()

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().

Parameters
viewthe view that requests the text hint
positiontext cursor under the mouse position
Returns
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-2024 The KDE developers.
Generated on Fri May 3 2024 11:46:29 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.