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

KTextEditor

Coding Guidelines and API Conventions

Overview | Design | Coding Guidelines | Porting to KDE 4 | Using

All KTextEditor interfaces have a consistent design.

  • naming follows Qt style. Avoid Java style getters like getSomeData() for example,
  • core interfaces (see Overview of the Core Interface Design) which inherit QObject declare all signals as real signals,
  • all other interfaces, which do not subclass QObject, must declare their signals as virtual private member functions. An implementation must reimplement this virtual member function as a real signal.
  • all signals have the sender object as first parameter, for example all document signals have to look like this:
    void signalFromDocument (KTextEditor::Document *doc, ...);
    This allows easy and consistent query which object did send the signal, which is important for most applications, as they listen to multiple documents/views/editors/...
  • all interface functions should be virtual, to allow subclasses to overwrite them, most members should even be pure virtual, beside additional convenience/helper functions.

The interface KTextEditor::Cursor represents a cursorposition, i.e. a line/column tuple. The same holds for KTextEditor::Range. As both of this concepts are much cleaner than tuples, please keep the following guidelines:

  • never use line/column tuples in parameter lists, use KTextEditor::Cursor instead,
  • never use Cursor/Cursor tuples for ranges, use KTextEditor::Range instead of two Cursors.
Author
Christoph Cullmann <cullm.nosp@m.ann@.nosp@m.kde.o.nosp@m.rg>
Dominik Haumann <dhdev.nosp@m.@gmx.nosp@m..de>
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