Giter Site home page Giter Site logo

ktexteditor's Introduction

KTextEditor

Full text editor component

Introduction

KTextEditor provides a powerful text editor component that you can embed in your application, either as a KPart or using the KF5::TextEditor library (if you need more control).

The text editor component contains many useful features, from syntax highlighting and automatic indentation to advanced scripting support, making it suitable for everything from a simple embedded text-file editor to an advanced IDE.

Usage

KPart

As with other KParts, you should use KParts::MainWindow as your main window. You can directly request "katepart", as in

KService::Ptr service = KService::serviceByDesktopName("katepart");
if (service) {
    m_part = service->createInstance<KParts::ReadWritePart>();
}

See the KParts documentation for more information on using KParts.

Library

If you are using CMake, you need to have

find_package(KF5TextEditor)

(or similar) in your CMakeLists.txt file, and you need to link to KF5::TextEditor.

After that, you can use KTextEditor::Editor to create an editor instance, and use that to manage KTextEditor::Document instances.

#include <KTextEditor/Document>
#include <KTextEditor/Editor>
#include <KTextEditor/View>

KTextEditor::Editor *editor = KTextEditor::Editor::instance();
// create a new document
KTextEditor::Document *doc = editor->createDocument(this);
// create a widget to display the document
KTextEditor::View *view = doc->createView(containerWidget);

See the documentation for these classes for more information.

Licensing

Contributions to KTextEditor shall be licensed under LGPLv2+.

All files shall contain a proper "SPDX-License-Identifier: LGPL-2.0-or-later" identifier inside a header like:

/*
    SPDX-FileCopyrightText: 2021 Christoph Cullmann <[email protected]>

    SPDX-License-Identifier: LGPL-2.0-or-later
*/

Further Documentation

  • @ref kte_design
  • @ref kte_port_to_5
  • @ref kte_guidelines

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.