• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • applications API Reference
  • KDE Home
  • Contact Us
 

KTextEditor

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

#include <view.h>

Public Member Functions

virtual ~CoordinatesToCursorInterface ()
 
virtual KTextEditor::Cursor coordinatesToCursor (const QPoint &coord) const =0
 

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

  • KTextEditor::View::cursorToCoordinate()
  • KTextEditor::View::cursorPositionCoordinates()

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 (or name it ViewportInterface and add accessors to the QScrollBars and convenience functions like cursorToCoordinate(), scollLines(int count), etc.

Definition at line 639 of file view.h.

Constructor & Destructor Documentation

CoordinatesToCursorInterface::~CoordinatesToCursorInterface ( )
virtual

Virtual destructor.

Definition at line 300 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
coordcoordinates 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:
  • view.h
  • ktexteditor.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:48 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KTextEditor

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

applications API Reference

Skip menu "applications API Reference"
  •   kate
  •       kate
  •   KTextEditor
  •   Kate
  • Konsole

Search



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