KTextEditor
KTextEditor::CoordinatesToCursorInterface Class Reference
[View Extension Interfaces]
Pixel coordinate to Cursor extension interface for the View. More...
#include <view.h>
Public Member Functions | |
virtual KTextEditor::Cursor | coordinatesToCursor (const QPoint &coord) const =0 |
virtual | ~CoordinatesToCursorInterface () |
Detailed Description
Pixel coordinate to Cursor extension interface for the View.
Introduction
The CoordinatesToCursorInterface makes it possible to map a pixel coordinate to a cursor position. To map a cursor position to pixel coordinates use one of
Accessing the CoordinatesToCursorInterface
The CoordinatesToCursorInterface 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* KTextEditor::CoordinatesToCursorInterface *iface = qobject_cast<KTextEditor::CoordinatesToCursorInterface*>( view ); if( iface ) { // the implementation supports the interface // do stuff }
- See also:
- KTextEditor::View
- Since:
- 4.2
- Note:
- KDE5: merge into KTextEditor::View
Definition at line 596 of file view.h.
Constructor & Destructor Documentation
CoordinatesToCursorInterface::~CoordinatesToCursorInterface | ( | ) | [virtual] |
Virtual destructor.
Definition at line 443 of file ktexteditor.cpp.
Member Function Documentation
virtual KTextEditor::Cursor KTextEditor::CoordinatesToCursorInterface::coordinatesToCursor | ( | const QPoint & | coord | ) | const [pure virtual] |
Get the text-cursor in the document from the screen coordinates, relative to the view widget.
To map a cursor to pixel coordinates (the reverse transformation) use KTextEditor::View::cursorToCoordinate().
- Parameters:
-
coord coordinates relative to the view widget
- Returns:
- cursor in the View, that points onto the character under the given coordinate. May be KTextEditor::Cursor::invalid().
The documentation for this class was generated from the following files: